cancel
Showing results for 
Search instead for 
Did you mean: 

Support in Service Consumption

engr_arko
Champ in-the-making
Champ in-the-making
Hello
I am newbie in Activiti, I really need some help to make a service consumption task.

My external web service looks like this: 

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://fast.tut.fi/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="SampleService" targetNamespace="http://fast.tut.fi/">
<wsdl:types>
<schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://fast.tut.fi/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://fast.tut.fi/" schemaLocation="http://localhost:8181/SampleService/services/SamplePort?xsd=sample_schema1.xsd'/>
</schema>
</wsdl:types>
<wsdl:message name="HelloResponse">
<wsdl:part element="tns:HelloResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="Hello">
<wsdl:part element="tns:Hello" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="SampleSEI">
<wsdl:operation name="Hello">
<wsdl:input message="tns:Hello" name="Hello"></wsdl:input>
<wsdl:output message="tns:HelloResponse" name="HelloResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SampleServiceSoapBinding" type="tns:SampleSEI">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http'/>
<wsdl:operation name="Hello">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="Hello">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="HelloResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SampleService">
<wsdl:port binding="tns:SampleServiceSoapBinding" name="SamplePort">
<soap:address location="http://localhost:8181/SampleService/services/SamplePort'/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


I have created a bpmn xml below following user guides, Now I don't know how I can test this xml or check the errors please support:


<?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" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
   xmlns:omgdi="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">

   <import importType="http://schemas.xmlsoap.org/wsdl/"
      location="http://localhost:8181/SampleService/services/SamplePort?wsdl"
      namespace="http://webservice.activiti.org/" />

   <message id="Hello" itemRef="tns:Hello" />
   <message id="HelloResponse" itemRef="tns:HelloResponse" />

   <itemDefinition id="Hello" structureRef="SamplePort:Hello" />
   <itemDefinition id="HelloResponse" structureRef="SamplePort:HelloResponse" />

   <interface name="Hello Interface" implementationRef="SamplePort:samplePort">
      <operation id="Hello" name="Hello Operation"
         implementationRef="SamplePort:Hello">
         <inMessageRef>tns:Hello</inMessageRef>
         <outMessageRef>tns:HelloResponse</outMessageRef>
      </operation>
   </interface>


   <process id="myProcess" name="My process" isExecutable="true">
      <dataObject id="dataInputOfProcess" name="Input for webservice"
         itemSubjectRef="tns:Hello" />
      <startEvent id="startevent1" name="Start"></startEvent>
      <scriptTask id="scripttask1" name="Script Task"
         scriptFormat="groovy" activiti:autoStoreVariables="false">
         <script>
            def scriptVar = "Arko"
            execution.setVariable("dataInputOfProcess", scriptVar)
         </script>

      </scriptTask>
      <sequenceFlow id="flow1" sourceRef="startevent1"
         targetRef="scripttask1"></sequenceFlow>
      <sequenceFlow id="flow2" sourceRef="scripttask1"
         targetRef="servicetask1"></sequenceFlow>
      <serviceTask id="webService" name="Call WS"
         implementation="##WebService" operationRef="tns:Hello">
         <!– The BPMN 2.0 Meta Model requires an Input/Output Specification –>
         <ioSpecification>
            <dataInput itemSubjectRef="tns:Hello" id="dataInputOfServiceTask" />

            <dataOutput itemSubjectRef="tns:HelloResponse" id="dataOutputOfServiceTask" />
            <inputSet>
               <dataInputRefs>dataInputOfServiceTask</dataInputRefs>
            </inputSet>
            <outputSet>
               <dataOutputRefs>dataOutputOfServiceTask</dataOutputRefs>
            </outputSet>
         </ioSpecification>
         <dataInputAssociation>
            <sourceRef>dataInputOfProcess</sourceRef>
            <targetRef>dataInputOfServiceTask</targetRef>
            <assignment>
               <from>${dataInputOfProcess}</from>
               <to>${dataInputOfServiceTask.value}</to>
            </assignment>
         </dataInputAssociation>
         <dataOutputAssociation>
            <targetRef>dataOutputOfProcess</targetRef>
            <transformation>${dataOutputOfServiceTask.Hello}</transformation>
         </dataOutputAssociation>
      </serviceTask>
      <endEvent id="endevent1" name="End"></endEvent>
      <sequenceFlow id="flow3" 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="110.0" y="170.0"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="servicetask1"
            id="BPMNShape_servicetask1">
            <omgdc:Bounds height="55.0" width="105.0" x="360.0" y="160.0"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
            <omgdc:Bounds height="35.0" width="35.0" x="510.0" y="170.0"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="scripttask1"
            id="BPMNShape_scripttask1">
            <omgdc:Bounds height="55.0" width="105.0" x="190.0" y="160.0"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
            <omgdi:waypoint x="465.0" y="187.0"></omgdi:waypoint>
            <omgdi:waypoint x="510.0" y="187.0"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
         <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
            <omgdi:waypoint x="145.0" y="187.0"></omgdi:waypoint>
            <omgdi:waypoint x="190.0" y="187.0"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
         <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
            <omgdi:waypoint x="295.0" y="187.0"></omgdi:waypoint>
            <omgdi:waypoint x="360.0" y="187.0"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
      </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
</definitions>
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
What is the actual problem you have? Stacktraces?

Hi
Thank you for your reply.
To be honest, I don't know what is the actual problem. I just followed instruction about Web service call in user guide. Now I don't know how can I run it in activity engine Smiley Happy. I am completely newbie with intermediate Java knowledge and trying to call webservice for a SOA application using BPMN.

Best Regards

jbarrez
Star Contributor
Star Contributor
Well, you can follow the same steps as described in the tutorial (http://activiti.org/userguide/index.html#10minutetutorial). First you have to deploy the process xml. If there are no errors, you will be able to start a new process instance. Part of executing that process instance is calling the web service and you should see that happening in your logging.