Implementing workflow instance image in ActivitiWorkflowEngine (+tests) and updated activiti admin-ui fixing popup-bug

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28333 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Frederik Heremans
2011-06-10 13:41:52 +00:00
parent 8db6f19a3a
commit 6c1f5649f1
10 changed files with 397 additions and 39 deletions

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<definitions id="adhoc-definitions" <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
typeLanguage="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
expressionLanguage="http://www.w3.org/1999/XPath" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
targetNamespace="http://activiti.org/bpmn20" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://alfresco.org">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitiAdhoc" name="Adhoc Activiti Process"> <process id="activitiAdhoc" name="Adhoc Activiti Process">
@@ -77,6 +75,42 @@
<endEvent id="theEnd" /> <endEvent id="theEnd" />
</process> </process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiAdhoc">
<bpmndi:BPMNPlane bpmnElement="activitiAdhoc" id="BPMNPlane_activitiAdhoc">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="adhocTask"
id="BPMNShape_adhocTask">
<omgdc:Bounds height="55" width="105" x="130"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="verifyTaskDone"
id="BPMNShape_verifyTaskDone">
<omgdc:Bounds height="55" width="105" x="290"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEnd"
id="BPMNShape_theEnd">
<omgdc:Bounds height="35" width="35" x="455" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="130" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="235" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="395" y="217"></omgdi:waypoint>
<omgdi:waypoint x="455" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions> </definitions>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions" <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
typeLanguage="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
expressionLanguage="http://www.w3.org/1999/XPath" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
targetNamespace="http://activiti.org/bpmn20" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://alfresco.org">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitiParallelGroupReview" name="Parallel Group Review And Approve Activiti Process"> <process id="activitiParallelGroupReview" name="Parallel Group Review And Approve Activiti Process">
@@ -169,4 +167,63 @@
</process> </process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiParallelGroupReview">
<bpmndi:BPMNPlane bpmnElement="activitiParallelGroupReview"
id="BPMNPlane_activitiParallelGroupReview">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask"
id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="125"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision"
id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="290" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved"
id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="390"
y="97"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected"
id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="390"
y="297"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="555" y="307"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="310" y="197"></omgdi:waypoint>
<omgdi:waypoint x="310" y="124"></omgdi:waypoint>
<omgdi:waypoint x="390" y="124"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="310" y="237"></omgdi:waypoint>
<omgdi:waypoint x="310" y="324"></omgdi:waypoint>
<omgdi:waypoint x="390" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="495" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="307"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="495" y="324"></omgdi:waypoint>
<omgdi:waypoint x="555" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions> </definitions>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions" <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
typeLanguage="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
expressionLanguage="http://www.w3.org/1999/XPath" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
targetNamespace="http://activiti.org/bpmn20" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://alfresco.org">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitiParallelReview" name="Parallel Review And Approve Activiti Process"> <process id="activitiParallelReview" name="Parallel Review And Approve Activiti Process">
@@ -150,5 +148,65 @@
<endEvent id="end" /> <endEvent id="end" />
</process> </process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiParallelReview">
<bpmndi:BPMNPlane bpmnElement="activitiParallelReview"
id="BPMNPlane_activitiParallelReview">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask"
id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="125"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision"
id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="290" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved"
id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="390"
y="97"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected"
id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="390"
y="297"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="555" y="307"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="310" y="197"></omgdi:waypoint>
<omgdi:waypoint x="310" y="124"></omgdi:waypoint>
<omgdi:waypoint x="390" y="124"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="310" y="237"></omgdi:waypoint>
<omgdi:waypoint x="310" y="324"></omgdi:waypoint>
<omgdi:waypoint x="390" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="495" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="307"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="495" y="324"></omgdi:waypoint>
<omgdi:waypoint x="555" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions> </definitions>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions" <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
typeLanguage="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
expressionLanguage="http://www.w3.org/1999/XPath" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
targetNamespace="http://activiti.org/bpmn20" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://alfresco.org">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitiReviewPooled" name="Pooled Review And Approve Activiti Process"> <process id="activitiReviewPooled" name="Pooled Review And Approve Activiti Process">
@@ -125,5 +123,65 @@
<endEvent id="end" /> <endEvent id="end" />
</process> </process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiReviewPooled">
<bpmndi:BPMNPlane bpmnElement="activitiReviewPooled"
id="BPMNPlane_activitiReviewPooled">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask"
id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="125"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision"
id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="290" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved"
id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="390"
y="97"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected"
id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="390"
y="297"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="555" y="307"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="310" y="197"></omgdi:waypoint>
<omgdi:waypoint x="310" y="124"></omgdi:waypoint>
<omgdi:waypoint x="390" y="124"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="310" y="237"></omgdi:waypoint>
<omgdi:waypoint x="310" y="324"></omgdi:waypoint>
<omgdi:waypoint x="390" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="495" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="307"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="495" y="324"></omgdi:waypoint>
<omgdi:waypoint x="555" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions> </definitions>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions" <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
typeLanguage="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
expressionLanguage="http://www.w3.org/1999/XPath" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
targetNamespace="http://activiti.org/bpmn20" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://alfresco.org">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="activitiReview" name="Review And Approve Activiti Process"> <process id="activitiReview" name="Review And Approve Activiti Process">
@@ -110,5 +108,65 @@
<endEvent id="end" /> <endEvent id="end" />
</process> </process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiReview">
<bpmndi:BPMNPlane bpmnElement="activitiReview"
id="BPMNPlane_activitiReview">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask"
id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="125"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision"
id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="290" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved"
id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="390"
y="97"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected"
id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="390"
y="297"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="555" y="307"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="310" y="197"></omgdi:waypoint>
<omgdi:waypoint x="310" y="124"></omgdi:waypoint>
<omgdi:waypoint x="390" y="124"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="310" y="237"></omgdi:waypoint>
<omgdi:waypoint x="310" y="324"></omgdi:waypoint>
<omgdi:waypoint x="390" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="495" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="307"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="495" y="324"></omgdi:waypoint>
<omgdi:waypoint x="555" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions> </definitions>

