This is an automated email from the ASF dual-hosted git repository.
djoseph pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git
The following commit(s) were added to refs/heads/main by this push:
new 7b9520c235 [incubator-kie-issues#2241] Usertasks stays in created
stated when only potential groups are specified (#4189)
7b9520c235 is described below
commit 7b9520c235768634d1245ba2987236bf1e9bf75b
Author: Deepak Joseph <[email protected]>
AuthorDate: Tue Feb 10 19:22:49 2026 +0530
[incubator-kie-issues#2241] Usertasks stays in created stated when only
potential groups are specified (#4189)
* ws-humantask potential groups activation fix
* update
---
.../impl/lifecycle/WsHumanTaskLifeCycle.java | 2 +-
.../main/resources/manager_multiple_groups.bpmn | 145 +++++++++++++++++++++
.../src/main/resources/manager_single_group.bpmn | 145 +++++++++++++++++++++
.../usertask/jpa/it/WsHumanTaskLifeCycleIT.java | 117 +++++++++++++++++
.../main/resources/manager_multiple_groups.bpmn | 145 +++++++++++++++++++++
.../src/main/resources/manager_single_group.bpmn | 145 +++++++++++++++++++++
.../usertask/jpa/it/WsHumanTaskLifeCycleIT.java | 117 +++++++++++++++++
7 files changed, 815 insertions(+), 1 deletion(-)
diff --git
a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/WsHumanTaskLifeCycle.java
b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/WsHumanTaskLifeCycle.java
index 795ba2e39a..8159446834 100644
---
a/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/WsHumanTaskLifeCycle.java
+++
b/jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/lifecycle/WsHumanTaskLifeCycle.java
@@ -218,7 +218,7 @@ public class WsHumanTaskLifeCycle implements
UserTaskLifeCycle {
@Override
public UserTaskTransitionToken newTransitionToken(String transitionId,
UserTaskInstance userTaskInstance, Map<String, Object> data) {
- if (transitionId.equals(ACTIVATE) &&
userTaskInstance.getPotentialUsers().isEmpty()) {
+ if (transitionId.equals(ACTIVATE) &&
userTaskInstance.getPotentialUsers().isEmpty() &&
userTaskInstance.getPotentialGroups().isEmpty()) {
return null;
}
return newTransitionToken(transitionId, userTaskInstance.getStatus(),
(String) userTaskInstance.getMetadata().get(PREVIOUS_STATUS), data);
diff --git
a/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_multiple_groups.bpmn
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_multiple_groups.bpmn
new file mode 100644
index 0000000000..6fe7d1ee23
--- /dev/null
+++
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_multiple_groups.bpmn
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<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:bpsim="http://www.bpsim.org/schemas/1.0"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:drools="http://www.jboss.org/drools" id="_jetQUOewED6GJfjaBKPBcA"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
http://www. [...]
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_PriorityInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_CommentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_DescriptionInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_CreatedByInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_ContentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotStartedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotCompletedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotStartedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotCompletedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:collaboration id="_9A771063-4AD6-4190-BFC9-A2C53D50E316"
name="Default Collaboration">
+ <bpmn2:participant id="_E6F3770A-7DCC-4464-B5DB-A569B4EC38E5" name="Pool
Participant" processRef="manager_multiple_groups"/>
+ </bpmn2:collaboration>
+ <bpmn2:process id="manager_multiple_groups" drools:packageName="com.example"
drools:version="1.0" drools:adHoc="false" name="manager_multiple_groups"
isExecutable="true" processType="Public">
+ <bpmn2:sequenceFlow id="_F4007996-C153-44A8-8F61-9F8A03D17DC1"
sourceRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
targetRef="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"/>
+ <bpmn2:sequenceFlow id="_17155F10-F4B1-483D-916C-D54BA58D051D"
sourceRef="_AE3B22B8-1A1B-4781-997C-F51B0E110898"
targetRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"/>
+ <bpmn2:endEvent id="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5">
+ <bpmn2:incoming>_F4007996-C153-44A8-8F61-9F8A03D17DC1</bpmn2:incoming>
+ </bpmn2:endEvent>
+ <bpmn2:userTask id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5" name="Manager
Approval">
+ <bpmn2:extensionElements>
+ <drools:metaData name="elementname">
+ <drools:metaValue><![CDATA[Manager Approval]]></drools:metaValue>
+ </drools:metaData>
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>_17155F10-F4B1-483D-916C-D54BA58D051D</bpmn2:incoming>
+ <bpmn2:outgoing>_F4007996-C153-44A8-8F61-9F8A03D17DC1</bpmn2:outgoing>
+ <bpmn2:ioSpecification>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX" drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputXItem"
name="TaskName"/>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX"
drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputXItem"
name="Skippable"/>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX" drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputXItem"
name="GroupId"/>
+ <bpmn2:inputSet>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX</bpmn2:dataInputRefs>
+ </bpmn2:inputSet>
+ </bpmn2:ioSpecification>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[hr,it]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ </bpmn2:userTask>
+ <bpmn2:startEvent id="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <bpmn2:outgoing>_17155F10-F4B1-483D-916C-D54BA58D051D</bpmn2:outgoing>
+ </bpmn2:startEvent>
+ </bpmn2:process>
+ <bpmndi:BPMNDiagram>
+ <bpmndi:BPMNPlane bpmnElement="manager_multiple_groups">
+ <bpmndi:BPMNShape id="shape__AE3B22B8-1A1B-4781-997C-F51B0E110898"
bpmnElement="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <dc:Bounds height="56" width="56" x="126" y="214"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
bpmnElement="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5">
+ <dc:Bounds height="102" width="154" x="262" y="191"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"
bpmnElement="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5">
+ <dc:Bounds height="56" width="56" x="496" y="214"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge
id="edge_shape__AE3B22B8-1A1B-4781-997C-F51B0E110898_to_shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
bpmnElement="_17155F10-F4B1-483D-916C-D54BA58D051D">
+ <di:waypoint x="154" y="242"/>
+ <di:waypoint x="339" y="242"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge
id="edge_shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_to_shape__9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"
bpmnElement="_F4007996-C153-44A8-8F61-9F8A03D17DC1">
+ <di:waypoint x="339" y="242"/>
+ <di:waypoint x="524" y="242"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+ <bpmn2:relationship type="BPSimData">
+ <bpmn2:extensionElements>
+ <bpsim:BPSimData>
+ <bpsim:Scenario id="default" name="Simulationscenario">
+ <bpsim:ScenarioParameters/>
+ <bpsim:ElementParameters
elementRef="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ </bpsim:ElementParameters>
+ <bpsim:ElementParameters
elementRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ <bpsim:ResourceParameters>
+ <bpsim:Availability>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Availability>
+ <bpsim:Quantity>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Quantity>
+ </bpsim:ResourceParameters>
+ <bpsim:CostParameters>
+ <bpsim:UnitCost>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:UnitCost>
+ </bpsim:CostParameters>
+ </bpsim:ElementParameters>
+ </bpsim:Scenario>
+ </bpsim:BPSimData>
+ </bpmn2:extensionElements>
+ <bpmn2:source>_jetQUOewED6GJfjaBKPBcA</bpmn2:source>
+ <bpmn2:target>_jetQUOewED6GJfjaBKPBcA</bpmn2:target>
+ </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git
a/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_single_group.bpmn
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_single_group.bpmn
new file mode 100644
index 0000000000..c5b9f20651
--- /dev/null
+++
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/main/resources/manager_single_group.bpmn
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<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:bpsim="http://www.bpsim.org/schemas/1.0"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:drools="http://www.jboss.org/drools" id="_jdDHoOepED6zQ9TF790BnA"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
http://www. [...]
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_PriorityInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_CommentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_DescriptionInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_CreatedByInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_ContentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotStartedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotCompletedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotStartedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotCompletedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:collaboration id="_4DA19F23-8075-4BA8-80C7-02C314B83C9F"
name="Default Collaboration">
+ <bpmn2:participant id="_5B648F4F-2AF7-4161-A30D-223D4F373347" name="Pool
Participant" processRef="manager_single_group"/>
+ </bpmn2:collaboration>
+ <bpmn2:process id="manager_single_group" drools:packageName="com.example"
drools:version="1.0" drools:adHoc="false" name="manager_single_group"
isExecutable="true" processType="Public">
+ <bpmn2:sequenceFlow id="_186181AA-EC9B-4182-9634-696A19ED2463"
sourceRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
targetRef="_47D60E08-079F-4B50-BAC4-10CB64E24729"/>
+ <bpmn2:sequenceFlow id="_1B44D237-AC79-4722-921A-F0342538B03B"
sourceRef="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6"
targetRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80"/>
+ <bpmn2:endEvent id="_47D60E08-079F-4B50-BAC4-10CB64E24729">
+ <bpmn2:incoming>_186181AA-EC9B-4182-9634-696A19ED2463</bpmn2:incoming>
+ </bpmn2:endEvent>
+ <bpmn2:userTask id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80" name="Manager
Approval">
+ <bpmn2:extensionElements>
+ <drools:metaData name="elementname">
+ <drools:metaValue><![CDATA[Manager Approval]]></drools:metaValue>
+ </drools:metaData>
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>_1B44D237-AC79-4722-921A-F0342538B03B</bpmn2:incoming>
+ <bpmn2:outgoing>_186181AA-EC9B-4182-9634-696A19ED2463</bpmn2:outgoing>
+ <bpmn2:ioSpecification>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX" drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputXItem"
name="TaskName"/>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX"
drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputXItem"
name="Skippable"/>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX" drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputXItem"
name="GroupId"/>
+ <bpmn2:inputSet>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX</bpmn2:dataInputRefs>
+ </bpmn2:inputSet>
+ </bpmn2:ioSpecification>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[hr]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ </bpmn2:userTask>
+ <bpmn2:startEvent id="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <bpmn2:outgoing>_1B44D237-AC79-4722-921A-F0342538B03B</bpmn2:outgoing>
+ </bpmn2:startEvent>
+ </bpmn2:process>
+ <bpmndi:BPMNDiagram>
+ <bpmndi:BPMNPlane bpmnElement="manager_single_group">
+ <bpmndi:BPMNShape id="shape__FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6"
bpmnElement="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <dc:Bounds height="56" width="56" x="95" y="194"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
bpmnElement="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80">
+ <dc:Bounds height="102" width="154" x="231" y="171"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__47D60E08-079F-4B50-BAC4-10CB64E24729"
bpmnElement="_47D60E08-079F-4B50-BAC4-10CB64E24729">
+ <dc:Bounds height="56" width="56" x="465" y="194"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge
id="edge_shape__FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6_to_shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
bpmnElement="_1B44D237-AC79-4722-921A-F0342538B03B">
+ <di:waypoint x="123" y="222"/>
+ <di:waypoint x="308" y="222"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge
id="edge_shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_to_shape__47D60E08-079F-4B50-BAC4-10CB64E24729"
bpmnElement="_186181AA-EC9B-4182-9634-696A19ED2463">
+ <di:waypoint x="308" y="222"/>
+ <di:waypoint x="493" y="222"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+ <bpmn2:relationship type="BPSimData">
+ <bpmn2:extensionElements>
+ <bpsim:BPSimData>
+ <bpsim:Scenario id="default" name="Simulationscenario">
+ <bpsim:ScenarioParameters/>
+ <bpsim:ElementParameters
elementRef="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ </bpsim:ElementParameters>
+ <bpsim:ElementParameters
elementRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ <bpsim:ResourceParameters>
+ <bpsim:Availability>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Availability>
+ <bpsim:Quantity>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Quantity>
+ </bpsim:ResourceParameters>
+ <bpsim:CostParameters>
+ <bpsim:UnitCost>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:UnitCost>
+ </bpsim:CostParameters>
+ </bpsim:ElementParameters>
+ </bpsim:Scenario>
+ </bpsim:BPSimData>
+ </bpmn2:extensionElements>
+ <bpmn2:source>_jdDHoOepED6zQ9TF790BnA</bpmn2:source>
+ <bpmn2:target>_jdDHoOepED6zQ9TF790BnA</bpmn2:target>
+ </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git
a/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
index d617ab702b..8b2a087221 100644
---
a/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
+++
b/quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
@@ -564,6 +564,64 @@ public class WsHumanTaskLifeCycleIT {
isProcessCompleted(processId, pid);
}
+ @Test
+ public void testSingleGroupUserTaskLifeCycle() {
+ var user = "carl";
+ var group = "hr";
+ var potentialGroups = new String[] { group };
+ var processId = "manager_single_group";
+ var pid = startProcessInstance(processId);
+ var taskId = getTaskId(user, group, pid);
+
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_INSTANCE_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Ready"))
+ .body("potentialUsers", equalTo(List.of()))
+ .body("potentialGroups", hasItems(potentialGroups));
+
+ claim(taskId, user, group);
+ start(taskId, user, group);
+ complete(taskId, user, group);
+
+ isProcessCompleted(processId, pid);
+ }
+
+ @Test
+ public void testMultipleGroupUserTaskLifeCycle() {
+ var user = "dave";
+ var group = "it";
+ var potentialGroups = new String[] { "hr", "it" };
+ var processId = "manager_multiple_groups";
+ var pid = startProcessInstance(processId);
+ var taskId = getTaskId(user, group, pid);
+
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_INSTANCE_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Ready"))
+ .body("potentialUsers", equalTo(List.of()))
+ .body("potentialGroups", hasItems(potentialGroups));
+
+ claim(taskId, user, group);
+ start(taskId, user, group);
+ complete(taskId, user, group);
+
+ isProcessCompleted(processId, pid);
+ }
+
private void nominate(String taskId, String user, String status, String[]
nominatedUsers) {
given()
.contentType(ContentType.JSON)
@@ -747,6 +805,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo(null));
}
+ private void claim(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("claim"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Reserved"))
+ .body("status.terminate", equalTo(null));
+ }
+
public String startProcessInstance(String processId) {
return startProcessInstanceWithVariables(processId, Map.of());
}
@@ -796,6 +869,20 @@ public class WsHumanTaskLifeCycleIT {
.getString("find { it.processInfo.processInstanceId == pid
}.id");
}
+ private String getTaskId(String user, String group, String pid) {
+ return given().contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_ENDPOINT)
+ .then()
+ .statusCode(200)
+ .extract()
+ .jsonPath()
+ .param("pid", pid)
+ .getString("find { it.processInfo.processInstanceId == pid
}.id");
+ }
+
private void verifyTask(String processId, String pid, String taskId,
String user, String state, String[] potentialUsers) {
given().contentType(ContentType.JSON)
.when()
@@ -830,6 +917,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo("COMPLETED"));
}
+ private void complete(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("complete"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Completed"))
+ .body("status.terminate", equalTo("COMPLETED"));
+ }
+
private void start(String taskId, String user) {
given()
.contentType(ContentType.JSON)
@@ -844,6 +946,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo(null));
}
+ private void start(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("start"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("InProgress"))
+ .body("status.terminate", equalTo(null));
+ }
+
private void suspendWithDurationOrTimestamp(String taskId, String user,
String temporal) {
given()
.contentType(ContentType.JSON)
diff --git
a/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_multiple_groups.bpmn
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_multiple_groups.bpmn
new file mode 100644
index 0000000000..6fe7d1ee23
--- /dev/null
+++
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_multiple_groups.bpmn
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<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:bpsim="http://www.bpsim.org/schemas/1.0"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:drools="http://www.jboss.org/drools" id="_jetQUOewED6GJfjaBKPBcA"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
http://www. [...]
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_PriorityInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_CommentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_DescriptionInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_CreatedByInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_ContentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotStartedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotCompletedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotStartedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_NotCompletedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:collaboration id="_9A771063-4AD6-4190-BFC9-A2C53D50E316"
name="Default Collaboration">
+ <bpmn2:participant id="_E6F3770A-7DCC-4464-B5DB-A569B4EC38E5" name="Pool
Participant" processRef="manager_multiple_groups"/>
+ </bpmn2:collaboration>
+ <bpmn2:process id="manager_multiple_groups" drools:packageName="com.example"
drools:version="1.0" drools:adHoc="false" name="manager_multiple_groups"
isExecutable="true" processType="Public">
+ <bpmn2:sequenceFlow id="_F4007996-C153-44A8-8F61-9F8A03D17DC1"
sourceRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
targetRef="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"/>
+ <bpmn2:sequenceFlow id="_17155F10-F4B1-483D-916C-D54BA58D051D"
sourceRef="_AE3B22B8-1A1B-4781-997C-F51B0E110898"
targetRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"/>
+ <bpmn2:endEvent id="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5">
+ <bpmn2:incoming>_F4007996-C153-44A8-8F61-9F8A03D17DC1</bpmn2:incoming>
+ </bpmn2:endEvent>
+ <bpmn2:userTask id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5" name="Manager
Approval">
+ <bpmn2:extensionElements>
+ <drools:metaData name="elementname">
+ <drools:metaValue><![CDATA[Manager Approval]]></drools:metaValue>
+ </drools:metaData>
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>_17155F10-F4B1-483D-916C-D54BA58D051D</bpmn2:incoming>
+ <bpmn2:outgoing>_F4007996-C153-44A8-8F61-9F8A03D17DC1</bpmn2:outgoing>
+ <bpmn2:ioSpecification>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX" drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputXItem"
name="TaskName"/>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX"
drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputXItem"
name="Skippable"/>
+ <bpmn2:dataInput
id="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX" drools:dtype="Object"
itemSubjectRef="__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputXItem"
name="GroupId"/>
+ <bpmn2:inputSet>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX</bpmn2:dataInputRefs>
+ </bpmn2:inputSet>
+ </bpmn2:ioSpecification>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_TaskNameInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_SkippableInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[hr,it]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_GroupIdInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ </bpmn2:userTask>
+ <bpmn2:startEvent id="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <bpmn2:outgoing>_17155F10-F4B1-483D-916C-D54BA58D051D</bpmn2:outgoing>
+ </bpmn2:startEvent>
+ </bpmn2:process>
+ <bpmndi:BPMNDiagram>
+ <bpmndi:BPMNPlane bpmnElement="manager_multiple_groups">
+ <bpmndi:BPMNShape id="shape__AE3B22B8-1A1B-4781-997C-F51B0E110898"
bpmnElement="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <dc:Bounds height="56" width="56" x="126" y="214"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
bpmnElement="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5">
+ <dc:Bounds height="102" width="154" x="262" y="191"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"
bpmnElement="_9EC015CA-BD40-46A2-9D52-A2545A9C6DF5">
+ <dc:Bounds height="56" width="56" x="496" y="214"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge
id="edge_shape__AE3B22B8-1A1B-4781-997C-F51B0E110898_to_shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5"
bpmnElement="_17155F10-F4B1-483D-916C-D54BA58D051D">
+ <di:waypoint x="154" y="242"/>
+ <di:waypoint x="339" y="242"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge
id="edge_shape__F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5_to_shape__9EC015CA-BD40-46A2-9D52-A2545A9C6DF5"
bpmnElement="_F4007996-C153-44A8-8F61-9F8A03D17DC1">
+ <di:waypoint x="339" y="242"/>
+ <di:waypoint x="524" y="242"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+ <bpmn2:relationship type="BPSimData">
+ <bpmn2:extensionElements>
+ <bpsim:BPSimData>
+ <bpsim:Scenario id="default" name="Simulationscenario">
+ <bpsim:ScenarioParameters/>
+ <bpsim:ElementParameters
elementRef="_AE3B22B8-1A1B-4781-997C-F51B0E110898">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ </bpsim:ElementParameters>
+ <bpsim:ElementParameters
elementRef="_F1AA6140-7BF6-481F-A0E1-BE5ABE8535D5">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ <bpsim:ResourceParameters>
+ <bpsim:Availability>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Availability>
+ <bpsim:Quantity>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Quantity>
+ </bpsim:ResourceParameters>
+ <bpsim:CostParameters>
+ <bpsim:UnitCost>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:UnitCost>
+ </bpsim:CostParameters>
+ </bpsim:ElementParameters>
+ </bpsim:Scenario>
+ </bpsim:BPSimData>
+ </bpmn2:extensionElements>
+ <bpmn2:source>_jetQUOewED6GJfjaBKPBcA</bpmn2:source>
+ <bpmn2:target>_jetQUOewED6GJfjaBKPBcA</bpmn2:target>
+ </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git
a/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_single_group.bpmn
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_single_group.bpmn
new file mode 100644
index 0000000000..c5b9f20651
--- /dev/null
+++
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/main/resources/manager_single_group.bpmn
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<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:bpsim="http://www.bpsim.org/schemas/1.0"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:drools="http://www.jboss.org/drools" id="_jdDHoOepED6zQ9TF790BnA"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd
http://www. [...]
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_PriorityInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_CommentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_DescriptionInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_CreatedByInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_ContentInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotStartedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotCompletedReassignInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotStartedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:itemDefinition
id="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_NotCompletedNotifyInputXItem"
structureRef="Object"/>
+ <bpmn2:collaboration id="_4DA19F23-8075-4BA8-80C7-02C314B83C9F"
name="Default Collaboration">
+ <bpmn2:participant id="_5B648F4F-2AF7-4161-A30D-223D4F373347" name="Pool
Participant" processRef="manager_single_group"/>
+ </bpmn2:collaboration>
+ <bpmn2:process id="manager_single_group" drools:packageName="com.example"
drools:version="1.0" drools:adHoc="false" name="manager_single_group"
isExecutable="true" processType="Public">
+ <bpmn2:sequenceFlow id="_186181AA-EC9B-4182-9634-696A19ED2463"
sourceRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
targetRef="_47D60E08-079F-4B50-BAC4-10CB64E24729"/>
+ <bpmn2:sequenceFlow id="_1B44D237-AC79-4722-921A-F0342538B03B"
sourceRef="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6"
targetRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80"/>
+ <bpmn2:endEvent id="_47D60E08-079F-4B50-BAC4-10CB64E24729">
+ <bpmn2:incoming>_186181AA-EC9B-4182-9634-696A19ED2463</bpmn2:incoming>
+ </bpmn2:endEvent>
+ <bpmn2:userTask id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80" name="Manager
Approval">
+ <bpmn2:extensionElements>
+ <drools:metaData name="elementname">
+ <drools:metaValue><![CDATA[Manager Approval]]></drools:metaValue>
+ </drools:metaData>
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>_1B44D237-AC79-4722-921A-F0342538B03B</bpmn2:incoming>
+ <bpmn2:outgoing>_186181AA-EC9B-4182-9634-696A19ED2463</bpmn2:outgoing>
+ <bpmn2:ioSpecification>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX" drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputXItem"
name="TaskName"/>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX"
drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputXItem"
name="Skippable"/>
+ <bpmn2:dataInput
id="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX" drools:dtype="Object"
itemSubjectRef="__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputXItem"
name="GroupId"/>
+ <bpmn2:inputSet>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX</bpmn2:dataInputRefs>
+
<bpmn2:dataInputRefs>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX</bpmn2:dataInputRefs>
+ </bpmn2:inputSet>
+ </bpmn2:ioSpecification>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_TaskNameInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_SkippableInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ <bpmn2:dataInputAssociation>
+
<bpmn2:targetRef>_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX</bpmn2:targetRef>
+ <bpmn2:assignment>
+ <bpmn2:from
xsi:type="bpmn2:tFormalExpression"><![CDATA[hr]]></bpmn2:from>
+ <bpmn2:to
xsi:type="bpmn2:tFormalExpression"><![CDATA[_46FE320A-C92F-4BC6-A5C6-FF8E42303A80_GroupIdInputX]]></bpmn2:to>
+ </bpmn2:assignment>
+ </bpmn2:dataInputAssociation>
+ </bpmn2:userTask>
+ <bpmn2:startEvent id="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <bpmn2:outgoing>_1B44D237-AC79-4722-921A-F0342538B03B</bpmn2:outgoing>
+ </bpmn2:startEvent>
+ </bpmn2:process>
+ <bpmndi:BPMNDiagram>
+ <bpmndi:BPMNPlane bpmnElement="manager_single_group">
+ <bpmndi:BPMNShape id="shape__FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6"
bpmnElement="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <dc:Bounds height="56" width="56" x="95" y="194"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
bpmnElement="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80">
+ <dc:Bounds height="102" width="154" x="231" y="171"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="shape__47D60E08-079F-4B50-BAC4-10CB64E24729"
bpmnElement="_47D60E08-079F-4B50-BAC4-10CB64E24729">
+ <dc:Bounds height="56" width="56" x="465" y="194"/>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge
id="edge_shape__FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6_to_shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80"
bpmnElement="_1B44D237-AC79-4722-921A-F0342538B03B">
+ <di:waypoint x="123" y="222"/>
+ <di:waypoint x="308" y="222"/>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge
id="edge_shape__46FE320A-C92F-4BC6-A5C6-FF8E42303A80_to_shape__47D60E08-079F-4B50-BAC4-10CB64E24729"
bpmnElement="_186181AA-EC9B-4182-9634-696A19ED2463">
+ <di:waypoint x="308" y="222"/>
+ <di:waypoint x="493" y="222"/>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+ <bpmn2:relationship type="BPSimData">
+ <bpmn2:extensionElements>
+ <bpsim:BPSimData>
+ <bpsim:Scenario id="default" name="Simulationscenario">
+ <bpsim:ScenarioParameters/>
+ <bpsim:ElementParameters
elementRef="_FC81F57A-842B-4E9D-A9D8-F1FA1EC969F6">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ </bpsim:ElementParameters>
+ <bpsim:ElementParameters
elementRef="_46FE320A-C92F-4BC6-A5C6-FF8E42303A80">
+ <bpsim:TimeParameters>
+ <bpsim:ProcessingTime>
+ <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+ </bpsim:ProcessingTime>
+ </bpsim:TimeParameters>
+ <bpsim:ResourceParameters>
+ <bpsim:Availability>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Availability>
+ <bpsim:Quantity>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:Quantity>
+ </bpsim:ResourceParameters>
+ <bpsim:CostParameters>
+ <bpsim:UnitCost>
+ <bpsim:FloatingParameter value="0"/>
+ </bpsim:UnitCost>
+ </bpsim:CostParameters>
+ </bpsim:ElementParameters>
+ </bpsim:Scenario>
+ </bpsim:BPSimData>
+ </bpmn2:extensionElements>
+ <bpmn2:source>_jdDHoOepED6zQ9TF790BnA</bpmn2:source>
+ <bpmn2:target>_jdDHoOepED6zQ9TF790BnA</bpmn2:target>
+ </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git
a/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
index 4bc12607bd..53187afdfc 100644
---
a/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
+++
b/springboot/integration-tests/integration-tests-springboot-wshumantasks-it/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java
@@ -573,6 +573,64 @@ public class WsHumanTaskLifeCycleIT {
isProcessCompleted(processId, pid);
}
+ @Test
+ public void testSingleGroupUserTaskLifeCycle() {
+ var user = "carl";
+ var group = "hr";
+ var potentialGroups = new String[] { group };
+ var processId = "manager_single_group";
+ var pid = startProcessInstance(processId);
+ var taskId = getTaskId(user, group, pid);
+
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_INSTANCE_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Ready"))
+ .body("potentialUsers", equalTo(List.of()))
+ .body("potentialGroups", hasItems(potentialGroups));
+
+ claim(taskId, user, group);
+ start(taskId, user, group);
+ complete(taskId, user, group);
+
+ isProcessCompleted(processId, pid);
+ }
+
+ @Test
+ public void testMultipleGroupUserTaskLifeCycle() {
+ var user = "dave";
+ var group = "it";
+ var potentialGroups = new String[] { "hr", "it" };
+ var processId = "manager_multiple_groups";
+ var pid = startProcessInstance(processId);
+ var taskId = getTaskId(user, group, pid);
+
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_INSTANCE_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Ready"))
+ .body("potentialUsers", equalTo(List.of()))
+ .body("potentialGroups", hasItems(potentialGroups));
+
+ claim(taskId, user, group);
+ start(taskId, user, group);
+ complete(taskId, user, group);
+
+ isProcessCompleted(processId, pid);
+ }
+
private void nominate(String taskId, String user, String status, String[]
nominatedUsers) {
given()
.contentType(ContentType.JSON)
@@ -756,6 +814,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo(null));
}
+ private void claim(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("claim"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Reserved"))
+ .body("status.terminate", equalTo(null));
+ }
+
public String startProcessInstance(String processId) {
return startProcessInstanceWithVariables(processId, Map.of());
}
@@ -805,6 +878,20 @@ public class WsHumanTaskLifeCycleIT {
.getString("find { it.processInfo.processInstanceId == pid
}.id");
}
+ private String getTaskId(String user, String group, String pid) {
+ return given().contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .get(USER_TASKS_ENDPOINT)
+ .then()
+ .statusCode(200)
+ .extract()
+ .jsonPath()
+ .param("pid", pid)
+ .getString("find { it.processInfo.processInstanceId == pid
}.id");
+ }
+
private void verifyTask(String processId, String pid, String taskId,
String user, String state, String[] potentialUsers) {
given().contentType(ContentType.JSON)
.when()
@@ -839,6 +926,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo("COMPLETED"));
}
+ private void complete(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("complete"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("Completed"))
+ .body("status.terminate", equalTo("COMPLETED"));
+ }
+
private void start(String taskId, String user) {
given()
.contentType(ContentType.JSON)
@@ -853,6 +955,21 @@ public class WsHumanTaskLifeCycleIT {
.body("status.terminate", equalTo(null));
}
+ private void start(String taskId, String user, String group) {
+ given()
+ .contentType(ContentType.JSON)
+ .when()
+ .queryParam("user", user)
+ .queryParam("group", group)
+ .body(new TransitionInfo("start"))
+ .post(USER_TASKS_INSTANCE_TRANSITION_ENDPOINT, taskId)
+ .then()
+ .statusCode(200)
+ .body("id", equalTo(taskId))
+ .body("status.name", equalTo("InProgress"))
+ .body("status.terminate", equalTo(null));
+ }
+
private void suspendWithDurationOrTimestamp(String taskId, String user,
String temporal) {
given()
.contentType(ContentType.JSON)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]