08-01-2011 12:41 PM
ProcessDefinitionBuilder processDefinitionBuilder = new ProcessDefinitionBuilder(someName);
processDefinitionBuilder = processDefinitionBuilder.createActivity(top.getName())
.initial()
.behavior(new BaseServiceTaskHandler("start node"))
.transition(startName)
.endActivity();
for (int i = 0; i < myChecklist.size(); i++) {
if(i<myChecklist.size() - 1) {
processDefinitionBuilder = processDefinitionBuilder.createActivity(myChecklist.get(i).getName())
.behavior(new ReminderActivityHandler())
.transition(myChecklist.get(i + 1).getName())
.endActivity();
} else {
processDefinitionBuilder = processDefinitionBuilder.createActivity(top.getRoutine().get(i).getName())
.endActivity();
}
}
PvmProcessDefinition processDefinition = processDefinitionBuilder.buildProcessDefinition();
10-04-2011 12:05 PM
03-01-2012 11:45 AM
03-02-2012 01:33 AM
<callActivity id="callCheckCreditProcess" name="Check credit" calledElement="${dynamicProcess}" />
- just before this callactivity you put a service task to generate and deploy the processdefinition
String processXml = generateMyProcessDefinitionXml();
String processId = …. ; // the process id referenced in processXml
DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment().name(..);
// make sure that the name ends with .bpmn20.xml otherwise it won't deploy
deploymentBuilder.addString("dynamicprocess.bpmn20.xml",processXml);
deploymentBuilder.deploy();
execution.setVariable("dynamicProcess", processId);
- then when the callActivity kicks in it will lookup the newly deployed process and execute it
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.