on 2015 Sep 18 6:49 AM
Hi,
We have a custom workflow defined for document approval. One of the workflow instance needs to be re-routed to new approver. Hence I want to cancel this instance and trigger new workflow. But when I go to setup-> workflow definitions -> <custom workflow> ->Current workflow processes.
I can't find this instance.
Where can I find this instance or is there any other way to cancel it?
Thanks,
Deepti
Hello Deepti,
Could you please elaborate.
-Has the document gone through all the phases?
-Is the document locked?(in approval phase)
Regards,
Vignesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vignesh,
We have below stages for document.
'Evaluation' -> 'internal approval 1' ->'internal approval2'
Document is gone through 'internal approva1'. But at that stage, it was cancelled by admin.
If a document is cancelled, ideally it should go to 'Evaluation' stage in our case. But this did not happen. After cancellation also, it is showing 'internal approval' stage in document properties.
But in current workflow list, this document is missing.
I think, after cancellation, some error occurred and workflow did not go to 'Evaluation' stage.
In such a situation, what can be workaround?
And yes, document is locked by system.
Hello Deepti,
Thanks for the addition information.
In this case, you should write a custom toolbar script to unlock the document.
IapiDocumentLockManager.unlockDocument(session,doc);
The above script would unlock the document after which you can move the phase back to initial phase and start the workflow process again.
Hope this solves your issue.
Regards,
Vignesh
Hello Deepti,
Yes, This is possible. Please find the below script:
groupMemColl = IBeanHomeLocator.lookup(session,com.sap.odp.api.usermgmt.masterdata.GroupIBeanHomeIfc.sHOME_NAME).findGroup("Internal name of the group").getMemberUserNamesAsCollection();
if(groupMemColl.size() > 0){
groupMemCollIter = groupMemColl.iterator();
while(groupMemCollIter.hasNext()){
groupMemCollIterMem = groupMemCollIter.next();
if(groupMemCollIterMem.toString().equalsIgnoreCase(session.getAccount().getUserName())){
//Write the complete unlock script under this block
}
}
}
Hope this solved your issue.
Regards,
Vignesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.