mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
WCM submit (for approval) workflow.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,28 +1,144 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- This describes a process for submitting changed content in a user -->
|
||||
<!-- sandbox, via an approver, to the staging sandbox. -->
|
||||
|
||||
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:submit">
|
||||
|
||||
<swimlane name="initiator"/>
|
||||
|
||||
<start-state name="start">
|
||||
<task name="wf:submitWebContentTask" swimlane="initiator"/>
|
||||
<transition name="" to="review"/>
|
||||
</start-state>
|
||||
|
||||
<swimlane name="assignee">
|
||||
<assignment actor-id="#{bpm_assignee.properties['cm:userName']}"/>
|
||||
</swimlane>
|
||||
|
||||
<task-node name="review">
|
||||
<task name="wf:reviewTask" swimlane="assignee"/>
|
||||
<transition name="Approve" to="end">
|
||||
<action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
|
||||
</transition>
|
||||
</task-node>
|
||||
|
||||
<end-state name="end"/>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- This describes a process for submitting changed content in a user -->
|
||||
<!-- sandbox, via an approver, to the staging sandbox. -->
|
||||
|
||||
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wcmwf:submit">
|
||||
|
||||
<swimlane name="initiator"/>
|
||||
|
||||
<!-- -->
|
||||
<!-- Start Review -->
|
||||
<!-- -->
|
||||
|
||||
<start-state name="start">
|
||||
<task name="wcmwf:submitReviewTask" swimlane="initiator"/>
|
||||
<transition name="" to="serialorparallel"/>
|
||||
|
||||
<event type="node-leave">
|
||||
<script>
|
||||
<variable name="wcmwf_reviewerCnt" access="write"/>
|
||||
<variable name="wcmwf_approveCnt" access="write"/>
|
||||
<expression>
|
||||
wcmwf_reviewerCnt = bpm_assignees.size();
|
||||
wcmwf_approveCnt = 0;
|
||||
</expression>
|
||||
</script>
|
||||
</event>
|
||||
</start-state>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Split into Serial or Parallel Review -->
|
||||
<!-- -->
|
||||
|
||||
<decision name="serialorparallel">
|
||||
<transition name="serial" to="submitserialreview" />
|
||||
<transition name="parallel" to="submitparallelreview">
|
||||
<condition>#{wcmwf_reviewType == "Parallel"}</condition>
|
||||
</transition>
|
||||
</decision>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Serial Review -->
|
||||
<!-- -->
|
||||
|
||||
<decision name="submitserialreview">
|
||||
<transition name="endreview" to="endreview" />
|
||||
<transition name="review" to="serialreview">
|
||||
<condition>#{wcmwf_approveCnt < wcmwf_reviewerCnt}</condition>
|
||||
</transition>
|
||||
</decision>
|
||||
|
||||
<task-node name="serialreview">
|
||||
<task name="wcmwf:reviewTask">
|
||||
<event type="task-create">
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
taskInstance.actorId = bpm_assignees.get(wcmwf_approveCnt).properties.userName;
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
</task>
|
||||
|
||||
<transition name="reject" to="endreview" />
|
||||
<transition name="approve" to="submitserialreview">
|
||||
<script>
|
||||
<variable name="wcmwf_approveCnt" access="read, write"/>
|
||||
<expression>
|
||||
wcmwf_approveCnt = wcmwf_approveCnt + 1;
|
||||
</expression>
|
||||
</script>
|
||||
</transition>
|
||||
</task-node>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Parallel Review -->
|
||||
<!-- -->
|
||||
|
||||
<node name="submitparallelreview">
|
||||
<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
|
||||
<foreach>#{bpm_assignees}</foreach>
|
||||
<var>reviewer</var>
|
||||
</action>
|
||||
<transition name="review" to="parallelreview" />
|
||||
</node>
|
||||
|
||||
<task-node name="parallelreview">
|
||||
<task name="wcmwf:reviewTask">
|
||||
<event type="task-create">
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
taskInstance.actorId = reviewer.properties["cm:userName"];
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
</task>
|
||||
<transition name="reject" to="joinparallelreview" />
|
||||
<transition name="approve" to="joinparallelreview">
|
||||
<script>
|
||||
<variable name="wcmwf_approveCnt" access="read,write" />
|
||||
<expression>
|
||||
wcmwf_approveCnt = wcmwf_approveCnt +1;
|
||||
</expression>
|
||||
</script>
|
||||
</transition>
|
||||
</task-node>
|
||||
|
||||
<join name="joinparallelreview">
|
||||
<transition to="endreview" />
|
||||
</join>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- End the Review -->
|
||||
<!-- -->
|
||||
|
||||
<decision name="endreview">
|
||||
<transition name="rejected" to="rejected" />
|
||||
<transition name="approved" to="approved">
|
||||
<condition>#{wcmwf_approveCnt == wcmwf_reviewerCnt}</condition>
|
||||
<action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
|
||||
</transition>
|
||||
</decision>
|
||||
|
||||
<task-node name="rejected">
|
||||
<task name="wcmwf:rejectedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
<task-node name="approved">
|
||||
<task name="wcmwf:approvedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- End the Process -->
|
||||
<!-- -->
|
||||
|
||||
<end-state name="end"/>
|
||||
|
||||
</process-definition>
|
Reference in New Issue
Block a user