-
1. Re: Does anyone know how to deploy ProcessDefintion in JBPM 4.2
andriusms Feb 8, 2010 6:51 AM (in response to kot.filemon)Hi,
I'm not sure that it's possible to do this with only the jbpm4 library. Personally I've seen this kind of process definition construction only in jbpm4 tests. What you could do is start your constructed definition like this:
ClientProcessInstance processInstance = processDefinition.createProcessInstance();
processInstance.start();someone will correct me if I'm wrong, but I think the repository service with which you could deploy the process from an XML file doesn't seem to support process deployment from the definition object. To deploy the process from a file you can do this
ProcessEngine processEngine = new Configuration().setResource("your.jbpm.cfg.xml").buildProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
NewDeployment deployment = repositoryService.createDeployment();
deployment.addResourceFromClasspath("process.jdpl.xml");
deployment.deploy();I'm assuming the usage of JPDL language here. To deploy the process from the process definition builder you would need another step to convert that object into XML file that defines it, but I can't answer how to do that, because I never tried. Usually processes are pretty static so in most cases you should be able to create an XML file of the process and then you could deploy it.
-
2. Re: Does anyone know how to deploy ProcessDefintion in JBPM 4.2
tcr Feb 8, 2010 12:07 PM (in response to andriusms)Hi,
as already mentioned the deployment based on construction via ProcessDefinitionBuilder is not permanent. After deployment of a regular defintion (design in XML) the repository session will read the XML (which is then stored in DB) and parse it.
The definition is not stored a objects but as XML. So without the XML you wont be able to have a proper definition.
Regards
Torsten