IIB9000 BPM Integration Pattern

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

IBM Integration Bus

BPM Integration Pattern

June, 2013

Hands-on lab built at product


code level version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

1.

INTRODUCTION .................................................................................................... 3

1.1

The problem .....................................................................................................................................................3

1.2

Solution .............................................................................................................................................................3

2.

LAB OBJECTIVES ................................................................................................ 5

3.

IBM BPM BUSINESS PROCESS .......................................................................... 7

4.

IBM INTEGRATION BUS WEB SERVICE AND .NET INTEGRATION ............... 20

5.

COMPLETE THE INTEGRATION IN IBM BPM................................................... 37

6.

TESTING THE APPLICATION ............................................................................ 43

Page 2

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

1. Introduction
IBM Business Process Manager (BPM) provides enterprise level business process design and
modeling, and IBM Integration Bus provides enterprise strength connectivity and integration.
This pattern is used when an IBM BPM user has defined an interface in a BPM integration service
and that interface must be implemented by using an IBM Integration Bus service.

1.1 The problem


When a business analyst develops a business process design (BPD) by using IBM BPM they may require
some business data that is available from a corporate service. The owner of the corporate service can tell
the business analyst what information must be supplied to retrieve the required business data.
The business analyst knows how to define the input and output business objects required for the BPD but
does not know how to configure the connectivity to the corporate service. For example, the corporate
service might use a specific transport type, might supply more data than is required, or might require
security or adherence to a specific quality of service.

1.2 Solution
You can use this pattern to generate a new IBM Integration Bus service that can be called by IBM
Business Process Manager.

The BPM and IBM Integration Bus developers work together to integrate IBM BPM integration service
with an IBM Integration Bus service, by completing the following steps:
Page 3

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

First, the BPM developer must complete the following tasks:


1. Using a BPM toolkit, create or identify the BPM integration service that needs to call the IBM
Integration Bus service.
2. Create a BPM export (.twx file) that contains one or more integration services with input and
output variables defined.
Next, the IBM Integration Bus developer must complete the following tasks:
1. Generate a new pattern instance by selecting the required BPM integration service from the .twx
file.
The generated IBM Integration Bus service contains a service interface (WSDL file) that has an
operation with inputs and outputs that correspond to the BPM integration service definition.
2. Develop the IBM Integration Bus service, deploy the service to an integration node (broker), and
verify that the service works correctly.
3. Export the service as a new .twx file.
The new .twx file contains details of the new service in the form of an implementation of a BPM
Web Service integration that includes the service URL and appropriate business object mapping.
Finally, the BPM developer must complete the following tasks:
1. Using the BPM toolkit that was used to create the BPM integration service, import the new .twx
file.
The BPM integration service is updated with the details of the IBM Integration Bus service. The
BPM integration service can now call the IBM Integration Bus service.

Page 4

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

2. Lab Objectives
In this lab you will investigate the new BPM Integration Pattern in IBM Integration Bus V9.0. You will
explore the pattern parameters and the new capabilities to integrate IBM BPM business process with IBM
Integration Service Bus Web Service. You will be able to see all the Integration Bus applications,
generated as a result of creating a new instance of the pattern.
In addition, this lab exercise will demonstrate the ease of integrating a .NET application in an Integration
Bus V9.0 message flow. The .NET support was first introduced in Message Broker V8.0 and this lab
demonstrates a sample of a complete solution BPM -> Integration Bus Web Service -> .NET
application.
This sample scenario demonstrates Get Account Balance User case. The account number is provided
through a Browser GUI:

The return values are displayed on a similar screen:

The account information is requested from IBM BPM to IBM Integration Bus, which invokes a .NET
application, and returned to IBM BPM. The communication uses Web service.
This lab will use two separate VMware images:

Page 5

IBM Integration Bus V9.0 Image - used also for the rest of the lab exercises on IBM Integration
Bus V9.0 workshop;
IBM BPM Image used for this lab exercise with installed IBM BPM V8.0
BPM Integration Pattern
Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

The supplied images have all the necessary installations already completed.
Please make sure that both images have been started.
Note: This lab is using a shared folder BPM_Workshop which resides on the main host. Please create
the folder on your machine and allow both images to access it. This is necessary for transferring the .twx
files between the images.

Page 6

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

