Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi Preeti,
it's Simple,
Just write the following code in the routing transition on workflow,
wt.workflow.work.WfAssignedActivity activity = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.ProcessData actData = activity.getContext();
String tComments= " + actData.getTaskComments(); // this will return the comments
java.lang.Exception e = new java.lang.Exception("Comments is Empty ..............Your Exception Message to Quality Enr");
if tComments.trim().length() == 0
throw new wt.workflow.engine.FailedTransitionException ( e );
else
result="true";
hope this will work for your requirement!!!
Regards
MKR
Hello I happen to see your input. I have encountered same issue now when multiple user voting required. Can you please provide more details? I am now trying to use javascript as well. However I am not sure how to get the routing option filed values from the javascript.
I have tried using an exception (as in the post) to force the comment to be filled in on the trasition. This works for a task, however for later tasks if this code fires it caused the workflow process to terminate. Any idea what is happening?
Thanks,
Kelly Lozier
BMPC-KAPL
Hi Kelly,
I am facing a similar issue. Were you able to resolve the problem ?
I am checking for a condition in my complete transition, if it's not fulfilled an alert message should be shown to the user.
In my case this is happening for the first time but the workflow aborts after this.
Thanks,
Archit Todi
Please confirm that your java code is placed in the Complete transition of your workflow task. Do you have a screenshot?
Below is an example from one of my workflows. This is actually a workflow that is routed on a WTDocument PBO. One of the next steps is a Set State robot. So I want to make sure the WTDocument PBO is checked in before completing the workflow task. That is what the code does. If the WTDocument is checked out, then when the user clicks on the Complete Task button, it will throw an error and the task cannot be completed until the document is checked in.
Ben
Thanks for the reply, I was able to figure out the cause.
Although my code was present in the complete transition, I had checked the following under Execution Options:
After i unhecked the above option I was able to achieve the desired result.
Thanks
Archit Todi
Thanks for posting this. I had forgotten about those checkboxes and that functionality.
Since you found the solution for this problem ... does that mean it also resolves your other one over here?: Re: RE: 10.1 Workflow Exceptions now show exception log etc - I don't want this
1. create / modify the existing action and add onClick function
2. create a javascript function
3. varify the selection of routing and return false if you need a comment
May you advise how I can get two fields values on the task page from the javascript? Process and routing options. I need process name so I can limit this only to a certain wf and routing options to only RTI then comments should be required. Your help will be greatly appreciated.