View File

@@ -101,6 +101,7 @@ public class AbstractActivitiComponentTest
protected static final String TEST_ADHOC_KEY = "testAdhoc"; protected static final String TEST_ADHOC_KEY = "testAdhoc";
protected static final String TEST_JOB_KEY = "testAdhoc"; protected static final String TEST_JOB_KEY = "testAdhoc";
protected static final String TEST_JOB_DEF = "activiti/testJob.bpmn20.xml"; protected static final String TEST_JOB_DEF = "activiti/testJob.bpmn20.xml";
protected static final String TEST_DIAGRAM_DEF = "activiti/testDiagram.bpmn20.xml";
protected static final String XML = MimetypeMap.MIMETYPE_XML; protected static final String XML = MimetypeMap.MIMETYPE_XML;
@@ -179,6 +180,11 @@ public class AbstractActivitiComponentTest
return deployDefinition(TEST_JOB_DEF); return deployDefinition(TEST_JOB_DEF);
} }
protected WorkflowDefinition deployTestDiagramDefinition()
{
return deployDefinition(TEST_DIAGRAM_DEF);
}
protected WorkflowDefinition deployDefinition(String resource) protected WorkflowDefinition deployDefinition(String resource)
{ {
InputStream input = getInputStream(resource); InputStream input = getInputStream(resource);

View File

@@ -45,5 +45,7 @@ public interface ActivitiConstants
public static final String SERVICE_REGISTRY_BEAN_KEY = "services"; public static final String SERVICE_REGISTRY_BEAN_KEY = "services";
public static final String PROCESS_INSTANCE_IMAGE_FORMAT = "png";
} }

View File

