Skip to content

Commit

Permalink
remove $workitemIDRef and replace this attribute with $UNIQUEIDSOURCE
Browse files Browse the repository at this point in the history
issue #302
  • Loading branch information
rsoika committed Sep 24, 2017
1 parent 53a005b commit fa70a9e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ public class WorkflowKernel {
public static final String ISO8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS";

public static final String UNIQUEID = "$uniqueid";
public static final String UNIQUEIDSOURCE = "$uniqueidsource";
public static final String UNIQUEIDVERSIONS = "$uniqueidversions";
public static final String MODELVERSION = "$modelversion";
public static final String PROCESSID = "$processid";
public static final String ACTIVITYID = "$activityid";
public static final String ACTIVITYIDLIST = "$activityidlist";
public static final String WORKFLOWGROUP = "$workflowgroup";
public static final String WORKFLOWSTATUS = "$workflowstatus";
public static final String WORKITEMIDREF = "$WorkItemIDRef";

public static final String TYPE = "type";

Expand Down Expand Up @@ -724,7 +724,7 @@ private ItemCollection createVersion(ItemCollection sourceItemCollection) throws
itemColNewVersion.replaceItemValue(UNIQUEID, WorkflowKernel.generateUniqueID());

// update $WorkItemIDRef to current worktiemID
itemColNewVersion.replaceItemValue(WORKITEMIDREF, id);
itemColNewVersion.replaceItemValue(UNIQUEIDSOURCE, id);

// remove $UniqueIDVersions
itemColNewVersion.removeItem(UNIQUEIDVERSIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ public void testSplitEventModel1() {

// Master $unqiueid must not match the version $uniqueid
Assert.assertFalse(itemCollection.getUniqueID().equals(version.getUniqueID()));


// $uniqueidSource must match $unqiueid of master
Assert.assertEquals(itemCollection.getUniqueID(),version.getItemValueString(WorkflowKernel.UNIQUEIDSOURCE));

// $unqiueidVirsions must mach $unqiueid of version
Assert.assertEquals(version.getUniqueID(),itemCollection.getItemValueString(WorkflowKernel.UNIQUEIDVERSIONS));


} catch (Exception e) {
Assert.fail();
Expand Down
6 changes: 3 additions & 3 deletions imixs-workflow-core/src/test/resources/bpmn/split_event1.bpmn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- origin at X=0.0 Y=0.0 -->
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ext="http://org.eclipse.bpmn2/ext" xmlns:imixs="http://www.imixs.org/bpmn2" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="Definitions_1" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.4.2.RC1-v20170913-1950-B1" targetNamespace="http://www.imixs.org/bpmn2">
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ext="http://org.eclipse.bpmn2/ext" xmlns:imixs="http://www.imixs.org/bpmn2" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="Definitions_1" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.4.2.RC1-v20170921-1506-B1" targetNamespace="http://www.imixs.org/bpmn2">
<bpmn2:extensionElements>
<imixs:item name="txtworkflowmodelversion" type="xs:string">
<imixs:value><![CDATA[1.0.0]]></imixs:value>
Expand Down Expand Up @@ -55,7 +55,7 @@
<bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
</bpmn2:parallelGateway>
<bpmn2:sequenceFlow id="SequenceFlow_2" sourceRef="IntermediateCatchEvent_3" targetRef="ParallelGateway_1"/>
<bpmn2:sequenceFlow id="SequenceFlow_3" name="Master (true)" sourceRef="ParallelGateway_1" targetRef="Task_4">
<bpmn2:sequenceFlow id="SequenceFlow_3" name="Source (true)" sourceRef="ParallelGateway_1" targetRef="Task_4">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_6">true</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1" imixs:activityid="20" name="update">
Expand Down Expand Up @@ -152,7 +152,7 @@
<di:waypoint xsi:type="dc:Point" x="480.0" y="76.0"/>
<di:waypoint xsi:type="dc:Point" x="550.0" y="76.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_6">
<dc:Bounds height="14.0" width="69.0" x="446.0" y="77.0"/>
<dc:Bounds height="14.0" width="71.0" x="445.0" y="77.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_IntermediateCatchEvent_1">
Expand Down
19 changes: 9 additions & 10 deletions src/site/markdown/core/workflowkernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,22 @@ See the section ['How to model'](../modelling/howto.html) for further details ab

### Split Events

In Imixs-Workflow a BPMN _Event_ followed by a _Parallel Gateway_ is called a _split-event_ and used to create new versions of the current process instance during the processing phase.
In Imixs-Workflow a BPMN _Event_ followed by a _Parallel Gateway_ is called a _split-event_ and used to create a new version of the current process instance during the processing phase.

<img src="../images/modelling/example_11.png"/>

The WorkflowKernel returns new versions of the current process instance by the method _getSplitWorkitems()_ and stores the IDs of these versions into the attribute '$uniqueidVersions'. A process instance and all its versions will have the same $workitemID. A version holds a reference to the source workitem in the attribute '$workitemidRef'.
The current process instance is called the _Source Workitem_. The _Source Workitem_ and all versions have the same _'$workitemID'_. In addition, the _'$UniqueID'_ of a new version is stored into the attribute _'$uniqueidVersions'_ of the current process instance. A version holds a reference to the _Source Workitem_ in the attribute '$workitemidRef'.

|Attribute | Source | Version | Description |
|-------------------|:------:|:-------:|----------------------------------------------------|
|$workitemID | x | x |A shared key across all versions and the source workitem. |
|$workitemIDRef | | x |A reference to the UnqiueID of the Source workitem |
|$unqiueIDVersions | x | |A list of UnqiueIDs to all created versions |
|Attribute | Source | Version | Description |
|-------------------|:------:|:-------:|--------------------------------------------------------------------|
|$workitemID | x | x |A unique shared key across all versions and the source workitem. |
|$unqiueIDSource | | x |A reference to the $UnqiueID of the Source workitem. |
|$unqiueIDVersions | x | |A list of $UnqiueIDs to all created versions of a source workitem. |


**Note:** The _WorklfowKernel_ expects that each outcome of a _Parallel Gateway_ creating a new version is followed by an Event element. If not, a _ModelException_ is thrown.

See the section ['How to model'](../modelling/howto.html) for details about modeling Split Events.
During the processing life-cyle, the _WorkflowKernel_ returns new versions of the current process instance by the method _getSplitWorkitems()_

**Note:** The _WorklfowKernel_ expects that each outcome of a _Parallel Gateway_ creating a new version is followed by an Event element. If not, a _ModelException_ is thrown. See the section ['How to model'](../modelling/howto.html) for details about modeling Split Events.



Expand Down
22 changes: 12 additions & 10 deletions src/site/markdown/quickstart/workitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,25 @@ The following table provides an overview about the data of a process instance ma
|$ModelVersion |String |yes | The Version of the model the workitem belongs to |
|$ProcessID |Integer |yes | The current ProcessID of the workItem |
|$ActivityID |Integer |yes | The next activity to be processed by the workflow engine |
|$workflowGroup |String |no |The name of the current process group |
|$workflowStatus |String |no |The name of the current workflow status |
|$workflowGroup |String |no | The name of the current process group |
|$workflowStatus |String |no | The name of the current workflow status |
|$Created |Date |no | Date of creation |
|$Modified |Date |no | Date of last modification |
|$IsAuthor |Boolean |no | Indicates if the current user has write access|
|$ReadAccess |List |no | String list of User/Roles with read access |
|$WriteAccess |List |no | String list of User/Roles with write access |
|$uniqueId |String |no | The unique ID of this workItem |
|$uniqueIdRef |String |yes | A reference to a connected workItem (child process) |
|$workitemid |String |no | The process instance id of this workitem |
|$lastEvent |Integer |no |The last processed event ID |
|$lastTask |Integer |no |The last assigned Task ID (processid) |
|$lastProcessingDate |Date|no |The timestamp of the last processing action |
|$creator |String |no |The user who created the workItem. |
|$editor |String |no |The user who invoked the processWorkitem() method. |
|$lasteditor |String |no |The last user, that invoked the process method before the $editor |
|namOwner |List |no |String list of User/Roles, that are owners of that WorkItem. |
|$workitemid |String |no | A unique process instance id of a workitem ad all its versions |
|$unqiueIDSource |String |no | The UnqiueID of the Source workitem for a version (See [Workflow Kernel split-events](../core/workflowkernel.html)) |
|$unqiueIDVersions|String |no | A list of UnqiueIDs to all created versions of this workitem (See [Workflow Kernel split-events](../core/workflowkernel.html))|
|$lastEvent |Integer |no | The last processed event ID |
|$lastTask |Integer |no | The last assigned Task ID (processid) |
|$lastProcessingDate |Date|no | The timestamp of the last processing action |
|$creator |String |no | The user who created the workItem. |
|$editor |String |no | The user who invoked the processWorkitem() method. |
|$lasteditor |String |no | The last user, that invoked the process method before the $editor |
|namOwner |List |no | String list of User/Roles, that are owners of that WorkItem. |
|txtworkflowsummary |String|no |A short description of the current status |
|txtworkflowabstract|String|no |A long description of the current status |
|txtworkflowimageurl|String|no |A link to an image which displays the current status |
Expand Down
Binary file modified src/site/resources/images/modelling/example_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fa70a9e

Please sign in to comment.