Skip to main content
1-Visitor
September 22, 2016
Solved

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

  • September 22, 2016
  • 8 replies
  • 5720 views

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

Best answer by tgudobba

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
September 23, 2016

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!");

}

22-Sapphire I
September 23, 2016

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?