Is it possible to upgrade a jBPM5 process to the target process's sub-process node using WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..) ?
Issue
- Is it possible to upgrade a jBPM5 process to the target process's sub-process node using
WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..)
?
Suppose theParent Process
has a nodePPnode2
which needs to be upgraded to theTPsubprocess
(which is a sub-process) node ofTarget Process
in such a manner that it should in turn be migrated toSPnode1
node of theTPsubprocess
at the end. It has been pictorially shown below.
Source Process: START -> PPnode1 -> PPnode2 -> PPnode 3 -> END
Target Process: START -> TPnode1 -> TPnode2 -> TPsubprocess -> TPnode3 -> TPnode4 -> END
TPsubprocess : START -> SPnode1 -> SPnode2 -> END
That's not all, the migration should ensure that having completed the execution of the nodes in TPsubprocess
the flow should complete the rest of the remaining nodes from Target Process
as well. So the ultimate process execution flow should look something like this
START -> PPnode1 -> PPnode2 -> SPnode1 -> SPnode2 -> TPnode3 -> TPnode4 -> END
- As per the documentation [1] and also the source code for
WorkflowProcessInstanceUpgrader
[2] it appears thatWorkflowProcessInstanceUpgrader.upgradeProcessInstance(..)
is not sufficient to meet this requirement. Since the node mapping parameter in that methodMap<String, Long> nodeMapping
expects the key asSource
and value asTarget node ID
and it is not possible to provide reference to a node of a subprocess as per the aforementioned process flow. Even if acomposite nodeId
(i.e.nodeID
of the sub-process) as sayString
is passed and thatnodeId
can be changed using the following way as shown in [2] but ,setNodeId
method accepts onlylong
[3] . Hence, it doesn't look to be feasible withWorkflowProcessInstanceUpgrader.upgradeProcessInstance(..)
...
((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
...
...
public void setNodeId(final long nodeId) {
this.nodeId = nodeId;
}
...
Is there a possible solution to match the exact requirement provided above?
[1] https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_BRMS_Platform/5/html/BRMS_Business_Process_Management_Guide/Process_Instance_Migration.html
[2] https://github.com/droolsjbpm/jbpm/blob/5.2.0.Final/jbpm-flow/src/main/java/org/jbpm/workflow/instance/WorkflowProcessInstanceUpgrader.java
[3] https://github.com/droolsjbpm/jbpm/blob/5.2.0.Final/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceImpl.java
Environment
- Red Hat JBoss BRMS (BRMS)
- 5.3.x
- jBPM
- 5.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.