AnsweredAssumed Answered

Migrate running processes to Activiti

Question asked by dbmalkovsky on Nov 17, 2014
Latest reply on Nov 20, 2014 by rhafner
We are currently tasked with migrating running workflow instances from our proprietary workflow engine to the Activiti engine. We are looking for additional insight and/or advice regarding this type of migration.

We only see two options to migrate running instances:
  1. DB Migration – Create the state of a running process in the Activiti tables via JDBC/SQL.
  2. Template Modification – Add events when converting our proprietary template to an Activiti/BPMN template which allows a process to be started at a particular task. This approach modifies the engine behavior slightly and is described in more detail here: https://github.com/camunda/camunda-consulting/tree/master/snippets/migrate-third-party-to-camunda

Does anyone have experience with either of these approaches? Would you recommend one approach over the other?

We've started off down the path of option 1 but we are running into the following issues:
  1. Determining when to create an execution.
  2. Determining how to set the ACT_ID_ column appropriately.
Based on a few simple examples (listed below):
  1. <b>One Task</b>  This results in: 1 Execution with ACT_ID_ set to the started UserTask’s id.
  2. <b>Two Parallel Tasks </b>
    • <b>Both tasks Started</b> This results in: 3 Executions. Root execution with ACT_ID_ set to the startEvent’s id. The Task executions with the ACT_ID_ set to the UserTask’s id.
    • <b>One task Started and one task Finished</b> This results in: 1 Execution with ACT_ID_ set to the started UserTask’s id.
  3. <b>One Task In Subprocess</b>
    • <b>Two Parallel Tasks In Subprocess with both Started</b> This results in:  4 Executions. Root execution with ACT_ID_ set to NULL. Subprocess Execution with ACT_ID_ set to the startEvent’s id. The Task executions with the ACT_ID_ set to the UserTask’s id.
    • <b>Two Parallel Tasks In Subprocess with one Started and one Finished</b>  This results in   2 Executions. Root execution with ACT_ID_ set to NULL. Subprocess Execution with ACT_ID_ set to the started UserTask’s id.
So are questions for this approach are:
  1. Are there some general rules that can be used to know when an execution should be created during migration?
  2. Is there a general way to determine what the ACT_ID_ value should be for a particular execution based on the state of the process and/or the template? For the simple examples, it seems if there is only a single started task associated with a execution then the ACT_ID_ value should be set to the UserTask’s id. When there are multiple started tasks associated with an execution then the ACT_ID_ is associated to the startEvent’s id (maybe this changes if the process is more complex) and when there are no tasks associated with an execution (such as the root execution in example 3) then the ACT_ID_ is null. Is this correct? Will this behavior continue for more complex processes such as (nested subflows, gateways before a task, etc).
Thank you for any and all insight you can share with regards to our migration task.

Outcomes