I am also looking for answer for such problem as i am facing this issue and not able to resolve it. please let me know if you get the solution to pass custom object to jBPM from JAVA
com.entity.personaldetails.Personal personal = new Personal(); personal.setAge(5); personal.setName("cred"); 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);
above code i have written, here personal class is added to my class path and also in jBPM dependcies i have added but still when i am executing process.startProcess, it is giving me an exception of class type cast.
I have implemented this program using Remote REST API only
I've added some documentation about the requirements for making user-defined classes accessible via the REST or JMS API's:
I need to update the community docs -- just implementing the Serializable interface for an user-defined class is *not* enough.
The reason your getting a problem is because the server probably doesn't know anything about the class: the instance you're sending is of course deserialized on the *server* side.
In order to make sure that the server-side application (business-central or kie-wb) knows something about the class, the class must be part of the deployment.
Is there an example project or anything similar that might be of value to use here? I've worked through all the docs I have seen and run into a bunch of issues and confusion as to what the minimum is to have the custom data objects returned in a useable format via the ReST API?