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
could you elaborate little bit more on what you want achieve? Do you mean "Data object" (from BPMN2) to be considered process variables or?
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