Unknown macro: {next_previous_links2}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

BPMN SOAP tasks allow you to invoke SOAP endpoints within your BPMN processes. You can achieve this by adding a SOAP Task and handling the SOAP invocation part in a process implementation. This tutorial simluates the scenario of invoking the echo SOAP service, which is shipped with WSO2 EI by default.

Creating the BPMN artifacts

Follow the steps below to create the BPMN artifacts including the SOAP Task.

  1. Create a new BPMN project named SoapTaskBPMN. For instructions, see Creating a BPMN Project.
  2. Create a BPMN Diagram named SoapTask.bpmn. For instructions, see Creating the BPMN Diagram.
  3. Click anywhere on the canvas, go to the Properties tab, and fill in the following details:
    Id               : soapTask
    Name         : SOAP Task Process
    Namespacehttp://wso2.org/bpmn/soapTask
  4. To implement the order approval process, drag and drop a Start Event element, a SOAP Task element, a User Task element and an End Event element to the canvas. 

    You view the Create connection option when you hover the mouse pointer on an artifact. Click on the arrow, drag it and drop it on the artifact to which you want to connect it.

Configuring the SOAP Task

  1. Select the Properties tab of the REST Task, click General and enter the Name as Echo Request.
  2. In the Properties tab of the SOAP Task, click Main config and update the following: 

    Service URLhttp://localhost:9765/services/echo.echoHttpSoap11Endpoint/
    Input Payload

    <echo:echoInt xmlns:echo="http://echo.services.core.carbon.wso2.org">
    <!--Optional:-->
    <in>50</in>
    </echo:echoInt>

    Soap versionsoap11
    Output Variable nameresponse
    Soap actionurn:echoInt

     More information on the properties of the SOAP Task

    After adding the SOAP Task to your BPMN Diagram, you can configure the below Properties appropriately, as explained below.

    Field NameString ValueRequired/Optional
    Service URL URL of the target endpoint

    Optional

    You can give this instead of the Service Reference (EPR).

    Service Reference (EPR)

    Registry resource path of the endpoint reference.


    Optional

    You can give this instead of the Service URL.

    Input PayloadRequest payloadOptional
    SOAP HeadersSOAP header block, which is attached to the SOAP header when creating the SOAP requestOptional
    SOAP versionSoap version to be used when creating the SOAP request (i.e., SOAP11 or SOAP12)Required
    HTTP ConnectionControl options for the current connection. ('keep-alive' is the the default value.)Optional
    HTTP Transfer EncodingThe form of encoding, which is used to safely transfer the entity to the userOptional
    Output Variable nameName of the variable to save the responseRequired
    Transport headers

    Header values in the format

    "headerName0":"headerValue0","headerName1":"header Value2"

Configuring the User Task

  1. Select the Properties tab of the User Task, click General and enter the Name as Echo Response.
  2. Click Properties, click Main config  and give admin as the Assignee
  3. In the Properties tab click Form, click New and add the following.

    IdNameTypeVariableReadableWritableRequired
    responseEcho ResponsestringresponseTrueFalseTrue

    You view the field added to the Form of the User Task as shown below.

  4. Press Ctril+S to save all your artifacts.

Deploying the artifacts

  1. For instructions on creating the deployable artifacts, see /wiki/spaces/EI6xx/pages/49615043.
  2. For instructions on deploying them, see /wiki/spaces/EI6xx/pages/49615043.

Testing the output

  1. Log in to the BPMN-explorer at https://localhost:9445/bpmn-explorer using admin for both the username and password.
  2. Click PROCESSES in the top menu, and click the Start option of the REST Task Process.

    This creates a Claimable Task.
  3. Click TASKS in the top menu, and then click Claimable Tasks
  4. Click on the new Claimable Task.
    You view the response of the Echo Service.

  5. Click Complete Task, to approve the appointment.
  6. Click TASKS → COMPLETED TASKS to view the completed task.
  • No labels