Process migration example with WorkflowProcessInstanceUpgrader in jBPM 5
Environment
- Red Hat JBoss BRMS (BRMS)
- 5.3.1
Issue
- How to migrate a process instance to a new process definition? I'm following http://docs.jboss.org/jbpm/v5.0/userguide/ch03.html#d0e1305 "section: 3.9.1. Process instance migration" but I gets NullPointerException
2014-11-03 09:28:10,956 ERROR [xxx.xxx.MyService] (Thread-11 (HornetQ-client-global-threads-563335366)) StackTrace: java.lang.NullPointerException
at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)
at org.jbpm.workflow.instance.WorkflowProcessInstanceUpgrader.upgradeProcessInstance(WorkflowProcessInstanceUpgrader.java:57)
at xxx.xxx.MyService.upgradeProcessInstances(MyService.java:392)
...
Resolution
Attached jbpmex91_process_migration.zip as an example.
For advanced cases, another article Is it possible to upgrade a jBPM5 process to the target process's sub-process node using WorkflowProcessInstanceUpgrader.upgradeProcessInstance(..) ? would be helpful.
You need to use a command to avoid the NullPointerException. See Why does ProcessInstance throw an NPE on invocation of its method in jBPM5 ?
Attachments
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
