Skip to main content
1-Visitor
Sep 22, 2016 10:58 AM UTC
Solved

A workflow is getting terminated when the object is in checked out state. How to avoid workflow termination

Workflow gets terminated when the user clicks on complete task while keeping the object is in checked out state. How to avoid the workflow termination? Would like to give a warning message to the user that object is in checked out state and previous activity should work. Please let me know how to do this.

Thanks in advance

tgudobbaAnswer
14-Alexandrite
Sep 23, 2016 8:20 PM UTC

Prasi,

Add this to the condition in the required transition under the Transition tab of the workflow activity;

if(wt.vc.wip.WorkInProgressHelper.isCheckedOut((wt.vc.wip.Workable) primaryBusinessObject))

{

throw new java.lang.Exception("The workflow document is checked out, Please check it in to complete this task!");

}

8 replies

tgudobba14-AlexandriteAnswer
14-Alexandrite
Sep 23, 2016 8:20 PM UTC

Prasi,

Add this to the condition in the required transition under the Transition tab of the workflow activity;

if(wt.vc.wip.WorkInProgressHelper.isCheckedOut((wt.vc.wip.Workable) primaryBusinessObject))

{

throw new java.lang.Exception("The workflow document is checked out, Please check it in to complete this task!");

}

Translate
22-Sapphire I
Sep 23, 2016 8:34 PM UTC

This is great if it will work - much simpler than Business Rules.  Must be doing something wrong - just tried in multiple locations in a promotion - throws queue error.

Would this be added in an expression robot or the Start transition of an approval activity, or in the first conditional (which already has branching code) in the OTB promotion approval workflow template or other?

Are there some import statements or additional code needed in front of it?

Translate