cancel
Showing results for 
Search instead for 
Did you mean: 

How to duplicate all information of process instance

kiddinho
Champ in-the-making
Champ in-the-making
Hi everyone!
I want to duplicate all information of the process instance. Is there any api to do it or I need to handle my self by query & insert DB?
Thank for your help Smiley Happy
10 REPLIES 10

kiddinho
Champ in-the-making
Champ in-the-making
help me please Smiley Sad !

trademak
Star Contributor
Star Contributor
What do you mean with duplicate all information? Activiti by default stores process instance information in a runtime and a history table already.

Best regards,

kiddinho
Champ in-the-making
Champ in-the-making
Hi trademak!
In my app, I have a batch Object related to 1 process instance. This Object has many child object. When split some child objects from parent, I  need each object related to 1 new process instance same as original instance.
Sorry for my English.
Thanks!

xiaohelong
Champ in-the-making
Champ in-the-making
I happened to this too, Like MES I need to Split Order in process runtime.
In detail: there is 10 set machine need to product, when the flow goes to product, some exceptions occured, so we need to split one order to several part,such as 2,3,5 set in each order,so it will generate 3 orders ,also the history is same,but the part follows is not the same.
so the  first idea  in my mind is to clone the running process to 3 , and modify some info,and save to db, treat them like 3 process.
If you solve the problem or some idea to this ,welcome to communicate. email:xiaohelong2005@126.com

jbarrez
Star Contributor
Star Contributor
No, there is no way to 'clone' a process instance at the moment.
If it is only related to variables, though, simply fetch the variables map from the original process instance and pass it through

kiddinho
Champ in-the-making
Champ in-the-making
Thanks!
We need runtime & history information of process instance too. So I think the only way now is query & insert to DB directly

mmaker1234
Champ in-the-making
Champ in-the-making
I think you should reconsider your process design.

What about a process definition with a sub-process started by a parallel activity for each object in your batch? Then you could track the sub-processes (for each object) and still have a reference to and history of the whole batch (object) in the parent process.

xiaohelong
Champ in-the-making
Champ in-the-making
I happened to this too, Like MES I need to Split Order in process runtime.
In detail: there is 10 set machine need to product, when the flow goes to product, some exceptions occured, so we need to split one order to several part,such as 2,3,5 set in each order,so it will generate 3 orders ,also the history is same,but the part follows is not the same.
so the  first idea  in my mind is to clone the running process to 3 , and modify some info,and save to db, treat them like 3 process.
If you solve the problem or some idea to this ,welcome to communicate. email:xiaohelong2005@126.com

xiaohelong
Champ in-the-making
Champ in-the-making
My friend with experiences tells me that, We can split order in node via a new process with current history.