05-26-2009 10:53 AM
log4j.logger.org.alfresco.repo.jscript=debug
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:parallelgroupreview">
<swimlane name="initiator"/>
<start-state name="start">
<task name="wf:submitGroupReviewTask" swimlane="initiator" />
<transition name="" to="startreview">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Debut workflow";
mail.parameters.from = "it@xxx.fr";
mail.parameters.text = "GO TU VA MARCHER";
mail.execute(bpm_package);
</script>
</action>
</transition>
</start-state>
<node name="startreview">
<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
<foreach>#{people.getMembers(bpm_groupAssignee)}</foreach>
<var>reviewer</var>
</action>
<event type="node-enter">
<script>
<variable name="wf_approveCount" access="write" />
<expression>
wf_approveCount = 0;
</expression>
</script>
</event>
<transition name="review" to="review" />
</node>
<task-node name="review">
<task name="wf:reviewTask">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{reviewer}</actor>
</assignment>
</task>
<transition name="reject" to="endreview">
</transition>
<transition name="approve" to="endreview">
<script>
<variable name="wf_approveCount" access="read,write" />
<expression>
wf_approveCount = wf_approveCount +1;
</expression>
</script>
</transition>
</task-node>
<join name="endreview">
<transition to="isapproved" />
</join>
<decision name="isapproved">
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_reviewerCount" access="write"/>
<expression>people.getMembers(bpm_groupAssignee).length;</expression>
</script>
</action>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_requiredPercent" access="write"/>
<expression>wf_requiredPercent = wf_requiredApprovePercent;</expression>
</script>
</action>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="wf_actualPercent" access="write"/>
<expression>wf_actualPercent = ((wf_approveCount * 100) / people.getMembers(bpm_groupAssignee).length);</expression>
</script>
</action>
</event>
<transition name="reject" to="rejected"></transition>
<transition name="approve" to="approved">
<condition>#{wf_actualPercent >= wf_requiredApprovePercent}</condition>
</transition>
</decision>
<task-node name="rejected">
<task name="wf:rejectedParallelTask" swimlane="initiator"/>
<transition to="end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("Email " + initiator.properties.email);
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
mail.parameters.from = "it@xxxxxx.fr";
mail.parameters.text = "Document rejected";
mail.execute(bpm_package);
</script>
</action>
</transition>
</task-node>
<task-node name="approved">
<task name="wf:approvedParallelTask" swimlane="initiator"/>
<transition to="end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("Email " + initiator.properties.email);
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
mail.parameters.from = "it@xxx.fr";
mail.parameters.text = "Document approved";
mail.execute(bpm_package);
</script>
</action>
</transition>
</task-node>
<end-state name="end"/>
<event type="process-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("End of process.");
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "FIN du workflow";
mail.parameters.from = "it@xxx.fr";
mail.parameters.text = "FIN !!!!!!!!!";
mail.execute(bpm_package);
</script>
</action>
</event>
</process-definition>
05-26-2009 11:38 AM
05-26-2009 11:41 AM
05-26-2009 11:50 AM
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:adhoc">
<swimlane name="initiator"/>
<start-state name="start">
<task name="wf:submitAdhocTask" swimlane="initiator">
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("Debut du workflow AdhocTask");
var mail = actions.create("mail");
mail.parameters.to = "xxxxx@xxxx.fr";
mail.parameters.subject = "FIN du workflow";
mail.parameters.from = "it@xxxx.fr";
mail.parameters.text = "FIN !!!!!!!!!";
mail.execute(bpm_package);
</script>
</action>
</event>
</task>
<transition name="" to="adhoc"/>
</start-state>
<swimlane name="assignee">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<task-node name="adhoc">
<task name="wf:adhocTask" swimlane="assignee">
<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="" to="completed">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("passe2");
if (wf_notifyMe)
{
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties.email;
mail.parameters.text = "It's done";
mail.execute(bpm_package);
}
logger.debug("After mail ****************************************");
</script>
</action>
</transition>
</task-node>
<task-node name="completed">
<task name="wf:completedAdhocTask" swimlane="initiator"/>
<transition name="" to="end"/>
</task-node>
<end-state name="end"/>
</process-definition>
05-28-2009 08:03 AM
05-28-2009 02:26 PM
07-01-2009 08:11 AM
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.