Description of problem: I have a process definition with a custom type variable. When you start the process with a different unknown type, there are two scenarios what will happen for REST and JMS: For JMS API, you will get at the time the process is being started: Caused by: org.kie.services.client.serialization.SerializationException: Unable to load JAXB class 'org.jboss.qa.bpms.jbpm.integration.MyType2 at org.kie.services.client.serialization.JaxbSerializationProvider.commaSeperatedStringToClassSet(JaxbSerializationProvider.java:175) [kie-services-jaxb-6.0.2-redhat-4.jar:6.0.2-redhat-4] at org.kie.services.remote.jms.RequestMessageBean.getJaxbSerializationProvider(RequestMessageBean.java:288) [kie-services-remote-6.0.2-redhat-4.jar:6.0.2-redhat-4] ... 68 more Caused by: java.lang.ClassNotFoundException: org.jboss.qa.bpms.jbpm.integration.MyType2 at java.lang.ClassLoader.findClass(ClassLoader.java:531) [rt.jar:1.7.0_51] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [rt.jar:1.7.0_51] at org.drools.core.common.ProjectClassLoader$InternalTypesClassLoader.loadType(ProjectClassLoader.java:300) [drools-core-6.0.2-redhat-4.jar:6.0.2-redhat-4] at org.drools.core.common.ProjectClassLoader$InternalTypesClassLoader.loadClass(ProjectClassLoader.java:287) [drools-core-6.0.2-redhat-4.jar:6.0.2-redhat-4] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [rt.jar:1.7.0_51] at org.kie.services.client.serialization.JaxbSerializationProvider.commaSeperatedStringToClassSet(JaxbSerializationProvider.java:173) [kie-services-jaxb-6.0.2-redhat-4.jar:6.0.2-redhat-4] ... 69 more For REST API the behaviour is quite different. The start of process is successfully done but the object is of another type than expected and so when you want to use it, you will get: org.apache.xerces.dom.ElementNSImpl cannot be cast to org.jboss.qa.bpms.jbpm.integration.MyType Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create new data object with String property "text" using the Data modeler in Business Central 2. Create new business process with a variable of the type you created in the step 1 and add script task to print content of the variable. 3. Copy the type class to your client and RENAME it (e.g. from MyType to MyType2) 4. Use REST API or JMS API to start the process. 5. See the exceptions at the server side. Actual results: You get awful responses or the process behave wrongly just because an error response has not been returned earlier. Expected results: For bad parameters which are not recognized correctly, a BadRequest response is returned back with explanation that the type XYZ was not recognized. Additional info:
Fixed. See the code here: https://github.com/droolsjbpm/droolsjbpm-integration/commit/b2793891#diff-22683ad45ad6f7235ec30c4ec752754cR170 Parameters of command requests submitted by the Remote (client) Java API are now checked to make sure that they are not instances of "org.w3c.dom.Element", which the ElementNSImpl class is an instance of. If an 'Element' instance is found, an exception is thrown.
Verified in BPMS 6.1.0.ER3 A wrong attempt produces IllegalStateException: Could not unmarshall user-defined class instance parameter of type 'myType2'.