Affects Version/s: 10.10, 2021.0
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.
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
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":
The parent workflow should be canceled and removed from the UI