Build it yourself

This section describes how to build the integration based on Web Services. The BPEL process acts as the service requester. It calls a service provider represented by a web service implemented by a Business Process Definition (BPD). This uses a one-way asynchronous inbound web service integration. The response from the BPD is implemented as an outbound web service call to be correlated with the internal Receive of the BPEL process.

The interaction of this service integration between the BPEL process and the BPD is implemented and tested in two parts.

Part 1 Inbound Integration

  1. Create BPD
  2. Create and test the Undercover Agent UCA
  3. Develop and test the Invocation Human Task
  4. Creating the Inbound Web Service
  5. Create BPEL Process as Service Requester
  6. Update the assembly diagram and test the Web Service integration
Part 2 Outbound Integration
  1. Update BPEL Process to receive and correlate intermediate events
  2. Expose an Export WSDL Interface
  3. Create the Outbound Web Service

Reference

http://publib.boulder.ibm.com/infocenter/wle/v7r1/index.jsp?topic=/wle/modeling/topic/publishing_twks_web_services.html

Naming Conventions
Within the sample we will switch between artifacts developed  in the IBM Process  Designer (IPD) and the IBM Integration Designer (IID). Do understand where the artifacts come from we use following convention. On the Process Designer side we use the suffix _BPD, _Data while in IID we use _BPEL, _BO. Instead of the long name Internal Order Approval we will use the acronym IOA.


Part 1: Inbound Integration

The Web Service Integration between the BPEL process and a BPD uses an SCA Import on the BPEL side and a Web Service inbound integration including an Under Cover Agent (UCA) on BPD side. The development step including the stepwise verification of the developed artifacts is shown in the figure below.  

files to import


Develop inbound web service integration

 

1. Create BPD

  1. Create a Process Application named Internal Order Approval App .
    Open the PD. Press Create New Process App. Enter Internal Order Approval App for the name and IOAAPP for the acronym. Press Create.
    The Process App is created. Press Open in Designer.
    Open in Designer

  2. Define a data object InternalOrder
    In the project tree  highlight Data and then click the plus sign (+). Create New > Business Object.
    Data

    Enter the new business object name Internal Order. Press Finish.
    Data Object Name

    Add following the Parameters and Variable Types listed in the screenshot below.
    Data Object Attributes
  3. Define a BPD IOA_BPD
    In the project tree select the + sign next to Processes. Create New Business Process Definition.
    Enter the new business process definition name IOA_BPD. Press Finish.

    Drag an Activity from the tools palette on the right into to Participant lane.
    Delete the Start node.
  4. BPD Creation

    Note:

    When a BPD is initiated via a Start node you should expose starting of the BPD to All users or the user group to be authorized. See the Exposing section under the overview tab. When the BPD, however, is started via a Start Messsage Event using an UCA, than you shouldn't expose the start to anyone.

    Open the Variables tab. Press  Add Private. For the Name enter IOA_Data.
    Select Variable Type and chose InternalOrder.
    Press Ctrl + S to save the BPD.

    Variables -Private

  5. Define Internal Order Approval Task IOA Task
    Specify the name of the Human Task in the participant lane under Properties to IOA Task.
    Right-click the human task and select Activity Wizard ...
    Stay with the Service Type as Human Service and Create a New Service with the above task name. Press Next.
    Stay with the parameter selection with IOA_Data (InternalOrder) as Input and Output equals to true. Press Finish.


  6. Double-click the IOA Task which shows the service implementation details of it. Rename the coach to IOA Coach.
    Double-click the coach which opens and allows to verify the associated form. Save the IOA Task.
    InternalOrderApproval Coach Form

  7. Return to the IOA_BPD. Wire the human task IOA Task with the End Node using the Sequence Flow connector. Press Ctrl + S to save your work.

  8.   IOA Task wired to End

2. Create and test the Undercover Agent (UCA)

When you include a Message Event in a BPD, you must attach a UCA to the event to call the service that you specify. For example, when a message event is received from an external system, a UCA is needed to invoke the appropriate service in response to the message.

The UCA that you attach to the message event needs a handler service (General System Service) to pass the parameter values from the run-time message to the BPD

a. Create a Global System Service

  1. Highlight Implementation and then click the plus sign (+). Select General System Service an name it IOA_Inbound_GSS
    When the diagram is opened connect the Start and End Node via Sequence Flow.

    GSS

    Under Variables press Add Input called IOA_Data of Variable Type InternalOrder.
    Under Variables press Add Output called IOA_Data of Variable Type InternalOrder.
    GSS variables Input Output

    Press Ctrl + S to save your work.

b. Create the UCA

  1. Create the event based InternalOrder Approval Inbound Undercover Agent (UCA) named IOA_Inbound_UCA
    Highlight Implementation and then click the plus sign (+). Create a new UCA named IOA_Inbound_UCA
    For Schedule Type select On Event .
    For Attached Service select  General System Service > IOA_Inbound_GSS.  Press Finish.
  2. UCA Definition

    You don't need to specify any Parameter Mapping. Press Ctrl + S to save your work.

