9 Replies Latest reply on Nov 20, 2009 11:39 AM by mike_burton

    [jBPM-3.2] - org.jbpm.graph.def.Node Classs

      Can anyone please tell me what is the corresponding class in jBPM 4.2 for
      org.jbpm.graph.def.Node class which is in jBPM3.2

      Thanks

        • 1. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs
          saraswati.santanu

          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.

          • 2. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs
            kukeltje

            What are you trying to achieve?

            • 3. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs

              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
              Thanks!

              • 4. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs
                saraswati.santanu

                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.

                • 5. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs

                  Thanks Santanu.

                  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..

                  • 6. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs
                    saraswati.santanu

                    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.

                    • 7. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs

                      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?


                      • 8. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs
                        saraswati.santanu

                         

                        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.

                        • 9. Re: [jBPM-3.2] - org.jbpm.graph.def.Node Classs

                          Thanks for all your help. The code worked for me.