I am using camunda’s java api to create process and i am also attaching user and service task to it but when i try to start same process using process key or id i am getting an exception like no process definition is present. Please note i am also creating a definition object and assigning it while creating process object.
What is a way to start a process without bpmn file.
How i can use camund process to run only in backend.
Hi and welcome to the forum.
You still need to deploy your process definition into the process engine.
You can do this via the RepositoryService:
Just add the model instance you created to the DeploymentBuilder returned by createDeployment and then call deploy.
Thank you for your quick reply.
I will try this and will share the result.
Thank you
Also may i know how i can create processapplicationreference object.
You can use the Context class to get the reference for the current process application.
https://docs.camunda.org/javadoc/camunda-bpm-platform/7.19/org/camunda/bpm/engine/impl/context/Context.html#getCurrentProcessApplication()
I tried this solution but i am getting below exception when I call deploymentbuilder.addmodelinstance(resourcename, mymodelinstance);
Org.camunda.bpm.model.xml.modelvalidationexception - Dom document is not valid.
I understand that it is expecting resource name as xml or bpmn file but i don’t have any of them as i am using camunda purely for backend purpose.
Please suggest how to proceed ahead.
I still don’t quite understand your use case. You could still model your process definition with the Camunda modeler and save it as a .bpmn file, that you deploy to your process application. There is no frontend involved for that (only during modeling time).
But if you really want to go this way, then the resourcename is really just a name and no XML of file. But it seams that your ModelInstance might not be built correctly, as that should be a representation of the XML, that is loaded into the engine.
How are you generating your process definition?
I was able to deploy it. I actually can not use modeler due to some limitations so i used sample bomn file and I deployed the process. Also process got started!
Thank you for your help!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.