3. IBM BPM Business Process


The starting point of this lab is to first take a look at IBM BPM Business process that we will be integrating
1.

Focus the IBM BPM Image by selecting the IBM BPM 8.0 tab in VMware Workstation:

Then click the small box as shown above in order to expand the image to full screen

2.

Start the BPM server (if not already started), by double click on the SERVERS icon and
then Start PC Server:

Please note that it may take a few minutes for the BPM server to start.

Page 7

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

3.

Start the IBM Process Designer (if not already started), by double click on TOOLS and
then double click on the icon as shown below:

4.

On the log-in screen, use the credentials:


User name: admin
Password: admin

Click Login.
Page 8

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

5.

The previous step opens the Process Center console where we can see all Process
Applications (Process Apps) on our BPM Server.
For this lab, we will be working with IBM Bank Services (IBS) process application (marked
with an yellow star). Click on Open in designer as shown below:

6.

You will see the IBM Process Designer and the Overview page for our Process application.
Click on Processes and you will see the Business process definition.

Double click on Bank Interaction.

Page 9

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

7.

June 2013

You will now see the simple Business Process that we will be using in our scenario:

Click on the tab Variables.


8.

Page 10

You will see the private variables defined for this process:

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

9.

June 2013

When finished reviewing, click on Diagram tab and then double click on Account and
Requests Information:

10. You can now review the sub process:

Click on Variables tab.

Page 11

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

11. Note that the output from this sub process is the account number that we enter in the User
interface screen:

Click on Coaches tab.


12. Here you can review the Coach (User Interface screen) that has been created for this step
of the process (You may have to click on Account details a icon on the left):

When finished reviewing, close the sub process by click on x as shown above.
If you wish, you can view the output sub process Account Balance and Transfers by
repeating step 9 12.

Page 12

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

13. When finished reviewing we can now add the integration sub process to the main Business
Process.
In the main process screen, hover over Implementation and click on the little + sign and
then click on Integration service:

14. Name the Integration service IIB Integration:

Click Finish.

Page 13

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

15. In the new view, click on variables

16. Here we will have to add the necessary input and outputs for the Web Service:

Click Add input.


17. In Details, name the input accountNumber as shown below:

Page 14

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

18. As above, add the two outputs that the Web service will return (use Add Output):
accountBalance
lastUpdated
When done, your Variables view should look as below:

Use Ctrl-S to save these changes.


You can now close the Integration service view, by click on x.
19. We will now create a new BPM toolkit which includes our integration service.
Back in the main process view, click on Implementation -> IIB Integration (right-click) -> Copy
item to -> New Toolkit:

Page 15

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

20. Name the toolkit IIB Web Service Toolkit and enter a unique acronym as shown:

Click OK.
21. We will now go to the Process Center. Click on the Process Center icon:

22. In the process center click on the Toolkits icon to view the available toolkits. You will see
that the toolkit that we have just created is listed on top:

Make a single click on the name of the toolkit (Do not click on Open in Designer):

Page 16

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

23. You will see that there are no Snapshots created for the toolkit and we need to create one in
order to be able to export it to IBM Integration Bus. Click on Create New Snapshot:

24. In the opened window we will name the snapshot IIB Web Service Toolkit V1.0 and will give
a brief description:

Click Create.

Page 17

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

25. Once the new snapshot has been created, we can export it as a .twx file, which we will use
to create the Web Service in IBM Integration Bus V9.0.

Click on Export next to the new snapshot.


26. Select the IBM BPM (.twx) file type:

Click Export.
27. In the File Download window, select Save

Page 18

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

28. The VMware images have been set up to use shared folder on the host machine. This is
where we will export out .twx file. Navigate to Shared Folders -> BPM_Workshop.

We will keep the file name as suggested and will save it.
We are ready now to create the Web service in IBM Integration Bus V9.0, using the exported
.twx file.

Please switch to the second VMware image.

Page 19

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

4. IBM Integration Bus Web Service and .NET Integration


In this section of the lab, you will view and deploy BPM Integration pattern instance using the .twx file
created in IBM BPM. This will create the Web Service and we will explore the generated applications. In
addition, we will add the .NET integration which will invoke a .NET application.

1.

Bring the IBM Integration Bus image to focus from VMware Workstation as shown below:

