Skip to content

Commit

Permalink
Started convergence of work items.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 5, 2017
1 parent 607c9c1 commit efe1664
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
Expand Up @@ -101,6 +101,89 @@
</xsd:complexType>
<xsd:element name="case" type="tns:CaseType"/>

<xsd:complexType name="AbstractWorkItemType">
<xsd:annotation>
<xsd:documentation>
Common superclass for workflow (approval) work item, certification work item and case management work item.
</xsd:documentation>
<xsd:appinfo>
<a:container/>
<a:since>3.6</a:since>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="originalAssigneeRef" type="tns:ObjectReferenceType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Original assignee for this work item.
</xsd:documentation>
<!-- TODO allow also roles/orgs here. -->
<xsd:appinfo>
<a:objectReferenceTargetType>tns:UserType</a:objectReferenceTargetType>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="assigneeRef" type="tns:ObjectReferenceType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Users to which the work item is assigned. Other users do not see such a work item in their work lists.
Normally the work item is assigned to a single user. However, when delegating (directly or via escalation)
more assignees could be added.
</xsd:documentation>
<!-- TODO allow also roles/orgs here. -->
<xsd:appinfo>
<a:objectReferenceTargetType>tns:UserType</a:objectReferenceTargetType>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="candidateRef" type="tns:ObjectReferenceType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Users and abstract roles to which the work item MAY BE assigned.
</xsd:documentation>
<xsd:appinfo>
<a:objectReferenceTargetType>tns:FocusType</a:objectReferenceTargetType>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="executorRef" type="tns:ObjectReferenceType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
User who actually executed (completed) this work item.
</xsd:documentation>
<xsd:appinfo>
<a:objectReferenceTargetType>tns:UserType</a:objectReferenceTargetType>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>

<!-- stage number -->

<xsd:element name="outcome" type="xsd:anyURI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Work item outcome (if any).
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="comment" type="xsd:string" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The executor's comment.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="closedTimestamp" type="xsd:dateTime" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
When was this work item closed. (If null, it is considered open.)
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:long" use="optional"/>
</xsd:complexType>

<xsd:complexType name="CaseWorkItemType">
<xsd:annotation>
<xsd:documentation>
Expand Down
Expand Up @@ -2027,7 +2027,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="completedByRef" type="tns:ObjectReferenceType" minOccurs="0">
<xsd:element name="executorRef" type="tns:ObjectReferenceType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Who has completed this work item (null if unknown, not completed or completed automatically).
Expand Down
Expand Up @@ -456,7 +456,7 @@ public WorkItemType taskExtractToWorkItem(TaskExtract task, boolean resolveTask,
wi.setResult(pmi.extractWorkItemResult(variables));
String completedBy = ActivitiUtil.getVariable(variables, CommonProcessVariableNames.VARIABLE_WORK_ITEM_COMPLETED_BY, String.class, prismContext);
if (completedBy != null) {
wi.setCompletedByRef(ObjectTypeUtil.createObjectRef(completedBy, ObjectTypes.USER));
wi.setExecutorRef(ObjectTypeUtil.createObjectRef(completedBy, ObjectTypes.USER));
}

wi.setStageNumber(pmi.getStageNumber(variables));
Expand Down
Expand Up @@ -359,7 +359,7 @@ public void onTaskEvent(WorkItemType workItem, TaskEvent taskEvent, OperationRes
throw new SystemException("Couldn't determine current user: " + e.getMessage(), e);
}

ObjectReferenceType userRef = user != null ? user.toObjectReference() : workItem.getCompletedByRef(); // partial fallback
ObjectReferenceType userRef = user != null ? user.toObjectReference() : workItem.getExecutorRef(); // partial fallback

if (!genuinelyCompleted) {
TaskType task = wfTask.getTask().getTaskPrismObject().asObjectable();
Expand Down

0 comments on commit efe1664

Please sign in to comment.