c. Add a start message event to the BPD

  1. Return to the IOA_BPD and drag a Start Message Event to the System Lane. Connect the message event via a Sequence Flow to the human task. Rename the message event under Properties > Step to IOA_StartMessageEvent.
  2. Start Message Event

  3. Attach the UCA to the message event
    Under Properties > Implementation > Message Trigger > Attached UCA select the IOA_Inbound_UCA.
    Under Properties > Implementation > UCA Output Mapping select the Local > IOA_Data. Press Ctrl + S.

      event implementation


d. Run and test the UCA

  1. For the above Start Message Event double-click the IOA_Inbound_UCA. The UCA Properties opens.
    Press Run now.
    Run now

    Confirm with OK that the UCA has been scheduled for immediate execution.

  2. Switch to the Inspector perspective and see that a new BPD instance. Select the BPD instance and click Refresh. The new IOA Task is displayed. Press the arrow Runs the selected.
    UCA - Inspector

    The fact that the BPD instance was instantiated demonstrates that the UCA successfully triggered the BPD.
    Return to the Designer perspective.

3. Develop and test the Invocation Human Task

With the invocation task developed in this section we test the UCA and the initiation of the BPD a second time.

a. Create Invocation Task

  1. Highlight User Interface and then click the plus sign (+). Create new Human Service named IOA_InvocationTask.
  2. Define Variables for that task via the Variables tab > Add Private with Details > Name to IOA_Data and Variable Type selected as InternalOrder.
    For Default Value set the flag Has Default and specify your own values.
    Invocation Task Variables and Defaults

  3. Select the Diagram tab. From the palette on the right drag a Coach to the canvas. Name the Coach IOA_InvocationTask_Coach. Right-click on that Coach itself or the Coach tab. Verify the form. If the IOA_Data fields are not shown drag them from Variables at the bottom right underneath the Section Title.
    Invocation Task Coach Form

    Return to the Diagram tab.

  4. From  Implementation > Undercover Agents select and drag the IOA_Inbound_UCA to the canvas in between the IOA_InvocationTask_Coach and the End node.
    Connect all artifacts via a Sequence Flow from Start node - IOA_InvocationTask_Coach - IOA_Inbound_UCA - End node.

    Drag Implementation >UCA to canvas

  5. Under Properties > Data Mapping select Input Mapping > Local >  IOA_Data (InternalOrder).

    Press Ctrl + S to save your work.


b. Test the UCA with Invocation Human Task

  1. While the IOA_InvocationTask is still open in the Diagram tab press the arrow Run Service on the far top right of the diagram.
  2. This launches a Browser to access the input form of the Invocation Task. Change some of the parameters and press Ok.
    Test_InvocationTask

  3. Close your Browser. Select the Process Designer. Click the Inspector tab and see / refresh the new IOA_BPD instance and which offers the IOA_Task.
    Select the IOA_Task  which is in the Received status and press the arrow Runs the selected task on far top right.
    Run the selected task

  4. You are asked to Pick User From Role. Select any user e.g. tw_admin and press Ok.
    The form with the updated parameters is displayed.
    IOA_Task_Success
    Press Ok. The IOA_BPD was successfully started by the Invocation Task.


    If you encounter any errors re-verify all your data mappings and repeat the test.
    If the updated parameters still don't show up stop and re-start your Process Center Server.

Create a Snapshot

  1. Return to the Designer perspective.
  2. Press Snapshot in the upper right.
  3. Enter the name of the snapshot: Internal order Approval App SS1 .
    You might add some description. Press OK.
    Snapshot

4. Creating the Inbound Web Service

The next step in completing this sample inbound integration is to create an Integration service to call the UCA to send the event when the inbound Web Service (that you create in the following section) is called.

a. Create the Web Service Handler in form of an Integration Service

  1. Create an Integration Service and name it IOA_Inbound_WebService_Handler 
    Being in the Designer perspective open Implementation > Integration Service. Create new one named  IOA_Inbound_WebService_Handler. Press Finish.
    Define Inbound WS Handler

  2. Switch to the Variables tab.
    Under Variables press Add Input called IOA_Data  of Variable Type InternalOrder.
    Under Variables press Add Output called IOA_Data  of Variable Type InternalOrder.

    Add Input Add Output Variables

  3. Return to the Diagram. From the Navigator select Implementation > UCA and drag the IOA_Inbound_UCA on the canvas. In the WS Handler  we use this UCA to trigger the IOA_BPD as we did for the IOA_InvocationTask.
    Place the UCA it between the Start Event and End Event in the service diagram.

  4. Use the Sequence Flow to connect the service components on the diagram.
    UCA within WS Handler

  5. Click the IOA_Inbound_UCA component in the diagram.
    Step > Common > Name is already defined.
    Implementation > Undercover Agent is already defined as IOA_Inbound_UCA.
    Data Mapping > Input Mapping > select Local > Input > IOA_Data (InternalOrder). This maps the Input of the WS Handler with the input of the underlying service component, here the UCA.
    UCA Data Mapping

  6. Press Ctrl + S to save your work. 

b. Create the Inbound Web Service

