jBPM unmarshallingexception (Web Service Task)
biswajit.sarkar Jan 5, 2015 8:29 AMI am new to jBPM. I am using jBPM6.
I trying to invoke a web service from jBPM process using Web Service Task.
My web service accept a object(Person) as input and return also a object(Person) as output.
from my jBPM process I am able to invoke the process and pass the input object(Person). But while try to get the output object I am getting "unmarshalexception: unexpected element".
following is my process ...
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<import importType="http://schemas.xmlsoap.org/wsdl/" location="http://localhost:9090/HelloComplexWeb/services/LookUpPerson?wsdl" namespace="http://test.com"/>
<itemDefinition id="_sItem" structureRef="com.test.Person" />
<itemDefinition id="_sItem2" structureRef="com.test.Person" />
<itemDefinition id="_jbpm-unique-0_InMessageType" structureRef="com.test.Person" />
<message id="_jbpm-unique-0_InMessage" itemRef="_jbpm-unique-0_InMessageType" />
<interface id="_jbpm-unique-0_ServiceInterface" name="LookUpPersonService" implementationRef="LookUpPersonService" >
<operation id="_jbpm-unique-0_ServiceOperation" name="personInfo" implementationRef="personInfo" >
<inMessageRef>_jbpm-unique-0_InMessage</inMessageRef>
</operation>
</interface>
<process processType="Private" isExecutable="true" id="com.sample.bpmn.helloComplexWeb" name="Hello Complex Web" >
<!-- process variables -->
<property id="person" itemSubjectRef="_sItem"/>
<property id="personInfo" itemSubjectRef="_sItem2"/>
<!-- nodes -->
<startEvent id="_1" isInterrupting="true"/>
<endEvent id="_3" >
<terminateEventDefinition />
</endEvent>
<serviceTask id="_jbpm-unique-0" name="WebServiceTask" operationRef="_jbpm-unique-0_ServiceOperation" implementation="##WebService" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<tns:script>System.out.println("In Service Task");</tns:script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<tns:script>
System.out.println("In Service Task exit");
</tns:script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_jbpm-unique-0_param" name="Parameter" />
<dataOutput id="_jbpm-unique-0_result" name="Result" />
<inputSet>
<dataInputRefs>_jbpm-unique-0_param</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_jbpm-unique-0_result</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>person</sourceRef>
<targetRef>_jbpm-unique-0_param</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_jbpm-unique-0_result</sourceRef>
<targetRef>personInfo</targetRef>
</dataOutputAssociation>
</serviceTask>
<scriptTask id="_jbpm-unique-7" name="Script" scriptFormat="http://www.java.com/java" >
<script>
person = (com.test.Person)kcontext.getVariable("Parameter");
System.out.println("userId : "+person.getId());
kcontext.setVariable("person", person);
</script>
</scriptTask>
<!-- connections -->
<sequenceFlow id="_jbpm-unique-0-_3" sourceRef="_jbpm-unique-0" targetRef="_3" />
<sequenceFlow id="_jbpm-unique-7-_jbpm-unique-0" sourceRef="_jbpm-unique-7" targetRef="_jbpm-unique-0" />
<sequenceFlow id="_1-_jbpm-unique-7" sourceRef="_1" targetRef="_jbpm-unique-7" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.helloComplexWeb" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="-8" y="97" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="572" y="55" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-0" >
<dc:Bounds x="220" y="105" width="100" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-7" >
<dc:Bounds x="96" y="90" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-0-_3" >
<di:waypoint x="270" y="129" />
<di:waypoint x="596" y="79" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-7-_jbpm-unique-0" >
<di:waypoint x="136" y="114" />
<di:waypoint x="270" y="129" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_1-_jbpm-unique-7" >
<di:waypoint x="16" y="121" />
<di:waypoint x="136" y="114" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
Please help me. I am not getting the output.