As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
String recipient = (String) executionContext.getVariable(ExternalReviewNotification.RECIP_PROCESS_VARIABLE); StringBuffer sb = new StringBuffer(); sb.append("You have been assigned to a task named "); sb.append(executionContext.getToken().getNode().getName()); sb.append(". Take the appropriate action by clicking one of the links below:\r\n\r\n"); List transitionList = executionContext.getNode().getLeavingTransitions(); for (Iterator it = transitionList.iterator(); it.hasNext(); ) { Transition transition = (Transition)it.next(); sb.append(transition.getName()); sb.append("\r\n"); sb.append("http://localhost:8080/alfresco/service/someco/bpm/review?id=jbpm$"); sb.append(executionContext.getProcessInstance().getId()); sb.append("-@"); sb.append("&action="); sb.append(transition.getName()); sb.append("&guest=true"); sb.append("\r\n\r\n"); }
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wcmwf:submitcustom"> <swimlane name="initiator"/> <start-state name="start"> <task name="wcmwf:submitReviewTask" swimlane="initiator"/> <transition name="" to="validation"/> </start-state> <task-node name="validation"> <event type="node-enter"> <script> <variable name="wcmwf_reviewCycle" access="write"/> <variable name="wcmwf_reviewerCnt" access="write"/> <variable name="wcmwf_approveCnt" access="write"/> <variable name="wcmwf_reviewType" access="write"/> <expression> wcmwf_reviewCycle = 1; wcmwf_reviewerCnt = bpm_assignees.size(); wcmwf_approveCnt = 0; wcmwf_reviewType = wcmwf_submitReviewType; </expression> </script> <action class="com.sample.action.ValidateActionHandler" name="submit"></action> </event> <transition name="proceed" to="initialise"/> </task-node> ….. ….. </process-definition>
public class ValidateActionHandler extends JBPMSpringActionHandler { private WorkflowService workflowService; @Override protected void initialiseHandler(BeanFactory factory) { workflowService = (WorkflowService) factory.getBean(ServiceRegistry.WORKFLOW_SERVICE.getLocalName()); } public void execute(ExecutionContext executionContext) throws Exception { //Inside this method ,I need to get the files submitted to this WF ,so I can get using the taskId like this. // How can I get the taskId from this executionContext? List<NodeRef> contents =workflowService.getPackageContents("jbpm$1"); for(int j = 0; j < contents.size(); j++) { System.out.println("FILES SUBMITTED "+contents.get(j)); } } }