Now you need to provide a way for an external system or application to call into process engine to start the BPD. The recommended method for accomplishing this is to create and publish a Web Service so that external applications can initiate a particular service or set of services. By invoking a SOAP call, external applications can call the Web Service.

  1. Create a Web Service called IOA_Inbound_WebService .
    Select the plus sign next to the Implementation category and then select Web Service.
    Enter the name IOA_Inbound_WebService . Press Finish.
    Create WebService

  2. In the Operations section, click the Add button and select the IOA_Inbound_WebService_Handler Integration Service.
  3. In the Operation Detail section, change Untitled in the Operation Name field to invokeIOA_BPD.
    WSDL Specification

  4. Notice the WSDL URI in the Behavior section. You can use this URI to test the sample integration.
  5. Press Ctrl + S to save your work.

c. Export the Inbound Web Service WSDL

Double-click the WSDL URI to see the details of the WSDL in your browser.
WSL Details
       
        Press File > Save as and save the WSDL as IOA_Inbound_WebService.wsdl to a temporary directory.


d. Test the Inbound Web Service WSDL via soapUI

One of the most popular Web Service testing tools on the Internet is called soapUI. It can be found at the following web address: http://www.soapui.org/

This tool/package can be used to exercise calls to IBPM that are exposed as Web Services. The following is the recipe used to achieve this task.

  1. Launch the soapUI tool and select File > New soapUI Project and enter InternalOrderApproval_Inbound_WebService.
    Give the new project a name InternalOrderApproval_Inbound_WebService and click OK to complete.
  2. Right click the new project and select Add WSDL
  3. In the WSDL location text box, enter the URL for the WSDL describing the Web Service. This can be obtained from the IBPM PD Web Service definition in the "Behavior" section of the previous step. In our case it is the url:
    http://fmtc5168.boeblingen.de.ibm.com:9080/teamworks/webservices/IOAAPP/IOA_Inbound_WebService.tws?WSDL
    Add WSDL to soapUI

  4. When completed, soapUI will retrieve the WSDL description and parse it. From the WSDL, a sample request message will be built. This request message is a SOAP message that, if sent to IBPM, will cause the service to execute. Drilling down into the request will show the details of the SOAP message which can be modified, e.g. the values be specified.

    Define your own values for all attributes of the IOA Data object. Press the Submit button (Submit request to specified endpoint URL).
    Start WSDL via soapUI

  5. Switch to the Process Designer, open the Inspector perspective and press the Refresh button. See that a new process instance IOA_BPD:xxx and a new task with Subjct: Task: IOA_Task is available. Ru this task to verify that the web services was successfully started with above values.



5. Create BPEL Process as Service Requester

In this chapter you will use an existing Module with a BPEL process. The process will be adopted to use an Invoke with a Web Service binding to call the inbound Web Service of the BPD created in the preceding chapter. So the BPEL process will act as the Service Requester.

a. Import and familiarize yourself with the BPEL process

  1. Download the initial projects to build the scenario yourself, namely the Procurement_Sample_BPELProcess_Module.zip, the web project named Procurement_Sample_BPELProcess_Web.zip, and  the Procurement_Sample_BPELProcess_FormsEAR.zip. Save them it to a temporary directory.

  2. Download the Procurement_Sample_BPELProcess_FormsEarFile.ear. Make sure that the type of the saved file in the file system is ".ear".

    files to import


  3. Start the IBM Integration Designer (IID) and import projects
  4. The IID, for a given workspace, opens in the Business Integration perspective.
    Select File > Import or right-click on the project tree and select Import.

    import feature


    Select Other > Project Interchange file and navigate to directory where you saved your the WPS project files. Press Open.

    The Import Project Interchange Content window is opened. Select the downloaded files one by one and import them.

    import projects

    Press Finish. Wait until the import and building workspace has completed.

    Note
    You might be prompted that the workspace needs to be migrated. If so, confirm the corresponding steps with Next, Finish, and OK.

    Repeat the same import step. Select the Procurement_Sample_BPELProcess_Web.zipwith the web application including an invocation task. Wait until the import and build has completed.

    Repeat the same import step. Select the Procurement_Sample_BPELProcess_FormsEAR.zip with provides a forms application.

    Following resources have been imported.
    imported projects

  5. Familiarize yourself with the assembly diagram
    Expand the Procurement_Sample_BPELProcess_Module folder. Double-click the Assembly Diagram.
    The diagram shows the BPEL process wired to four Java Implementation Services. This process can be initiated by an invocation task.
  6. assembly diagram


    The automatic ApproveReplenishmentOrder_Service will be replaced by an Import to call a Business Process Definition service including a human approval task in this sample.

  7. Familiarize yourself with the BPEL process
    Double-click the ReplenishmentBPEL process. The BPEL process editor opens.
    The BPEL process includes four Invoke activities as explained in the Business Scenario description.
  8. BPEL process diagram

    The ApproveReplenishmentOrder activity – if not completed by the Approver of the replenishment order within 10 minutes – will automatically expire. It will be adopted in this sample to cope with the implementation by a WLE BPD service.

    properties expiration


    This error will trigger an Exception Handler with a built-in timeout fault type specified.

    timeout built-in

    Subsequently the ReplenishOrder approved status is set to True as default. assign node

    Within the BPEL process a single business object ReplenishOrderBO and following interfaces are provided.

    assign node


    In the course of this sample the interface for the ApproveReplenishmentOrder_IF will be replaced by an interface generated for the SCA invocation of a Business Process Definition (BPD).

  9. Install and start the Web Application
    Web projects are not "lifecycle aware". So if you want multiple snapshots of a Process Application to contain the same Web Project you'll need to use a single separately deployed Web App. This is directly deployed as a J2EE web application and, shared across the Process Application snapshots.

  10. Open your preferred internet browser and enter the url for the Administrative Console:
    https://localhost:9043/ibm/console/logon.jsp
    The login window opens. Enter the userid = tw_admin and password = tw_admin. Press Log in.

    login console


    Within the Admin Console select Applications > New Application > New Enterprise Application.

    install new application


    The Preparing for the application install window opens. Browse and navigate to the directory where you have stored the downloaded resources. Select Procurement_Sample_BPELProcess_FormsEARFile.ear. Press Open. Press Next.

    specify the ear


    Stay with Fast Path. Press Next.
    Keep the settings for Step 1: Select installation options. Press Next.
    For Step 2: Map modules to servers select the flag for the Procurement_Sample_BPELProcess_Web. Press Next.

    step 2


    For Step 3: Summary press Finish.

    Wait for the EAR file being installed.
    Press Save after the application was successfully installed.

    save ear

  11. Start the Web Application
    The Procurement_Sample_BPELProcess_FormsEAR.ear was installed but not automatically started. Navigate to Applications > Application Types > Business Level Applications. Select the flag for the FormsEAR application.
  12. flag procurement sample ear


    Press Start.

    start procuremet sample ear

    The window confirming the Procurement_Sample_BPELProcess_FormsEAR started successfully shows up.

    messages