@@ -680,6 +680,25 @@ public class ActivitiWorkflowComponentTest extends AbstractActivitiComponentTest
assertEquals(0, timers.size()); assertEquals(0, timers.size());
} }
@Test
public void testGetWorkflowImage() {
WorkflowDefinition definitionWithoutImage = deployTestAdhocDefinition();
WorkflowDefinition definitionWithImage = deployTestDiagramDefinition();
// Start process-instance that shouldn't have an image
ProcessInstance processInstance = runtime.startProcessInstanceById(BPMEngineRegistry.getLocalId(definitionWithoutImage.getId()));
String worklfowId = BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, processInstance.getId());
assertNull(workflowEngine.getWorkflowImage(worklfowId));
// Start process-instance that SHOULD have an image
ProcessInstance processInstanceWithImage = runtime.startProcessInstanceById(BPMEngineRegistry.getLocalId(definitionWithImage.getId()));
String worklfowWithImageId = BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, processInstanceWithImage.getId());
assertNotNull(workflowEngine.getWorkflowImage(worklfowWithImageId));
}
private void putVariable(Map<String, Object> variables, QName varName, Object value) private void putVariable(Map<String, Object> variables, QName varName, Object value)
{ {
String variableName = mapQNameToName(varName); String variableName = mapQNameToName(varName);

View File

@@ -48,9 +48,12 @@ import org.activiti.engine.history.HistoricTaskInstanceQuery;
import org.activiti.engine.impl.RepositoryServiceImpl; import org.activiti.engine.impl.RepositoryServiceImpl;
import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
import org.activiti.engine.impl.bpmn.deployer.BpmnDeployer; import org.activiti.engine.impl.bpmn.deployer.BpmnDeployer;
import org.activiti.engine.impl.bpmn.diagram.ProcessDiagramGenerator;
import org.activiti.engine.impl.form.DefaultTaskFormHandler; import org.activiti.engine.impl.form.DefaultTaskFormHandler;
import org.activiti.engine.impl.form.TaskFormHandler; import org.activiti.engine.impl.form.TaskFormHandler;
import org.activiti.engine.impl.identity.Authentication; import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.impl.persistence.entity.TimerEntity; import org.activiti.engine.impl.persistence.entity.TimerEntity;
import org.activiti.engine.impl.pvm.PvmActivity; import org.activiti.engine.impl.pvm.PvmActivity;
import org.activiti.engine.impl.pvm.PvmTransition; import org.activiti.engine.impl.pvm.PvmTransition;
@@ -986,8 +989,7 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
ProcessDefinition procDef = repoService.createProcessDefinitionQuery() ProcessDefinition procDef = repoService.createProcessDefinitionQuery()
.processDefinitionId(procDefId) .processDefinitionId(procDefId)
.singleResult(); .singleResult();
if(procDef == null) if(procDef == null) {
{
String msg = messageService.getMessage(ERR_UNDEPLOY_WORKFLOW_UNEXISTING, workflowDefinitionId); String msg = messageService.getMessage(ERR_UNDEPLOY_WORKFLOW_UNEXISTING, workflowDefinitionId);
throw new WorkflowException(msg); throw new WorkflowException(msg);
} }
@@ -1007,7 +1009,27 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
@Override @Override
public InputStream getWorkflowImage(String workflowInstanceId) public InputStream getWorkflowImage(String workflowInstanceId)
{ {
// TODO: Link this up with the underlying Activiti instance diagram API String processInstanceId = createLocalId(workflowInstanceId);
ExecutionEntity pi = (ExecutionEntity) runtimeService.createProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
// If the process is finished, there is no diagram available
if (pi != null)
{
// Fetch the process-definition. Not using query API, since the
// returned
// processdefinition isn't initialized with all activities
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repoService)
.getDeployedProcessDefinition(pi.getProcessDefinitionId());
if (processDefinition != null && processDefinition.isGraphicalNotationDefined())
{
return ProcessDiagramGenerator
.generateDiagram(processDefinition,
ActivitiConstants.PROCESS_INSTANCE_IMAGE_FORMAT,
runtimeService.getActiveActivityIds(processInstanceId));
}
}
return null; return null;
} }

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="testDiagram" name="Test Process Diagram">
<startEvent id="start" activiti:formKey="bpm_foo" />
<sequenceFlow id='flow2' sourceRef='start'
targetRef='firstTask' />
<userTask id="firstTask" name="First task"
activiti:formKey="bpm_foo_task">
</userTask>
<sequenceFlow id='flow4' sourceRef='firstTask'
targetRef='end' />
<endEvent id="end" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testDiagram">
<bpmndi:BPMNPlane bpmnElement="testDiagram" id="BPMNPlane_testDiagram">
<bpmndi:BPMNShape bpmnElement="start"
id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="firstTask" id="BPMNShape_firstTask">
<omgdc:Bounds height="55" width="105" x="125" y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="290" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>