cancel
Showing results for 
Search instead for 
Did you mean: 

how to deploy dynamic create process definition

tonyado
Champ in-the-making
Champ in-the-making
FYI. I create a process definition with such code:
<blockcode>
PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder()
                .createActivity("start")
                .initial()
                .behavior(new NoneStartEventBehavior())
                .transition("end")
                .endActivity()
                .createActivity("end")
                .behavior(new NoneEndEventBehavior())
                .endActivity()
                .buildProcessDefinition();
</blockcode>
I can create process instance of this process definition with
createProcessInstance
method, but I cannot find a method to deploy this process definition to process engine. anyone can tell me how to do this? For some reason, I have to create process definition through code, and I just found there is a ProcessDefinitionBuilder, so I decide to use this one. I want to know is there any other way that I can create process definition dynamically? Thanks very much
6 REPLIES 6

tonyado
Champ in-the-making
Champ in-the-making
Both of <code>NoneStartEventBehavior</code>and <code> NoneEndEventBehavior </code> implements <code>ActivityBehavior</code>, I think the process definition should be ok, I just don't know how to deploy this process definition.

tonyado
Champ in-the-making
Champ in-the-making
anyone knows how to do this? Really appreciate your help~

jbarrez
Star Contributor
Star Contributor
No, it's been years since i've come close to the PvmProcessDefinition. FYI: the PVM classes have been removed in version 6, I would not invest any time in them.

tonyado
Champ in-the-making
Champ in-the-making
hi jbarrez, so we should use BpmnModel instead, right?

jbarrez
Star Contributor
Star Contributor
yes, correct. The BpmnModel can be passed when you call repositoryService.createDeployment()

tonyado
Champ in-the-making
Champ in-the-making
Thanks jbarrez very much.