b. Create a new empty process application in the IID Process Center perspective

You have several options to deploy and test a Module / BPEL process.

The last option in used in this document.

In Business Process Manager a process application represents the project to store all artifacts created later on in IPD and IID. This process application is centrally stored in the process center repository and accessible by multiple users concurrently.
In this step you create a new process application as a container for storage, deployment, and versioning of your application. Notice that during the development in IID artifacts are still stored in a workspace, but have to be retrieved, uploaded or synchronized with the process application.

  1. Switch from the Business Integration perspective to the Process Center perspective
  2. The Process Center perspective is a new perspective introduced with the IBM Business Process Manager.

    process center perspective

  3. Connect and login to the Process Center
    For the Process Center Connection Details enter http://localhost:9080/ProcessCenteror your server name and port.
    For userid enter tw_admin, for password enter tw_admin.
  4. process center connection

    The Process Center perspective opens.

  5. Create a new process application
    Press + Create New Process App.
  6. Enter the name of the process application, here Procurement Sample IOA BPEL and for the acronym IOABPEL.

    create new process app details

    Click Create.
    Process Application is created.

  7. Open in workspace
    Select the newly created process application. Click Open in workspace to open the process application in your workspace.
  8. open in workspace

    Wait for the operation to complete. The Process Application is opened in the Business Integration perspective.

    business integration perspective

    Click OK to open the selected process applications and toolkits.


  9. Familiarize yourself with the structure of the process application in detailed mode.
    Click the twisty to Switch between Simple or Advanced Mode.
  10. See the ProcessApplicationName_Implementation and ProcessApplicationName_Library folders created by default. All folders are currently empty.

    process app implementation and library

c. Associate the BPEL process with a process application within IID

In this step you move the imported module with the BPEL process to the process application.

  1. Associate application with a process application
    Associate your imported / existing application (Module) including the BPEL process with the process application.
    Right-click on Procurement_Sample_BPELProcess_Module. Press Associate with Process Center.

    associate with process center


  2. Select process application to connect with, here Procurement_Sample_IOA_BPEL.
    Flag the FormsEAR, Module as well as Web applications.
    asscociate with Procurement_Sample_Test1

    Press Next. The Confirm Changes window opens. Press Finish.

    procurement samüle module associated

    The Procurement_Sample_BPELProcess_Module became part of the process application.


d. Update the BPEL Process to use the BPD Inbound Web Service interface

