05-08-2012 08:36 AM
<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>
05-09-2012 07:17 AM
<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>
This is my CustomWorkflowAction class. 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");
}
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.