cancel
Showing results for 
Search instead for 
Did you mean: 

Cloning of a task

geekykrish
Champ in-the-making
Champ in-the-making
HI All,
  I am having a scenario where I want to clone a completed task and create a new task from java. When I try to achieve this from java I am able to set all other parameters other than execution id and process definition id. can some body help out in cloning a completed task from java.Thanks in advance friends.
9 REPLIES 9

jbarrez
Star Contributor
Star Contributor
You need a TaskListener that listens for the completion event. Create a new task from the data you get in.

Now, the tricky thing is to set the process insance / execution id - how would you want to fit it in your process? It would need sequenflow and all that to work and to make the other logic work.

So i dont know if that's a good idea actually. What is your use case?

geekykrish
Champ in-the-making
Champ in-the-making
My use case in in certain scenario I will enter a parallel flow and at some point if a condition is true in the parallel flow i need to halt the parallel process and proceed the next user task in the flow once the user completes the task then i need to resume the parallel flow from the state in which it is halted.

jbarrez
Star Contributor
Star Contributor
I re-read your post multiple times, but i couldn't understand it, sorry. Can you please use punctuation in your sentences?

nisaxena
Champ in-the-making
Champ in-the-making
I have kind of same requirement, my use case is (In a particular scenario) when a process will move from 'taskA' to 'taskB'. The task should remain at both the places. I was thinking about either any clone functionality or may be a subTask, but I cannot see anything like that in the API. Can you please guide something?

jbarrez
Star Contributor
Star Contributor
No, that's not possible because it goes against the BPMN 2.0 spec.

What is your use case? I can't see anything directly that would need such functionality in a BPM system.

aimingxu
Champ in-the-making
Champ in-the-making
I have a use case like this: author submit an article to reviewer, the reviewer who was assigned to the task can further assign it to one or many reviewers at runtime to review. I thought that subtask can be created and assigned at runtime but I want subtask to see and do the same as parent task can do such as see attached article and author filled form. So the function is to create a subtask that is a clone of its parent task. Appreciate your help on how to implement this capability.

trademak
Star Contributor
Star Contributor
You could create a sub task and then in your UI logic gather all info attached to the parent task.

Best regards,

aimingxu
Champ in-the-making
Champ in-the-making
Thanks, Tijs. If UI is not Java based, does Activiti REST API provides the same functionality as Activiti Engine Java API?

Thanks,
Aiming

trademak
Star Contributor
Star Contributor
Yes, it should provide the same functionality. And if not please raise it with us and we can add the requested functionality to the REST API.

Best regards,