In this step we modify the BPEL process so it uses the WSDL Interface of the BPD that we generated and exported in step 4.
  1. Import the Inbound Web Service Interface of the BPD

    Right-click the
    Procurement_Sample_IOA_BPEL_Library and select Import.
    Expand and select General > File System. Press Next.

    Browse to your temporary directory where you saved the IOA_Inbound_WebService.wsdl file. Ensure that you import it into the correct Library.
    Press Finish.
    Import from File System

  2. Add the Procurement Sample IOA BPEL Library to the ProcurementSample_BPELProcess_Module
    The IOA_Inbound_WebService.wsdl was added before to the Library of the Process App. Add a dependency of this Library to the Module of our BPEL process.
    Open ProcurementSample_BPELProcess Module > Dependency.
    Click Add... and Select the Procurement_Sample_IOA_BPEL_Library. Press Finish.
    Add dependency

    Press Ctrl + S to save and afterwards close the Dependency window.

  3. Update the BPEL process to use the interface of the BPD
  4. We could use a Mediation Flow Component (MFC) to specify and interface and BO map to mediate between the interface of the existing ApproveReplenishmentOrder and the BPD Inbound Web Service interfaces. However, this ApproveReplenishmentOrder activity is already extended and enhanced by its Exception Handler which we don’t want to touch.

    Change the interface of the Reference Partner for the ApproveReplenishmentOrder activity, i.e. replace by IOA_Inbound_WebServicePortType

    Under Procurement_Sample_BPELProcess_Module expand the Integration Logic > BPEL Processes folder and open the ReplenishmentBPEL process.
    Under Reference Partners select the ApproveReplenishmentOrder_IF used in the initial workspace and testing.
    Under Properties > Description you find the Name and Reference interfaces. Click Browse.

    The Interface Selection window opens.
    Select the IOA_Inbound_WebServicePortType interface of your developed BPD process. Click OK.

    interface change

  5. Create Variable Input Order
    The IOA_Inbound_WebServicePortType interface comes with a business object InternalOrder which might be different to the current Variable ReplenishOrder.
    Press Variables "+ " to add a new variable.
    The Add a Variable window opens. Enter InternalOrder for the Name and select InternalOrder from the list of Matching data types.
    Press OK.
    New Variable InternalOrder

  6. Create Map to associate the ReplenishOrder object with the InternalOrder object
    Drag an Assign node from the palette to the BPEL process, in between the CalculateForecast and ApproveReplenishmentOrder activities.
    Under Properties > Description > Name and ... Display name enter MapReplenishOrder2InternalOrder .
    Drag and specify Assign node

  7. Specify the mapping
    Under Details map all ReplenishOrder - attributes via the Assign From with Assign To to the corresponding attributes of the Internal Order.
    Mapping Details


    Press Ctrl + S to save the mapping.

  8. Re-specify input and output variables
    Due to the changes of the interface and business data shows the ApproveReplenishmentOrder Invoke activity errors.
    in the BPEL process diagram which currently indicates an error.

  9. Under Properties > Details the interface was replaced by ReplenishmentBPD.
    The Operation name is empty. Expand the drop down list and select the available option invokeIOA_BPD.
    This will take off the variables ReplenishOrder.

    operation selection inputs outputs

Select under Inputs none under Read from Variable. A selection window opens. Select InternalOrder.
Repeat this for Outputs. Select under Outputs none under Store into Variable. A selection window opens. Select InternalOrder.

Press Ctrl + S to save the BPEL process.

All errors should have gone, while the Procurement_Sample_BPELProcess_Module Assembly Diagram still has some errors. This is corrected in the next step.

6. Update the assembly diagram and test the Web Service integration

In this step we replace the current Java SCA component for the ApproveReplenishmentOrder. Instead we drop the BPD WSDL interface onto the assembly diagram. It will become a SCA Import calling the BPD and needs to be wired with the updated BPEL process.


a. Update the assembly diagram with the BPD WSDL invocation

  1. Delete existing ApproveReplenishOrder_Service
    Expand the Procurement_Sample_BPEL_Process_Module. Double-click the Assembly diagram to open it.
    Select the current ApproveReplenishOrder_Service Java implementation component.
    Confirm to Delete also the java implementation.

    Right click on the ReplenishBPEL Process component. Select Synchronize Interfaces and References ... > from Implementation.
    Syncronize from Implementation

    Press Yes to confirm the synchronisation.

  2. Select the Procurement_Sample_IOA_BPEL_Library > Interfaces > IOA_Inbound_WebServicesPortType. Drag it on the assembly diagram.
    The Component Creation window opens.
    Select Import with Web Service Bindings.
    Import with Web Service Binding
    Press Ok.

  3. Select the Port Type
    Stay with Use an existing web service port. Click Browse.
    The IOA_Inbound_WebServicePortType ... window is opened. Stay with the matching service port: IOA_Inbound_WebService.
    Press Ok.
    Select Port type

  4. Select the Transport Protocol
    Stay with SOAP1.1/HTTP . Press Finish.
    Select the Transport Protocol

    Press Ok. The Import IOA_Inbound_WebServicePortTypeImport1 is created and added to the assembly diagram.

  5. Wire the new Import
    Right-click on the ReplenishmentBPEL Process component. Select Wire to Existing . Press Ok and Finish.
    Final Assembly Diagram


    The BPEL Process and the Assembly diagram are successfully updated. The process application can now be deployed to the Process Center Server


b. Deploy the Procurement_Sample_IOA_BPEL Process App

  1. Refresh and Publish the Process App
    Right-click the [changed] Procurement Sample IOA BPEL Main Process App.
    Press Refresh and Publish it to the Process Center Repository as well as Process Center Server.
    Refresh and Publish

  2. Verify the activated Process App using the Admin Console
    Launch the WAS Admin Console via the Integration Developer or in a Browser using the following url: https://localhost:9043/ibm/console/
    Open Applications > Application Types > Business Level Applications and see that the IOABPEL Process App is install as a tip.
    Tip deployment

