Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I urgently need help with a workflow. There are two tasks launched in parallel, each with the routing option to either Approve or Rework. I have an "AND" node which follows the tasks and then a conditional node in the workflow which asks the question: If either task routing selection is for Rework, otherwise, Approve to move forward in the workflow. The conditional statement doesn't have any syntax errors in it and looks like this:see below. But it's not working. Please be VERY specific with your response. Do I need to create a variable? Do I need to add "Route Choice" as a variable? I am desperate, and urgently need to complete this workflow and have it work ASAP. Thanks for any help you can provide.
WfAssignedActivity mySelf = ((WfAssignedActivity)self.getObject());
Vector userEvents = (Vector) mySelf.getUserEventList ( );
result = WfTally.any(self, "Rework", "Approved");
The mySelf WFAssignedActivity is probably referring to the conditional node in which the code resides... which has no voting. To do this by code you would need to reference each upstream activity and get the voting tally for each, then do some logic.
You could also create a task variable in each and use transition code to tally for each assignment individually upon completion and pass to process variables (one for each assignment)
I suggest an alternate approach... connect a downstream "OR" node to the upstream activities, "Rework" option and then route accordingly. Attach the "AND" node to the approve option of each upstream activity. It's worth noting that this will route for rework when either upstream task completes with a Rework without the other being completed (IMO this is beneficial because why waste time approving something being reworked). The uncompleted parallel task will disappear from the assigned User's task table but any links in notification emails will dead end.