cancel
Showing results for 
Search instead for 
Did you mean: 

Error invoking a Web service in bpmn using activiti

sopheachhun
Champ in-the-making
Champ in-the-making
Dear Everyone,

Please help me.

I want to invoke web service in bpmn process.
I try with javadelegate, it works. However, using this java delegate, we have to restart the server every time a new business process is implemented.

So, I try with invoking wsdl directly into bpmn process.
I follow the tutorial in activiti book. I make the bpmn profess in eclipse, then I upload into activiti-explorer. I get the error message below. I seem that activiti-explorer support only the implementation of bpmn with java-class. Even, I upload only the diagram of bpmn process without invoking a web service, I also get the error message. do I need to make some configuration change to allow  activiti-explorer to support the implementation of bpmn process to call a web service directly.

errors while parsing:[validation set:'activiti-executable-process'|problem:'activiti-servertask-missing-implementation']': one of the attributes 'class', 'delegateExpression','type','operation' or 'expression' is mandatory on service task. [extra info: processDefinitionId=myProcess|processDefinitionName=my process||id=iservicetask1||activitiname=addition service|]

Here is my wsdl:
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:ns="http://activiti.customer"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://activiti.customer">

    <wsdl:documentation>Customer</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://activiti.customer">
            <xs:element name="sum">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="number" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="sumResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="sumRequest">
        <wsdlSmiley Tongueart name="parameters" element="ns:sum"/>
    </wsdl:message>
    <wsdl:message name="sumResponse">
        <wsdlSmiley Tongueart name="parameters" element="ns:sumResponse"/>
    </wsdl:message>
    <wsdlSmiley TongueortType name="CustomerPortType">
        <wsdlSmiley Surprisedperation name="sum">
            <wsdl:input message="ns:sumRequest" wsaw:Action="urn:sum"/>
            <wsdlSmiley Surprisedutput message="ns:sumResponse" wsaw:Action="urn:sumResponse"/>
        </wsdlSmiley Surprisedperation>
    </wsdlSmiley TongueortType>
    <wsdl:binding name="CustomerSoap11Binding" type="ns:CustomerPortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdlSmiley Surprisedperation name="sum">
            <soapSmiley Surprisedperation soapAction="urn:sum" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdlSmiley Surprisedutput>
                <soap:body use="literal"/>
            </wsdlSmiley Surprisedutput>
        </wsdlSmiley Surprisedperation>
    </wsdl:binding>
    <wsdl:binding name="CustomerSoap12Binding" type="ns:CustomerPortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdlSmiley Surprisedperation name="sum">
            <soap12Smiley Surprisedperation soapAction="urn:sum" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdlSmiley Surprisedutput>
                <soap12:body use="literal"/>
            </wsdlSmiley Surprisedutput>
        </wsdlSmiley Surprisedperation>
    </wsdl:binding>
    <wsdl:binding name="CustomerHttpBinding" type="ns:CustomerPortType">
        <http:binding verb="POST"/>
        <wsdlSmiley Surprisedperation name="sum">
            <httpSmiley Surprisedperation location="sum"/>
            <wsdl:input>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:input>
            <wsdlSmiley Surprisedutput>
                <mime:content type="text/xml" part="parameters"/>
            </wsdlSmiley Surprisedutput>
        </wsdlSmiley Surprisedperation>
    </wsdl:binding>
    <wsdl:service name="Customer">
        <wsdlSmiley Tongueort name="CustomerHttpSoap11Endpoint" binding="ns:CustomerSoap11Binding">
            <soap:address location="http://159.84.110.102:9763/services/Customer.CustomerHttpSoap11Endpoint/'/>
        </wsdlSmiley Tongueort>
        <wsdlSmiley Tongueort name="CustomerHttpsSoap11Endpoint" binding="ns:CustomerSoap11Binding">
            <soap:address location="https://159.84.110.102:9443/services/Customer.CustomerHttpsSoap11Endpoint/'/>
        </wsdlSmiley Tongueort>
        <wsdlSmiley Tongueort name="CustomerHttpSoap12Endpoint" binding="ns:CustomerSoap12Binding">
            <soap12:address location="http://159.84.110.102:9763/services/Customer.CustomerHttpSoap12Endpoint/'/>
        </wsdlSmiley Tongueort>
        <wsdlSmiley Tongueort name="CustomerHttpsSoap12Endpoint" binding="ns:CustomerSoap12Binding">
            <soap12:address location="https://159.84.110.102:9443/services/Customer.CustomerHttpsSoap12Endpoint/'/>
        </wsdlSmiley Tongueort>
        <wsdlSmiley Tongueort name="CustomerHttpEndpoint" binding="ns:CustomerHttpBinding">
            <http:address location="http://159.84.110.102:9763/services/Customer.CustomerHttpEndpoint/'/>
        </wsdlSmiley Tongueort>
        <wsdlSmiley Tongueort name="CustomerHttpsEndpoint" binding="ns:CustomerHttpBinding">
            <http:address location="https://159.84.110.102:9443/services/Customer.CustomerHttpsEndpoint/'/>
        </wsdlSmiley Tongueort>
    </wsdl:service>