c. Test the Procurement_Sample_IOA_BPEL Process App calling the Internal Order Approval Application (IOAAPP)

  1. Open the BPEL BPC Explorer from the Integration Developer or in a Browser using the following url: http://localhost:9080/bpc/.
    Login with the userid = tw_admin and password = tw_admin.
    From the Navigator select Process Templates > Currently Valid Currently Valid Process Templates

    Select this ReplenishBPEL process part of the Procurement Sample IOA BPEL process app. Press Start Instance.

  2. The Process Input Message window is opened.
    Enter your own values for the Process Name, the orderID and the partNumber. Press Submit.
    Process Input Message
    The BPEL process instance is immediately completed because it only uses automatic activities and makes one asynchronous one-way call to the BPD without waiting for a reply.


  3. Open the Portal
    Open your Browser using the following url: http://localhost:9080/portal/.
    Login with the userid = tw_admin and password = tw_admin.
    The Inbox opens.
    You see a workitem related to the BPD IOA_BPD we created in chapter 1 with a task named IOA_Task.
    Flag this workitem and press Run.
    BPD Workitem

    The task opens and you see that the Process Input Message was successfully passed to the BPD process / task via the inbound web service call and UCA.
    BPD Task Coach

    Press Ok.

  4. Create a snapshot
    As we have successfully tested the integration we want to save this status in a snapshot.

    Go to your Process Center Admin in Process Designer or in the Integration Designer.
    Double-click the  Procurement_Sample_IOA_BPEL (IOABPEL) process app. Press Create Snapshot.
    Snapshot of IOA BPEL

    Enter the Snapshot Name: Procurement Sample IOA BPEL SS1 and Description: Procurement Sample Call Inbound Web Service.
    IOA BPEL SS1

    Create a snapshot for the  Internal Order Approval App (IOAAPP) process app was well named Internal Order Approval App SS2 .
    SS2 or IOAAPP

    This completed Part 1 of the sample with the Inbound Web Service call.



Part 2: Outbound Integration

In Part 2 we enhance the scenario by an outbound web service call. The BPD is invoked in a one-way operation. Therefore the response has to be accomplished by an outbound call. This message has to be received and correlated by the BPEL process that acts as the Service Requester.  The five steps to enhance  the  artifacts in the Service  Requester  and  Provider are  shown in the diagram below.

files to import


1. Update BPEL Process to receive and correlate intermediate events

a. Model Receive Choice Activity

  1. Define  an  interface  to receive the intermediate events
    Right-click  the Procurement_Sample_BPELProcess_Module > New > Interface.
    The New Interface window opens. Enter the Name IOAResponsefromBPD .
    IOAResponsefromBPD

    Press Finish.
    The BPEL process, after received the message, doesn't send a confirmation or reply to the BPD. Therefore we only need a one-way operation.
    The Interface specification window opens.
    Under Operations select a one-way operation. Specify the operation name as responsefromBPD , the Inputs Name as IOAresponse and select the Inputs Type as ReplenishOrderBO .
    Specify one-way interface and operation.


    Press Ctrl + S to save the interface specification.


  2. Model  the Receive Choice Activity IOA Reply from BPD
    Open the ReplensihmentBPEL process.
    Drag the IOAResponsefromBPD interface from the Navigator to the canvas und Interface Partners.
    Interface Partner

    Drag a Receive activity to the canvas in between the ApproveReplenishOrder and the ApprovalDecision Choice activities.
    Name this activity ReceiveIOAResponsefromBPD.
    Receive Activity inserted

    Under Details browse for and select  IOAResponsefromBPD Interface Partner. The Interface and Operation is automatically entered.
    For the Inputs > Store into Variable select the ReplenishOrder variable.
    Propterties Deatails Interface Partner

    Press Ctrl + S to save your work. The IOAResponsefromBPD Receive activity still shows the error that it does not use a correlation set.

b. Define Correlation Setting

  1. Define a Correlation Property
    In the ReplenishmentBPEL process > Correlation Properties on the right press the "+"- sign.
    The Add a Correlation Property window opens.
    For the Name enter orderID_CorrProp and for Matching data types select string .
    Correlation Property
    Press Ok.

  2. The Correlation Property orderID_CorrProp  opens.
    Select the StartReplensihment_IF > startReplenishmentOrder operation and press Add... .
    Create element for correlation information

    The Create a Property Alias window opens. Select input1 : ReplenishOrderBO.orderID : String.
    Property Alias

    Press Ok.

  3. Repeat the same for IOAResponsefromBPD reference partner interface with responsefromBPD operation. Press Add... .
    Correlaton Alias


    The Create a Property Alias window opens. Select input1 : ReplenishOrderBO.orderID : String . Press Ok.
    Correlation Information Specificcation

  4. Define a Correlation Set
    In the ReplenishmentBPEL process > Correlation Set on the right press the "+"- sign.
    The Correlation Set window opens.
    For the Name enter orderID_CorrelationSet. For the Property name select and flag the orderID_CorrProp.
    Correlation Set

  5. Initiate Correlation for the ReceiveReplenishmentOrder activity
    Select the first activity, the ReceiveRepelenishmentOrder. When this order is received and the process is instantiated we want to initiate correlation.
    Select Properties > Correlation. For the Correlation sets > Initiation select Yes .
    Initiation Yes

  6. Specify Correlation for the ReceiveIOAresponsefromBPD activity
    Select the first activity, the ReceiveIOAresponsefromOrder. When this orderID is received via the Web Service call we don't want to initiate the correlation.
    Select Properties > Correlation. For the Correlation sets > Initiation select No.
    Initiation No

    Press Ctrl + S to save the changes made to the ReplenishmentBPEL process.

