var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:review";
workflow.parameters["bpm:workflowDescription"] = "Asier.";
workflow.parameters["bpm:assignee"] = "ahernandez";
workflow.execute(document);
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:review">
<swimlane name="initiator" />
<start-state name="start">
<task name="wf:submitReviewTask" swimlane="initiator" />
<transition name="" to="review" />
</start-state>
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<pooledactors>#{bpm_assignee}</pooledactors>
</assignment>
</swimlane>
<task-node name="review">
<task name="wf:reviewTask" swimlane="reviewer">
<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="reject" to="rejected" />
<transition name="approve" to="approved" />
</task-node>
<task-node name="rejected">
<task name="wf:rejectedTask" swimlane="initiator"/>
<transition name="" to="end" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var mail = actions.create("mail");
mail.parameters.to = "ahernandez@theinit.com";
mail.parameters.subject = "Document approved ";
mail.parameters.from = "ahernandez@theinit.com";
mail.parameters.text = "It's done";
mail.execute(document);
</script>
</action>
</transition>
</task-node>
<task-node name="approved">
<task name="wf:approvedTask" swimlane="initiator" />
<transition name="" to="end" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var mail = actions.create("mail");
mail.parameters.to = "ahernandez@theinit.com";
mail.parameters.subject = "Document rejected ";
mail.parameters.from = "ahernandez@theinit.com";
mail.parameters.text = "It's done";
mail.execute(document);
</script>
</action>
</transition>
</task-node>
<end-state name="end" />
</process-definition>
# Email configuration
mail.host = mail.theinit.com
mail.port = 25
mail.transport.protocol = smtp
mail.username = prueba@theinit.com
mail.password = *********
mail.encoding=ISO-8859-1
<bean id="workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/review_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">true</prop>
</props>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.