on 10-14-2008 9:21 AM
Hi Gurus,
I want to submit a XML form directly for approval without anyone
going to submit for approval.
I have gone thru the forums, have conjured that a repository service needs to be written.
i wrote that, this is the code.
protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
// Implement this method: Usually the service registers itself for certain events at the repository manager.
try{
mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_CHILD, null));
}catch(WcmException e){
}
public void received(IEvent event) {
IResource resource = (IResource)event.getParameter();
try{
// get the statemanagement service from the resource
IRepositoryServiceFactory factory = ResourceFactory.getInstance().getServiceFactory();
IStatemanagementManager statemanagement =
(IStatemanagementManager)factory.getRepositoryService(resource, IWcmConst.STATEMANAGEMENT_SERVICE);
IStatemanagementResource sResource =
statemanagement.getStatemangementResource(resource);
IResourceTransition transition = sResource.getTransition("lbl.submit");
// if everything is correct than transition is not null
if (transition != null)
{transition.execute();
}
}catch(Exception e){
e.printStackTrace();
}
These are the following issues coming up.
1)
I have deployed and activated this service for the required repository.
When i restart the server there is no efffect, if i create a document it still gets created in "in progress" status.
But i can manually start the approval process.
I have already got one sample service running which renames all the files created.
I am on EP 7.0 SPS 16
2)
One more issue i noticed is that if i deploy the service and i dont restart the server I am unable to start the approval process even manually.
It throws me an error like
Could not execute command 'com.sapportals.wcm.rendering.uicommand.cm.UIStatemanagementCommand'
Could anyone please throw some light as to why this is happening or why the service isnt working, since everywhere on the forums i saw this is the code which is functional.
Any help would be appreciated.
Thanks and Regards,
Nikhil
Hi,
No i have not created a schedular service.
My requirement is that whenever a document is created in a particular repository it should be submitted for approval without anyone doing it manually.
Hence i have written the above repository service which listen to the event that a document is created.
The problem is that listening to the event is not a problem
since i can see the change in the name.
I have explained the issues in my first post.
Regards,
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Check this Note:
I had the same problem and the solution of the note solved it.
Regards,
Nicolá
Hi,
Have u created schedullar service?
If yes then,
In IRFServiceWrapper.java u want to set Key value
like,
public static final String KEY = "YourPackageName.YourClassName";
Points are welcome
regards,
Kathiresan R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.