3 Replies Latest reply on Apr 7, 2014 9:44 AM by Jaykumar Pandya

    JBPM : Example required for "Data Object" usage

    Zahid Ahmed Prs Newbie

      Hi,

       

      I am looking for an example on how to use "Data Objects" in my process definition. A small JBPM hello world for this is all I want.

       

      I am using Drools 5.5.0.Final version.

       

      Regards,
      Zahid

        • 1. Re: JBPM : Example required for "Data Object" usage
          Jaykumar Pandya Novice

          Hi - I am also looking for such solution so please let me know if you get solution to this problem of passing custom object to jBPM from JAVA

          • 2. Re: JBPM : Example required for "Data Object" usage
            Maciej Swiderski Master

            could you elaborate little bit more on what you want achieve? Do you mean "Data object" (from BPMN2) to be considered process variables or?

             

            HTH

            • 3. Re: JBPM : Example required for "Data Object" usage
              Jaykumar Pandya Novice

              We have defined one entity class in JAVA file and the same JAR file we have imported in jBPM as well to make a reference for an object. we can create and pass this entity class object from one human task to another but when we are trying to pass this object from JAVA using Map object and accessing the same in jBPM is giving an exception

              java.lang.RuntimeException: WorkflowRuntimeException thrown with message '[jbpmtesting.ExternalTest:50 - externalT:2] -- org.apache.xerces.dom.ElementNSImpl cannot be cast to com.cred.entity.personaldetails.Personal' Caused by: ClassCastException thrown with message 'org.apache.xerces.dom.ElementNSImpl cannot be cast to com.cred.entity.personaldetails.Personal'

              can any one please help me to understand where i have made a mistake?

               

              com.cred.entity.personaldetails.Personal personal = new Personal();
              personal.setAge(5);
              personal.setName("cred");

                      String str= personal.toString();

              System.out.println(str);
              HashMap<String, Object> mapObj = new HashMap<String, Object>();
              mapObj.put("extobj", personal);
              URL url = new URL("http://localhost:8080/business-central/");
              CReDBPMProcessAPI process = new CReDBPMProcessAPI();
              process.initializeEnvironment(url, "com.cred.external:externaltest:1.0",  "sisl", "Destiny#123");
              ProcessInstance pi=  process.startProcess("jbpmtesting.ExternalTest", mapObj);

               

              please note that we are able to pass premitive data types i.e. mapObj.pune("age","5") like this and same value we are able to retrieve in the jBPM but we are failing in passing an object which is defined as serializable