cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to cancel custom workflow instance

DeeptiChavare
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Deepti,

Could you please elaborate.

-Has the document gone through all the phases?

-Is the document locked?(in approval phase)

Regards,

Vignesh

DeeptiChavare
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

DeeptiChavare
Active Participant
0 Kudos

Hi Vignesh,

Thanks for your help.

As I am new to CLM, I have no idea how to write script/how to add in toolbar.

Is there any link or document you can share?

Thanks,
Deepti

Former Member
0 Kudos

Hello Deepti,

Please find below blog:

Regards,

Vignesh

DeeptiChavare
Active Participant
0 Kudos

Thanks Vignesh,

It solved my issue

DeeptiChavare
Active Participant
0 Kudos

Hi Vignesh,

I have written this script as toolbar script.

But we want to restrict access to this script to specific group of users (eg. administrators only).

Is it possible? Or is there any other way round?

Thanks,
Deepti

Former Member
0 Kudos

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

DeeptiChavare
Active Participant
0 Kudos

Thanks a lot Vignesh for your help.

This has solved my issue

Answers (0)