Expand the view to full screen.


2.
Start the Toolkit by using the Quickstart icon

At the workspace prompt, specify your own name for the workspace in the directory
c:\workspaces.

When the workspace has opened, close the Welcome pane to reveal the Integration Bus
Toolkit.

Page 20

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

3.

In the Integration Development View click on Patterns Explorer.

4.

In the Pattern explorer view, select on BPM Mediation pattern and review the description
about the pattern:

When finished reading about the pattern, click on Create new Instance.

Page 21

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

5.

June 2013

In the next prompt, name the Pattern instance name BPM_Integration:

Click OK.
6.

Review the Pattern parameters required for generating an instance.


You will see that there are two mandatory parameters that we have to define:

Click on Browse within the BPM field as shown above.

Page 22

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

7.

In the open window select again Browse:

8.

Locate the shared folder from the Host, BMP_Workshop. You will see that the .twx file you
saved earlier:

Select the file and click Open.

Page 23

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

9.

June 2013

IBM Integration Bus V9.0 Toolkit discovers the artefacts from the imported .twx file. Select
IIB Integration:

Click Finish.
10. In the Configure Pattern Parameters window select Integration Bus Service:

Click Browse as shown above.

Page 24

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

11. We will create a new service, so in the next window name the new service as Get_Balance:

Click Finish.
12. You are ready now to generate the pattern Instance:

Click Generate.

Page 25

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

13. Once the generation process has completed, you will see the generated resources in the
Application Development view. Expand Get_Balance service as shown:

IBM Integration Bus has generated the schemas, WSDL definition, the subflows and the
Service description.
Please double click on any of these to view and explore.
When finished reviewing, double-click on IIBIntegration.
14. This will open the Web Service Message Flow:

Click on Get_Balance

Page 26

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

15. In the new palette, click on Interface:

You will see that the Operations and their parameters for the service have been generated.
The parameters are those that were defined.
16. Go back to the Message Flow view, by a click on Service and then click on IIBIntegration:

Page 27

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

17. We will now implement the .NET integration.


In windows explorer, navigate to C:\Student\BPM\Resources\
You will see a file BankingApplication.dll. Drag and drop the file directly onto the Integration
Bus Toolkit as shown below:

18. IBM Integration Bus reads the .NET assembly class methods and ask you to selct the ones
you would like to invoke in the application. Tick GetBalance:

Click OK.

Page 28

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

19. An ESQL Compute node will be placed now in your service flow. Connect the nodes as
shown below. For the Compute node use output Out.

Double click on the Compute node.


20. You will see the ESQL code generated in the node. You will also see the Get Balance
procedure created as we selected GetBalance class method from the .NET application:

Page 29

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

21. You will have to insert a few ESQL code lines in order to declare the used variables and call
the GetBalance procedure. Navigate to c:\Student\BPM\ESQL folder and open the file
GetBalance_ESQL.txt

These are the additional lines of code that you need to add to the generated code in the
ESQL Compute node. Alternatively the complete code is in the file
Get_Balance_ESQL_full.txt.
22. Once finished your ESQL compute node should have the code as shown below:

Save with Ctrl-S and close the ESQL Compute node.


Save again the flow with Ctrl-S.

Page 30

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

23. You can now close the service Message Flow:

24. In the Integration Nodes field (bottom left) start IB9NODE, if not already started. Right click
on the node and select Start:

Page 31

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

25. We are now ready to deploy the service we created to the Integration Node. Drag the service
and drop it on over the default Integration Server as shown below:

26. Once the service has been deployed, we can view that in the Default Integration Server:

27. Click on the service in the Integration Server to view its properties:

You can see the service URLs and the location of the BAR file that has been generated.
Please, make a note of the IP address in the Service Query URL line.

Page 32

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

28. You will now export the newly created service into a BPM .twx file:
In Application Development window, right-click on Integration service Description. Click on
Export.

Page 33

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

29. In the opened dialog, expand Integration Bus IBM Business Process Manager Integration
and select Business Process Manager Export (.TWX). Click Next.

Page 34

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

30. In the next window select Get_Balance.


To avoid any host name conflicts (when this lab is run in a classroom environment using
multiple copies of the VMware image) you will use the host IP address. In the field
Integration node host name enter the IP address that you recorded earlier in step 27.