2. Expose an Export WSDL Interface

Make the new Interface Partner for the new receive node available.

a. Add the Export to the assembly diagram

  1. Open  the  Assembly Diagram for the Procurement_Sample_BPELProcess_Module.
    Right-click the ReplenishmentBPEL Process SCA component. Select Add Interface ... .
    Add Interfaces

    Select the IOAResponsefromBPD Interface. Press Ok..
    Select Interface

  2. Create Export
    Drag the IOAResponsefromBPD Interface on the canvas of the assembly diagram.
    The Component Creation window opens. Select the Export with Web Service Binding. Press Ok.
    Drag Interface / Create Export

  3. Select a Transport Protocol
    The Select a Transport Protocol opens. Stay with the SOAP1.1/HTTP protocol. Press Next >.
    Select Transport Protocol

    The Specify Web Service Binding Target Namespace window opens.
    Stay with Use the port type (interface) namespace. Press Finish.

    The Export is created.

  4. Wire the Export
    Right-click the generated IOAResponsefromBPDExport1. Select Wire to Existing.
    Wire to Existing

    Press Ctrl + S to save the assembly diagram. You should not have any errors anymore.
    The final assembly diagram with the Export should look like this,
    Final Assembly Diagram

c. Create snapshot and deploy Process App

  1. Refresh and Publish
    Right-click on the [changed] Procurement Sample IOA BPEL Main process app. Press Refresh and Publish to store the process updated in the Integation Developer in the Process Center Repository.
    Refresh and Publish

    This is completed

  2. Create  snapshot
    Switch to the Process Center perspective. See the label in the upper right of the above screenshot.
    Double-click the Procurement Sample IOA BPEL (IOABPEL) process app.
    Press + Create New Snapshot .
    Create New Snapshot

    For the name enter Procurement Sample IOA BPEL SS5 and Description BPEL Process with Receive Node and Correlation .


    SS% with Receive node and Correlation

    Press Create.

  3. Activate the snapshot.
    When finished initiate Activate for the snapshot Procurement Sample IOA BPEL SS5 .
    This deployment step is finished when the Tab switched to Deactivate.

    Activated Snapshot SS5

    This deployment of the process app to the Process Center Server is completed when the status moved to Deactivate .

  4. Verify installed snapshot
    Logon to the Integrated WAS Admin Console again.
    See that IOABPEL process app is available as Tip as well as via different snapshots. Ensure that your latest snapshot is activated (started). The name of the business level application (BLA) is generated out of the acronym of the process app as well as your snapshot name. In  the screenshot below  the BLA IOABPEL-PSIOA_3 is the latest valid snapshot.
    multiple snapshots activated and deactivated

d. Select Service Interface of the Export

The IOABPEL process app exposes itself via the Exports. This Export triggers the internal Receive node to resume processing of the process instance  of the service requester with the corresponding correlation id.

  1. Determine Service Provider Interface
    Access Services > Service providers . Identify and double-click the Process App for the snapshot identified before: IOABPEL-IOAOSIOA_3.
    Service Client Interface

    The manage policy sets and bindings window opens.

  2. Open WSDL document
    Click Additional Properties > WSDL document
    Export WSDL Document

  3. SOAP Message
    Identify the soap:address location part of the wsdl:service
    SOAP Message

    Copy the url to the clipboard, here
    http://localhost:9080/IOABPEL-PSIOA_3-Procurement_Sample_BPELProcess_ModuleWeb/sca/IOAResponsefromBPDExport1

  4. Identify URL
    Paste your clipboard into the address field of your browser. Press Open.
    URL address

    Add ?wsdl to the above address. Press Enter .
    URL Address ?WSDL

    Copy the url that now is displayed in your browser's address field into the clipboard.
    http://localhost:9080/IOABPEL-PSIOA_3-Procurement_Sample_BPELProcess_ModuleWeb/sca/IOAResponsefromBPDExport1/WEB-INF/wsdl/Procurement_Sample_BPELProcess_Module_IOAResponsefromBPDExport1.wsdl


3. Create the Outbound Web Service

