Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I have created the variable and check box is appearing as expected in the task page. there is this requirement where
there are 2 routing options, out of which for "Completed" routing option once selected it should not complete the task after clicking "Complete task" button until and unless the check box is selected. but where as the "Return_to_project_owner" routing option once selected even if the check box is not selected it should be allowed to complete the task.
till now I have this code in handy , which will not allow until the check box is selected but i wanted with routing option condition
public static Object[] criticalitytraceabilitycheck(Object result, boolean Criticalitycheck) throws Exception {
System.out.println("Enter WFT_PolEntChangeActivity.criticalitycheck --> ");
if (Criticalitycheck == false){
result = false;
String msg = "To complete the task, Please select check box";
java.lang.Exception exp = new java.lang.Exception(msg);
throw exp;
}
else {
result = true;
}
Object[] wfAutoExternResult = {result};
return wfAutoExternResult;
}
can anyone please help me on this for the code?
I think you’re overthinking this.
All you need to do is put the code in the Complete transition and the code can be as simple as this.
if (!Criticalitycheck){
throw new Exception("To complete the task, Please select check box.");
}
Hello @AK_10813265,
It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Community Moderation Team.