There is no such matching class in jbpm4. Maybe org.jbpm.pvm.internal.model.Activity (or org.jbpm.pvm.internal.model.ActivityImpl) and org.jbpm.api.activity.ActivityBehaviour combination can be thought of as a closer match, but no way they can be called the same.
I believe Node is typically for graph based process models. Activity is more generic.
What are you trying to achieve?
I am trying to create the process definition xml file in jBPM 4.2 programatically and am able to create it using DOM4j.
I guess we can achieve this in jBPM 3.2, using ProcessDefinition class by getting nodes, transitions etc..
Just i am curious to know is there same kind of classes availble in jBPM 4.2 also to create process defintion xml File.
Can anyone help me in parsing the process definition xml file which is generated programtically in jBPM4.2. Is there any class in jBPM 4.2 to parse this process definition xml file?
Please guide me
I am new to jBPM
org.jbpm.jpdl.internal.xml.JpdlParser is the cental class which does the parsing. And there are binding classes which parse the individual nodes. For example, there is "org.jbpm.jpdl.internal.activity.StartBinding" for parsing start node. You will see the full list in jbpm.jpdl.bindings.xml.
Once you generate the xml, you typically should not need to parse it by calling JpdlParser, NewDeployment.deploy() method does it all for you.
I am able to deploy my xml using method deploy() in NewDeployment class.
Is there any way to map this xml to ProcessDefinition class in jBPM 4.x.
Thanks in advance for your valuable reply..
ProcessDefinition has a deployment (refer to ProcessDefinition.getDeploymentId()). Deployment id is retrieved from process definition. Use DeploymentQuery to find the Deployment using the id. You can get the xml from this deployment. However the bad part is you have to type cast Deployment to DeploymentImpl to be able to access the xml resources. You need to use getResource(String) method there of DeploymentImpl.
Thanks for your reply
I am not sure how to get ProcessDefinition (like from which class etc..). But i am able to get the deployments by using the below code.
String lDeploymentID = lRepositoryService.createDeployment().setName(workflowname).addResourceFromString("xmlstring.jpdl.xml", lWorkflowXML).deploy();
List deployments = RepositoryService.createDeploymentQuery().deploymentDbid(Long.parseLong(lDeploymentID)).list();
Is this the correct way to get the specific deployment from db?
Also how can i get the ProcessDefinition object once deploy the xml string?
String deploymentId = repositoryService.createDeployment().addResourceFromString("xmlstring.jpdl.xml", workFlowXml).deploy(); //now we query the process definition ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).uniqueResult();
I think the way you are getting deployment is correct.
Thanks for all your help. The code worked for me.