a. Building the sample Integration service

  1. Create an Integration Service named IOA_Outbound_IntegrationService
    Click Implementation > IOA_Outbound_IntegrationService the appropriate service type (Integration service) as described in Building services and name it Get Zip Code Data .
  2. Drag a Web Service Integration component from the palette to the service diagram and then use sequence lines to connect the component to Start and End Events as shown below.
  3. Click on the Web Service Integration component in the diagram and then click the Step option in the properties. Enter the name IOA_Outbound_WebService.
    IOA_Outbound_WebService

  4. Discover Web Service
    Click the Implementation > Discovery > WSDL URI option. Paste the content of the clipboard, the one after entering ?wsdl to the input field.
    The Operations drop-down list is populated with the services that are available.

    Note:
    To use a protected WSDL, enable the check box and then provide the user name and password required to access the WSDL.

    Click the Discover button.
    Discover Web Service

    The Discover dailog opens.Press Discover

  5. Select Operation
    Choose the operation that you want to use from the drop-down list. For this sample service the responsefromBPD(ReplenishOrderBO) operation.
    Select Operation

  6. Click the Generate Types... button.
    The Generate Types Wizard opens. Select the operation from the previous step (responsefromBPD). Click Next.
    The wizard lists the types to be generated.
    Generate Types Wizard

    In the wizard, click the Next button to continue and then click the Finish button when type generation is complete.
    This creates the ReplenishOrderBO as a Data variable.
    Data variable

  7. Specify Input and Output for the Integration Service
    Click the Variables tab for the IOA_Outbound_IntegrationService.
    Click the Add Input button and in the Name text box, type: ReplenishOrderData.
    Click the Select button next to Variable Type and choose ReplenishOrderBO from the available types. (This type was generated in the preceding step.)
    Click the Add Output button and in the Name text box, type: ReplenishOrderData.
    Click the Select button next to Variable Type and choose ReplenishOrderBO from the available types as well. (This type was generated in the preceding step.)
    Inout and Output Variable

  8. Perform data mapping for the Outbound Web Service
    Click the Data Mapping option in the properties.
    For the Input Mapping , click the variable selector icon to the right of the text box and choose the previously created ReplenishOrderData variable.
    Input Mapping

    Press Ctrl + S or Save to save your work.

b. Integrate Outbound Integration Service with BPD and Test Response Operation


  1. Open the IOA_BPD
    Drag the IOA_Outbound_IntegrationService to the canvas into the System lane.
    Drag Outbound Integration Service to canvas
  2. Reconnect the Sequence Flow  from the IOA_Task to the IOA_Outbound_IntegrationService. Draw another Sequence Flow from the IOA_Outbound_IntegrationService to the End Event

  3. Perform the Data Mapping of the Integration Service with the parent BPD
    Click into the IOA_Outbound_IntegrationService. Select Properties > Data Mapping > Input Mapping.
    For the Input Mapping , click the variable selector icon to the right of the text box and choose the IOA_Data variable to the BPD. This resolves into tw.local.IOA_Data for the input variable.
    For the Output Mapping , click the variable selector icon to the right of the text box and choose the IOA_Data variable. This resolves into tw.local.IOA_Data for the output variable.
    Data Mapping of the Integration Service with the parent BPD

    Press Ctrl + S to save the BPD.


c. Test the entire solution

Similar to Test Procurement Sample Inbound only you now extend this to verify response via the outbound call, correlation and continuation of the BPEL process.
  1. Start BPEL Process in BPEL Business Process Designer
    Logon to the BPEL Business Process Designer via http://localhost:9080/bpc/ with userid = tw_admin and password = tw_admin.
    Select Process Templates > Currently Valid and identify the BPEL process to start. Ensure that you do this for the correct Process App and Snapshot, in case you have multiple snapshots activated.
    Start Process Instance


  2. Enter the initial parameters for process instance id =Order 666, orderID = Order 666 and partNumber = PN 666.
    Process Input Message

    Press Submit.

  3. Switch to Process Instances > Started By Me. Flag the process instance with name Order 666. Press View Process State.
    View Process State

    The view shows the activities completed and the ReceiveIOAresponsefromBPD is waiting.
    ReceiveIOAresponsefromBPD is waiting

    In the Console you could see a statement about the Forecast on the orderID 666.
    Console with Forecast

  4. Perform manual task of the BPD
    Logon to Process Portal via http://localhost:9080/portal/ with userid = tw_admin and password = tw_admin.

    Portal with IOA Task


    Flag the task and press Run .
    The Coach or form is launched.

    Update the value for the partNumber to PN 666_Response, not the orderID which is used as correlationID.
    Press Ok.
    PN 666 Response

  5. Switch to the BPEL Business Process Choreographer
    The process is already gone because it is scheduled for immediate deletion of completed instances.

    See Console again an the final activities, here Order stored in ERP system with the modified part number.
    Console Store Order in ERP System

  6. Finally return to the Process Center, select the process app Internal Order Approval App, and create a further snapshot to save the final BPD with the outbound web service call.
    Final snapshot with BPD and outbound web service call.

    Note:
    You don't need to progress with Run the sample as this is not different to testing the sample in the current section.
    As an extra bonus you might execute the sample with starting an Invocation Task as well as executing the BPD IOA_Task in the federated Business Space.


    Congratulations.

    You successfully completed the sample for the inbound and outbound web service integration. ! ! !