I'm reviewing Camunda for integrating it in our environment, but I'm a bit stuck early on in the process.
I've included the required jars on the classpath (not getting any classNotFound errors), and created a processEngine:
ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().buildProcessEngine();
Next I create a modelInstance and deploy it:
BpmnModelInstance modelInstance = Bpmn.createExecutableProcess('ExampleProcess')
.name("Example process")
.startEvent()
.userTask()
.name("Some work to do")
.endEvent()
.done();
File file = java.io.File.createTempFile("bpmn-model-api-", ".bpmn");
Bpmn.writeModelToFile(file, modelInstance);
processEngine.getRepositoryService().createDeployment()
.name('test-2')
.addInputStream("FluentTest", new java.io.FileInputStream(file))
//.addModelInstance("FluentTest", modelInstance) //Also tried this variant, but same issue
.deploy()
After running this code, which raises no errors, I'm logging the following:
log.debug(processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionId('ExampleProcess').list())
log.debug(processEngine.getRepositoryService().createDeploymentQuery().deploymentName('test-2').list())
Which gives me:
DEBUG []
DEBUG [DeploymentEntity[id=1, name=test-2, resources=null, deploymentTime=Fri Aug 01 13:06:31 CEST 2014, validatingSchema=true, isNew=false]]
So, my conclusion is that the proces "ExampleProcess" in my deployment is not available. Where am I going wrong?
Hope someone can share some insight,
Regards,
Paul
log.debug(processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionId('ExampleProcess').list())
should be changed to
log.debug(processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionKey('ExampleProcess').list())