mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged 1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4252 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4294 . svn revert root\common\common.xml svn resolved root\projects\repository\config\alfresco\script-services-context.xml git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4634 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
7
config/alfresco/extension/lifecycle-messages.properties
Normal file
7
config/alfresco/extension/lifecycle-messages.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
# For Lifecycle Workflow Example
|
||||
wfl_lifecycleapproval.workflow.title=Lifecycle Review & Approve
|
||||
wfl_lifecycleapproval.workflow.description=Lifecycle Review & Approval workflow (Auto updates document status)
|
||||
wfl_lifecycleapproval.node.review.transition.reject.title=Reject
|
||||
wfl_lifecycleapproval.node.review.transition.reject.description=Reject
|
||||
wfl_lifecycleapproval.node.review.transition.approve.title=Approve
|
||||
wfl_lifecycleapproval.node.review.transition.approve.description=Approve
|
@@ -0,0 +1,29 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="lifecycle.workflowBootstrap" parent="workflowDeployer">
|
||||
<property name="workflowDefinitions">
|
||||
<list>
|
||||
<props>
|
||||
<prop key="engineId">jbpm</prop>
|
||||
<prop key="location">alfresco/extension/lifecycle_processdefinition.xml</prop>
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
</list>
|
||||
</property>
|
||||
<property name="models">
|
||||
<list>
|
||||
<value>alfresco/extension/lifecycleModel.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="labels">
|
||||
<list>
|
||||
<value>alfresco/extension/lifecycle-messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
53
config/alfresco/extension/lifecycleModel.xml
Normal file
53
config/alfresco/extension/lifecycleModel.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<model name="wfl:workflowlifecyclemodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
||||
|
||||
<!-- Optional meta-data about the model -->
|
||||
<description>Workflow Lifecycle Model</description>
|
||||
<author></author>
|
||||
<version>1.0</version>
|
||||
|
||||
<!-- Imports are required to allow references to definitions in other models -->
|
||||
<imports>
|
||||
<!-- Import Alfresco Dictionary Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
|
||||
<!-- Import Alfresco Content Domain Model Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
|
||||
</imports>
|
||||
|
||||
<namespaces>
|
||||
<namespace uri="wfl.model" prefix="wfl" />
|
||||
</namespaces>
|
||||
|
||||
<constraints>
|
||||
<constraint name="wfl:status" type="LIST">
|
||||
<parameter name="allowedValues">
|
||||
<list>
|
||||
<value>Draft</value>
|
||||
<value>In Review</value>
|
||||
<value>Approved</value>
|
||||
</list>
|
||||
</parameter>
|
||||
</constraint>
|
||||
</constraints>
|
||||
|
||||
<aspects>
|
||||
|
||||
<!-- Status property is used to manage workflow approval -->
|
||||
<aspect name="wfl:status">
|
||||
<title>Status</title>
|
||||
<properties>
|
||||
<property name="wfl:status">
|
||||
<title>Status</title>
|
||||
<type>d:text</type>
|
||||
<default>Draft</default>
|
||||
<constraints>
|
||||
<constraint ref="wfl:status" />
|
||||
</constraints>
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
</aspects>
|
||||
|
||||
</model>
|
121
config/alfresco/extension/lifecycle_processdefinition.xml
Normal file
121
config/alfresco/extension/lifecycle_processdefinition.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfl:lifecycleapproval">
|
||||
|
||||
<swimlane name="initiator" />
|
||||
|
||||
<start-state name="start">
|
||||
<task name="wf:submitReviewTask" swimlane="initiator" />
|
||||
|
||||
<event type="node-leave">
|
||||
<!-- Call script once the workflow package exists i.e. on node-leave -->
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<!-- Apply the Workflow Lifecycle Aspect (wfl:status) if not set already. Note: The default wfl:status property is draft -->
|
||||
<script>
|
||||
for (var i = 0; i < bpm_package.children.length; i++)
|
||||
{
|
||||
if (!bpm_package.children[i].hasAspect("wfl:status"))
|
||||
{
|
||||
bpm_package.children[i].addAspect("wfl:status");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
|
||||
<transition name="" to="review" />
|
||||
</start-state>
|
||||
|
||||
<swimlane name="reviewer">
|
||||
<assignment actor-id="#{bpm_assignee.properties['cm:userName']}" />
|
||||
</swimlane>
|
||||
|
||||
<task-node name="review">
|
||||
<event type="node-enter">
|
||||
<!-- Update the status to In Review when we enter this task -->
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
for (var i = 0; i < bpm_package.children.length; i++)
|
||||
{
|
||||
bpm_package.children[i].properties["wfl:status"] = "In Review";
|
||||
bpm_package.children[i].save();
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
|
||||
<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">
|
||||
<event type="node-enter">
|
||||
<!-- Update the status to Draft when we enter this task -->
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
for (var i = 0; i < bpm_package.children.length; i++)
|
||||
{
|
||||
bpm_package.children[i].properties["wfl:status"] = "Draft";
|
||||
bpm_package.children[i].save();
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
|
||||
<task name="wf:rejectedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
<task-node name="approved">
|
||||
<event type="node-enter">
|
||||
<!-- Update the status to Approved when we enter this task -->
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
for (var i = 0; i < bpm_package.children.length; i++)
|
||||
{
|
||||
bpm_package.children[i].properties["wfl:status"] = "Approved";
|
||||
bpm_package.children[i].save();
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
|
||||
<task name="wf:approvedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
<end-state name="end" />
|
||||
|
||||
<event type="process-end">
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
if (cancelled)
|
||||
{
|
||||
for (var i = 0; i < bpm_package.children.length; i++)
|
||||
{
|
||||
if (bpm_package.children[0].hasAspect("wfl:status"))
|
||||
{
|
||||
bpm_package.children[i].properties["wfl:status"] = "Draft";
|
||||
bpm_package.children[i].save();
|
||||
}
|
||||
}
|
||||
if (logger.isLoggingEnabled()) logger.log("Workflow cancelled, status reset to Draft");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isLoggingEnabled()) logger.log("Workflow completed");
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
|
||||
</process-definition>
|
@@ -3,7 +3,7 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="sample.workflowBootstrap" parent="workflowDeployer">
|
||||
<bean id="parallel.workflowBootstrap" parent="workflowDeployer">
|
||||
<property name="workflowDefinitions">
|
||||
<list>
|
||||
<props>
|
||||
@@ -19,6 +19,8 @@
|
||||
<!-- NOTE: The above process definition relies on the default workflowModel.xml -->
|
||||
<!-- which is already registered during Alfresco startup. -->
|
||||
<!-- See bootstrap-context.xml (workflowBootstrap). -->
|
||||
|
||||
<!-- <value>alfresco/workflow/workflowModel.xml</value> -->
|
||||
</list>
|
||||
</property>
|
||||
<property name="labels">
|
||||
@@ -26,6 +28,8 @@
|
||||
<!-- NOTE: The above process definition relies on the default workflow-messages.properties -->
|
||||
<!-- which is already registered during Alfresco startup -->
|
||||
<!-- See bootstrap-context.xml (workflowBootstrap). -->
|
||||
|
||||
<!-- <value>alfresco/workflow/workflow-messages</value> -->
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
Reference in New Issue
Block a user