</wsdl:definitions>

here is my bpmn:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:activiti="http://activiti.org/bpmn"
   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
   xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC"
   xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI"
   typeLanguage="http://www.w3.org/2001/XMLSchema"
   expressionLanguage="http://www.w3.org/1999/XPath"
   targetNamespace="http://www.activiti.org/test"
   
   xmlns:tns="http://activiti.customer"> <!– add this one –>
   
   <!–1. import the wsdl file–>
   <import importType="http://schemas.xmlsoap.org/wsdl/"
        location="http://159.84.110.102:9763/services/Customer?wsdl"
        namespace="http://activiti.customer" />
   
    <!– 2. define the request message –>
    <message id="sumRequestMessage"
       itemRef="tns:sumRequestItem"/>
    <message id="sumResponseMessage"
       itemRef="tns:sumResponseItem"/>

    <!– 3. define reference of wsdl input message –> 
   <itemDefinition id="sumRequestItem"
      structureRef="ns:sumRequest"/> <!– wsdlSmiley TongueortypeSmiley Surprisedperation:input:message –>
   <itemDefinition id="sumResponseItem"
      structureRef="ns:sumResponse"/> <!– wsdlSmiley TongueortypeSmiley SurprisedperationSmiley Surprisedutput:message –>
      
    <!– 4. references wsdl port type –>
    <interface name="addition operatoin" implementationRef="CustomerPortType"> <!– port type's name –>
       <!– 5. reference wsdl operation –>
        <operation id="sumOperation"
           name="Calculate addition"
          implementationRef="sum"> <!– operation's name –>
          <inMessageRef>tns:sumRequestMessage</inMessageRef> <!– message's id –>
            <outMessageRef>tns:sumRequestMessage</outMessageRef>
       </operation>
   </interface>
    <!– 6. input element as defined in wsdl –>
     <itemDefinition id="UserNumber" structureRef="int" />
     <itemDefinition id="sum" structureRef="int" /> <!– input:ele:name –>
     <itemDefinition id="response" structureRef="int" />
     <itemDefinition id="sumResponse" structureRef="int" /> <!– output:ele:name –>
    
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="servicetask1"
       name="addition service"
       implementation="##WebService"
       operationRef="tns:sumOperation">
       <ioSpecification>
         <dataInput
            itemSubjectRef="tns:sumRequestItem"
            id="dataInput" />
         <dataOutput
            itemSubjectRef="tns:sumResponseItem"
            id="dataOutput" />
         <inputSet>
            <dataInputRefs>dataInput</dataInputRefs>
         </inputSet>
         <outputSet>
            <dataOutputRefs>dataOutput</dataOutputRefs>
         </outputSet>
      </ioSpecification>
      <dataInputAssociation>
         <sourceRef>UserNumber</sourceRef>
         <targetRef>sum</targetRef>
      </dataInputAssociation>
      <dataOutputAssociation>
         <sourceRef>response</sourceRef>
         <targetRef>sumResponse</targetRef>
      </dataOutputAssociation>
    </serviceTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
  </process>
 
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="120.0" y="180.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
        <omgdc:Bounds height="55.0" width="105.0" x="250.0" y="170.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="460.0" y="180.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="155.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="250.0" y="197.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="355.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="460.0" y="197.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
4 REPLIES 4

lean
Champ in-the-making
Champ in-the-making
Hi sopheachhun,
I'd like to ask you if did you find out the solution because I have your same problem to invoke a webservice from BPMN process.
Thanks advance

sopheachhun
Champ in-the-making
Champ in-the-making
Hello Lean,

I contact to the founder of activiti, they said the current release of activiti engine support only the solution with alternative Java. They are working on classless, it is the one we are trying and facing problem.'
They told me the new release would be in August or September. As I know they finish it but not finish administration process only.
good luck,
sophea

lean
Champ in-the-making
Champ in-the-making
ok thanks!! I've spent my last three days to find out a possibile solution. Smiley Very Happy so we'll attend on September.
last question: the only solution is use javadelegate like you mentioned right?
thanks again.
Lean

sopheachhun
Champ in-the-making
Champ in-the-making
Yes, for now and for activiti.
For other platform or engine, I don't know; the solution should be different.
good luck,
sophea