70 likes | 306 Views
Reject on 1 st Reject Vote. Jeff Zemsky April 27 th , 2012. Reject on First Reject Vote. A sync robot can be set up as detailed below to listen to the vote on each task completion and re-route if a reject vote has been cast.
E N D
Reject on 1st Reject Vote Jeff Zemsky April 27th, 2012
Reject on First Reject Vote A sync robot can be set up as detailed below to listen to the vote on each task completion and re-route if a reject vote has been cast. // On the start transition of the voting activity in the workflow, initialize a process variable, // say theActivity to the current activity as shown. theActivity=(wt.workflow.work.WfAssignedActivity)self.getObject(); // Set up an object-based sync robot that listens to the ACTIVITY CONTEXT CHANGED event on theActivityobject // Have an expression in the sync robot that uses WfTally to verify if any of the votes has been ‘Rejected’ // If so, have the sync robot set the result to this value, there would be a link associated with this value ‘Rejected’ // which diverts the workflow path as desired (to say, a loop-back) System.out.print("Activity changed event fired."); wt.fc.ObjectReferenceobjRef = new wt.fc.ObjectReference(); objRef.setObject(theActivity); result = wt.workflow.work.WfTally.any(objRef, "Rejected", ""); System.out.println("Result is " + result); // Terminate the activity java.lang.StringresultStr = (java.lang.String)result; if(resultStr.equalsIgnoreCase("Rejected")){ System.out.println("Found rejected vote ...... terminating Decide activity"); theActivity.changeState(wt.workflow.engine.WfTransition.TERMINATE); }