cancel
Showing results for 
Search instead for 
Did you mean: 

How to Edit ProcessDefinition/WorkflowDefinition programatically

anandmahadik
Champ in-the-making
Champ in-the-making
Hi,

I am new to Activiti framework.

Is there is way by which I can edit a Process/WorkFlow Definition programmatically? i.e. Add new Task, Delete Task or Change Task sequence/Linking. 

So my requirement is :-
1. Read a exsisting ProcessDefinition in-memory from database
2. Make some changes to it
3. Save the definition or save it as new definition
4. Instantiate the new definition

Please share some code by which is can accomplish this.

Thanks a lot in Advance.
2 REPLIES 2

anandmahadik
Champ in-the-making
Champ in-the-making
I have briefly checked the WorkflowDefinition class present in activiti-simple-workflow project but it seems that it can be used to create a new ProcessDefinition or Just Add Task to the definition.
But I also need following
1. Capability to change the sequence linking between task. I.e. adding task between two sequential task.
2. Delete a task. i.e. If we have following sequence A -> B -> C. I need to delete B and change the liking to A -> C.

I pretty much whole control over editing a existing Definition/Model programmatically.  

Also please share links where I can find such help. Because I could not find any such help rather that digging into Activiti code base and Test cases.

trademak
Star Contributor
Star Contributor
Hi,

You can use the BpmnModel to make changes to an existing model and then use the BpmnXMLConverter to create a BPMN XML file from it and deploy it as a new version / new process definition.

Best regards,