Is it possible to upgrade a jBPM5 process to the target process's sub-process node using WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..) ?

Solution Unverified - Updated -

Issue

  • Is it possible to upgrade a jBPM5 process to the target process's sub-process node using WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..) ?
    Suppose the Parent Process has a node PPnode2 which needs to be upgraded to the TPsubprocess (which is a sub-process) node of Target Process in such a manner that it should in turn be migrated to SPnode1 node of the TPsubprocess 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 that WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..) is not sufficient to meet this requirement. Since the node mapping parameter in that method Map<String, Long> nodeMapping expects the key as Source and value as Target node ID and it is not possible to provide reference to a node of a subprocess as per the aforementioned process flow. Even if a composite nodeId (i.e. nodeID of the sub-process) as say String is passed and that nodeId can be changed using the following way as shown in [2] but , setNodeId method accepts only long [3] . Hence, it doesn't look to be feasible with WorkflowProcessInstanceUpgrader.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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content