-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10, 2021.0
-
Fix Version/s: 10.10-HF62, 2021.21
-
Component/s: Workflow
-
Release Notes Summary:A workflow can now be canceled after one of its subworkflow has been canceled
-
Tags:
-
Backlog priority:750
-
Sprint:nxplatform #60, nxplatform #61
-
Story Points:5
When a workflow uses a sub-workflow:
- If the parent workflow is canceled, the sub-workflow is also canceled
- They both disappear from the UI
- If the sub-workflow is canceled, the parent workflow is not canceled
- The parent workflow remains stuck on the UI
- GET /api/v1/workflow/<parent-workflowInstanceId> returns "state": "running"
In GraphNode.java, the State enum has a method public static State fromString(String s) in which the value "canceled" is passed. However, this value doesn't exist in the collections of constants for State, so a java.lang.IllegalArgumentException is thrown (cf Outcome). The value "canceled" seems to come from the ElementLifeCycleState enum in DocumentRouteElement.java.
Repro steps
To help with the repro, just drop the attached jar into nxserver/plugins and restart Nuxeo. This jar corresponds to the tag "issue-with-parent-workflow", branch feature/workflow, in my cchampain's Sandbox.
- Click on "Start process" for a domain
- Start the workflow "parent workflow"
- Go to Tasks
- Click on "Validate", this will start the sub-workflow
- Click on "Abandon" for the sub-workflow
- Click on "Abandon" for the parent workflow
Outcome
It seems impossible to cancel the parent workflow on the UI, even after a page refresh. An error is thrown in the chrome dev console when clicking on "Abandon":
{"entity-type":"exception","status":400,"message":"java.lang.IllegalArgumentException: canceled"}
Expected outcome
The parent workflow should be canceled and removed from the UI