Click Next.
31. On the following screen, you need to provide Snapshot name Lets keep it as the original
files name, changing only the version number IIB Web Service Toolkit V2.0

Please note that export location is again the shared folder that resides on the host machine.
Click Finish.

Page 35

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

32. Switch back to the BPM VMware image.

Page 36

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

5. Complete the integration in IBM BPM


You will now complete the integration process, using the new .twx file
1.

In the BPM VMware image, you should have the Process Center open. Click on the Toolkits
tab:

Click on Import Toolkit.


2.

Click Browse to select file to import:

3.

Navigate to the shared folder BPM_Workshop and make sure you select V2.0 of the files,
which was updated in IBM Integration Bus

Click Open and then Ok on the Import Toolkit window.


Page 37

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

4.

Click Import on the confirmation window:

5.

IBM BPM recognizes this as a newer version (snapshot) of the IIB Web Service Toolkit and
you can view it by a click on the its name:

This will open the view for available snapshots of the toolkit:

Page 38

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

6.

Open our Business Process by clicking on Process Apps, then Open in Designer for IBM
Bank Services (IBS):

7.

Once in IBM Process designer, hover over Toolkits and click on the + sign. Scroll down in
the Add dependency window to view the IIB_Web_Service_Toolkit_V2.0 toolkit:

Click on the toolkit.


This will add it as a dependency for our Business Process.

Page 39

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

8.

Single click on the added toolkit, then click on Implementation. You will see our integration
service IIB Integration. Drag and drop it directly onto our Business Process, as into the
System lane as shown below:

9.

Double click on IIB Integration service:

Page 40

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

10. Once opened, you will see the implementation Call Integration Service on Integration Bus

Click on Implementation tab on the left.


11. You will see the properties for the web service the WSDL URI and the Operation as
defined in IBM Integration Bus.
Note that in WSDL URL field you should see the IP address instead of the host name.

Click on Data Mapping.


12. The inputs and outputs have been automatically mapped:

When finish exploring, close IIB Integration.

Page 41

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

13. You will now connect the sub processes as follows:


Click on Sequence Flow icon;
Make the connections as shown below;
Press Esc button when finished connecting;

Make a single click on IIB Integration.


14. When the properties open, click on Data Mapping. The inputs and outputs have to be
mapped.

Click on the little buttons with arrows to complete the mapping automatically.

Page 42

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

June 2013

15. Your properties view should look like the screen shot below:

Save the process with Ctrl-S.

6. Testing the application


You can now test the application using BPM Inspector
1.

Page 43

In the Process designer view, click the little Play button:

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

2.

June 2013

This will open the Inspector view. Select the Received row. The diagram view points to
which part of the process you are currently Account and requests Information:

Click the Play button.


3.

In the next window, select User as admin:

Click OK.

Page 44

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

4.

June 2013

The User screen opens in the Browser

Here you are required to input an account number put any random number.
Press Get balance

Page 45

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

5.

June 2013

You are returned to the Inspector view. Click the Refresh button in the top right corner:

The process now is at the IIB Integration system sub process, which will make the call via
our Web Service to IBM Integration Bus and invoke the .NET application. It may take a
couple of seconds, so refresh again, until you see the red pointer over the last sub process
Account balance and Transfers.
Please note that depending on how quickly you press the refresh button, will depend if you
will see the pointer over the System sub process. More likely is that you will see the pointer
over the last sub process, because the System sub process is automatic and it does not
expect any input from you.
Note: It is possible that the firewall on the VMware image with Integration Bus will
block the first Web Service call from BPM. Please check the image if there is a pop up
window and click OK to allow it. You may need to re-start the BPM test from step 1.

Page 46

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

6.

June 2013

Once the process is completed, you will see the pointer over the Account Balance and
Transfers:

Click on Received. As shown above and the Play button to view the returned result from
IBM Integration Bus.
7.

Use the admin user role:

Click OK.

Page 47

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

IBM Integration Bus V9.0 Workshop

8.

June 2013

In the browser you will view the returned information (the .NET application generates a
random Balance amount so you will see different number than that on the screen capture
below:

This concludes the lab.

Page 48

BPM Integration Pattern


Provided by IBM BetaWorks

Version 9.0.0.0

You might also like