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.
<transition name="reject" to="rejected" > <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <runas>admin</runas> <script> logger.log("Workflow Status"+ dmswf_workflowStatus); dmswf_workflowStatus = "Rejected"; </script> </action> </transition>
<task-node name="approve2"> <task name="dmswf:reviewTask2" swimlane="approver2"> <event type="task-create"> <script> if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate; if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority; </script> </event> </task> <transition name="approve" to="approved" > <action class="org.ace.dms.bean.CustomWorkflowApprove"/> </transition> <transition name="reject" to="rejected" > <action class="org.ace.dms.bean.CustomWorkflowReject"/> </transition> </task-node>
package org.ace.dms.bean; import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler; import org.jbpm.graph.exe.ExecutionContext; public abstract class CustomWorkflowAction extends JBPMSpringActionHandler { public static final String APPROVE = "Approved"; public static final String REJECT = "Rejected"; public static final String WORKFLOWSTATUS = "dmswf_workflowStatus"; public void updateWorkflowProperties(ExecutionContext context, String workflowStatus) { //update custom workflow property dmswf_workflowStatus, you can update any workflow property here context.setVariable(WORKFLOWSTATUS, workflowStatus); } }
package org.ace.dms.bean; import org.jbpm.graph.exe.ExecutionContext; import org.springframework.beans.factory.BeanFactory; public class CustomWorkflowApprove extends CustomWorkflowAction { @Override public void execute(ExecutionContext context) throws Exception { updateWorkflowProperties(context, CustomWorkflowAction.APPROVE); } @Override protected void initialiseHandler(BeanFactory factory) { // TODO Auto-generated method stub System.out.println("Initialzize Handler"); } }