Skip to main content

skip to main content

developerWorks  >  WebSphere | SOA and Web services | Architecture  >

Using WebSphere Business Modeler to build business integration modules in WebSphere Integration Developer

developerWorks
Document options

Document options requiring JavaScript are not displayed

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this page

Help us improve this content


Level: Intermediate

Jin Ji Wen (jinjiwen@cn.ibm.com), Staff Software Engineer, IBM
Wang Sheng Ping (cn.edu.shu.terry@gmail.com), Software Engineer, Shanghai Jiao Tong University

29 Nov 2006

Learn how to use WebSphere® Business Modeler to build better business models, which can make it easier to develop the business integration module in WebSphere Integration Developer later on.

Introduction

There are two ways to create business integration modules: The first is to create a new business integration module in WebSphere Integration Developer directly. The other way is to create a new business modeling project in WebSphere Business Modeler, and then export the business modeling files into WebSphere Integration Developer in the format supported by WebSphere Process Server. To follow the methodology of business process management and reduce the effort of developing the business integration module, we recommend the latter.

In this article, we give five examples in four parts to show how to model business processes with different basic components in the WebSphere Business Modeler. To help you learn the mapping between WebSphere Business Modeler and WebSphere Integration Developer, we provide all the sample code in the download files. The business process we'll model is an application that automates stocking a supermarket with products from a wholesaler. The supermarket gets price quotations from various wholesalers, and then decides which one to place an order with.



Back to top


Mapping business items to data types

In this section we look at how to map business items in WebSphere Business Modeler to the corresponding data types in WebSphere Integration Developer. Table 1 shows the mappings. For each element, we show how to create the initial business item in WebSphere Business Modeler, and the resulting type in WebSphere Integration developer.


Table 1. Business item to data type mappings
Elements in WebSphere Business Modeler Elements in WebSphere Integration Developer
Business itemData type
Array of business items as input/output parametersA new data type with a field to contain the array
Folder hierarchyNamespace

Mapping a single business item to a data type

First you need to define a Quotation business item, which contains three fields. In WebSphere Business Modeler, you define business item by selecting the Business items entry in the project tree. The following steps show how to define business items (also shown in Figure1).

  1. In WebSphere Business Modeler, create a new business modeling project, called FirstProject.
  2. From the menu bar, select Business items - New - Business item. In the Name of new business item field , enter Quotation.
  3. Specify three business item attributes: ProviderName, ProductName and Price. Optionally, you can specify attribute descriptions for each of these.

    Figure 1. Define Quotation business item in WebSphere Business Modeler
    Define Quotation business item in WebSphere Business Modeler

Next you export the business modeling project by selecting the current project entry in the project tree. Follow these steps to export the business modeling project:

  1. Right-click the current project FirstProject and select Export.
  2. Select WebSphere Process Server as the export type.
  3. Specify the target directory and click Finish.

Now you import the exported result file into WebSphere Integration Developer using the file system option.

  1. Create a new Module project named FirstProject.
  2. Import the file you exported from Modeler, by right-clicking FirstProject and selecting Import - File System. Select the imported directory and click Finish. This step imports the business object shown in Figure 2:

    Figure 2. Quotation business object in WebSphere Integration Developer
    Quotation business object in WebSphere Integration Developer

Mapping an array of business items to a container

The Business Item Editor makes it easy to define the attribute as an array type. For example, you could define an Employee business item that corresponds to the following Java™ definition:


Listing 1. Employee definition in Java
					
public class Employee {
    public String name;
    public String sex;
    public int Age;
    public Staff[] staff;
}

To define attributes as an array type, you just change the default value of the Maximum attribute from 1 to n, as Figure 3 shows:


Figure 3. Define a business item with array fields in WebSphere Business Modeler
Define a business item with array fields in WebSphere Business Modeler

After you have imported your business item into WebSphere Integration Developer, you will see that two data types, Employee and Staff have been created, as Figure 4 shows:


Figure 4. Business object with array field in WebSphere Integration Developer
Business object with array field in in WebSphere Integration Developer

We want to return the array as output of a method, for example Quotation[] getQuotations(){...}. WebSphere Business Modeler can generate this business item for you. Follow these steps in WebSphere Business Modeler, as Figure 5 shows:

  1. Click Task, choose the Attributetab, choose the Outputs sub-tab, and add an Output
  2. Select Quotation as Associated data, change the default value of the Maximumattribute from 1 to n. Now an array as task output is created in WebSphere Business Modeler

Figure 5. Define task output as an array type in WebSphere Business Modeler
Define task output as an array type in WebSphere Business Modeler

When you import the business items and process into WebSphere Integration Developer, you can see two data types, Quotation and ListOf1ToUnboundedQuotations, have been created, as Figure 6 shows. The ListOf1ToUnboundedQuotations business object, which is the container of the Quotation business object, is generated automatically.


Figure 6. ListOf1ToUnboundedQuotations in WebSphere Integration Developer
Figure 6. Auto-Generated DataObject ListOf1ToUnboundedQuotations in WebSphere Integration Developer

Mapping a folder hierarchy to a Namespace

WebSphere Business Modeler does not allow duplicate business item names in the same data catalog. Similarly, to avoid duplicate data type names in WebSphere Process Server, every business object has its own Namespace, which corresponds to its data catalog in WebSphere Business Modeler.

For example, in our Basic project, since Quotation is in supermarket\price, when we export it, its Namespace will be http://supermarket/price. The exported file location will be supermarket\price\price.xsd.

Follow these steps to model the Quotation business item, which is mapped automatically to the Quotation data type with Namespace http://supermarket/price.

  1. Click Project tree filters, make sure the Main catalogs and Element categories within a catalog options are checked, as Figure 7 shows:

    Figure 7. Configure project tree filters
    Configure project tree filters

  2. Choose the default Business items data catalog, and rename it to supermarket, as Figure 8 shows:

    Figure 8. Rename default Data Catalog Business items
    Rename default Data Catalog Business items

  3. Right-click supermarket and choose New - Data Catalog, as Figure 9 shows:

    Figure 9. Create new sub data catalog
    Create new sub data catalog

  4. In the Name of new data catalog field, enter price, and click the Finish button.

    Figure 10. Define the name of the new data catalog
    Define the name of the new data catalog

  5. Right-click price and choose New - Business Item, as Figure 11 shows:

    Figure 11. Create new Quotation business item
    Create new Quotation business item

  6. For the Name of new business item field, enter Quotation and click the Finish button. as Figure 12 shows:

    Figure 12. Define new business item name
    Define new business item name

  7. Refer back to Figure 1 and specify the ProviderName, ProductName and Price business item attributes. Optionally, you can specify attribute descriptions.
  8. Export the business modeling project. You can locate price.xsd and open it, as Figure 13 shows:

    Figure 13. price.xsd
    price.xsd

  9. Import the business items into WebSphere Integration Developer. Choose the Quotation business object and check the generated Namespace, as Figure 14 shows:

    Figure 14. Namespace of Quotation business object
    Namespace of Quotation business object



Back to top


Mapping process and task to process and invoke action

In this section we show you how to map process and tasks information in WebSphere Business Modeler to process and invoke action in WebSphere Integration Developer. The following table summarizes the attributes mapping rules from WebSphere Business Modeler to WebSphere Integration Developer

Elements in WebSphere Business Modeler Elements in WebSphere Integration Developer
Folder HierarchyNameSpace
Process NameProcess PortType Name
Input/Output Name of ProcessOperation Input/Output Parameter of Process PortType
Input Criteria of ProcessOperation Name of Process PortType
Local Task NameReference Partner PortType Name
Input/Output Name of Local Task Operation Input/Output Parameter of Reference Partner PortType
Input Criteria of Local Task Operation Name of Reference Partner PortType

Mappings processes to process interfaces

  1. In WebSphere Business Modeler, right-click Process, choose New - Process Catalog and in the Name of new process catalog field, enter supermarket.
  2. Right-click supermarket, choose New - Process and in the Name of new process field, enter QueryPriceProcess, as Figure 15 shows:

    Figure 15. Create the process catalog and process
    Create the process catalog and process

  3. Import the process into WebSphere Integration Developer. You see that the QueryPriceProcess interface was generated and its namespace is http://Processes/supermarket/QueryPriceProcess/QueryPriceProcessInterface, as Figure 16 shows:

    Figure 16. Process interface and namespace
    Process interface and namespace

Mapping input/output names to input/output parameters

  1. Back in WebSphere Business Modeler, double-click the QueryPriceProcess process, which open the process editor. Click the Diagram tab, and select Attributes - Inputs. In the Name field, enter productName, for the Associated Data field, choose String, and leave the default values for the other attributes, as Figure 17 shows:

    Figure 17. Process Inputs
    Process Inputs

  2. Switch to the Outputs tab. For the Name field enter quotation, for the Associated Data field choose Quotation, and leave the default values for the other attributes, as Figure 18 shows:

    Figure 18. Process outputs
    Process outputs

  3. Switch to the Input Logic tab, change the value of the Name field to be getPrice instead of Input Criterion, and leave the default values for the other attributes, as Figure 19 shows:

    Figure 19. Process input logic
    Process input logic

  4. After importing the process into WebSphere Integration Developer, you can see that the getPriceoperation was added into the QueryPriceProcess interface. The input name is productName, the input type is string, the output name is quotation, and the output type is Quotation, as Figure 20 shows:

    Figure 20. Process interface
     Process interface

Mappings tasks to operations

  1. Back in WebSphere Integration Developer, click the create local task element in the left palette and drag it onto the process editor. Click the General tab, and change the Name field to VerifyProductName instead of Task, as Figure 21 shows:

    Figure 21. Task name
    Task name

  2. Switch to the Inputs tab, for the Name field enter productName, for the Associated Data field choose String, and leave the default values for the other attributes, as Figure 22 shows:

    Figure 22. Task inputs
    Task inputs

  3. Switch to the Outputs tab, for the Name field enter validProductName , for the Associated Data field choose String, and leave the default value for the other attributes, as Figure 23 shows:

    Figure 23. Task outputs
    Task outputs

  4. Switch to the Input Logic tab, change the Name field to verifyProductName instead of Input Criterion, and leave the default values for the other attributes, as Figure 24 shows:

    Figure 24. Task input logic
    Task input logic

  5. Repeat step 1-4 to add the Aprice task, define productName as the input name and String as the input type. Define quotation as the output name, Quotation as the output type and define getQuotation as the input logic. Click Connections to connect the Input, VerifyProductName, Aprice and Output tasks, as Figure 25 shows:

    Figure 25. Basic model
    Basic model

  6. After you import the process into WebSphere Integration Developer, it generates the VerifyProductName interface. The VerifyProductName interface has a verifyProductName operation . Its input name is productName and its input type is string. Its output name is validProductNamee and its output type is string, as Figure 26 shows:

    Figure 26. VerifyProductName interface
    VerifyProductName interface

  7. The Aprice interface is also generated. It has a getQuotation operation . Its input name is productName and its input type is string. Its output name is quotation and its output type is Quotation, as Figure 27 shows:

    Figure 27. Aprice interface
    Aprice interface

  8. Double-click the QueryPriceProcessprocess, which opens the process editor. In addition to the process choreograph, it also generates the QueryPriceProcessPartner interface partner, VerifyProductNamePartner and ApricePartner reference partners, and stringVariable and QuotationVariable variables, as Figure 28 shows:

    Figure 28. Process QueryPriceProcess choreograph
    Process QueryPriceProcess choreograph



Back to top


Mapping from a multiple input/output task to a multiple operation interface

Since an interface usually has more than one operation in WebSphere Integration Developer, we need to define a task which has multiple input/outputs in WebSphere Business Modeler. To understand how to implement it, create a new model project called MultiMethod in WebSphere Business Modeler and import the download file MultiMethod_Modeler.zip into the MultiMethod project.

  1. After you import the model file, three components Decision, ProductQuotation task and Merge are put together to build the QueryPriceProcess process. The ProductQuotationtask contains two methods, which use getPrice to get the prices from different wholesalers. The input parameter of the process is productName, which decides whether to invoke getPriceA or getPriceB, as Figure 29 shows:

    Figure 29. MultiMethod model
    Figure 29. MultiMethod model

  2. In the Inputs tab, add two inputs called productA and productB, as Figure 30 shows:

    Figure 30. Define task inputs
    Define task inputs

  3. In the Outputs tab, add two outputs called QuotationA and QuotationB, as Figure 31 shows:

    Figure 31. Define task outputs
    Define task outputs

  4. Define input criteria in the Input Logic tab, as Figure 32 shows:

    Figure 32. Define task input logic
    Define task input logic

  5. Define output criteria in the Output Logic tab, as Figure 33 shows:

    Figure 33. Define task output logic
    Define task output logic

  6. Since two inputs and outputs are defined so far, we now need to define input/output for each method. Switch to the Advanced Output Logic tab and choose APrice. Make sure that associated input criteria getPriceA is checked, as Figure 34 shows:

    Figure 34. Advanced output logic for PriceA
    Advanced output logic for PriceA

  7. Choose BPrice and make sure that associated input criteria getPriceB is checked, as Figure 35 shows:

    Figure 35. Advanced output logic for PriceB
    Advanced output logic for PriceB

  8. Finally, let's define our decision logic. The Decision attribute in WebSphere Business Modeler maps to Flow with an expression in WebSphere Integration Developer. Each flow has a Java expression (which returns a Boolean value) to control whether this flow continues or not. Switch to the Output branches tab and choose the Yes output branch. Make sure that Expression field contains 'supermarket.QueryPriceProcess.Decision.Input' is equal to "ProductA", as Figure 26 shows:

    Figure 36. Out branches of the Decision attribute
    Out branches of the Decision attribute

  9. After you import the model project into WebSphere Integration Developer, you can open the process editor to see the QueryPriceProcess process choreograph, as Figure 37 shows:

    Figure 37. MultiMethod process choreograph in WebSphere Integration Developer
    MultiMethod process choreograph in WebSphere Integration Developer

  10. Double-click the ProductQuotation interface to see that two operations, getPriceA and getPriceB, have been added into the ProductQuotation PortType, as Figure 38 shows:

    Figure 38. ProductQuotation PortType
    ProductQuotation PortType

  11. Choose the branch that invokes the getPriceA operation and click the Details tab, to check that the condition is also correctly generated, as Figure 39 shows:

    Figure 39. Flow connection properties
    Flow connection properties



Back to top


Mapping from decision/merge to fork/join flow control elements

Decision/merge and fork/join both have multiple incoming branches and one outgoing branch, and are both used to recombine separate paths in a process flow. However, they are used in different modeling situations and have different functions.

Merge is normally used after an exclusive decision. It runs whenever one of its incoming branches is satisfied. As soon as an input is received at a merge, it is immediately sent out as output.

In contrast, join works well after a fork. The join runs when all of its incoming branches are satisfied. It waits to receive all inputs before sending them on, and sends all the outputs at the same time.

We already showed the decision/merge mapping in the MultiMethod project, so this part will concentrate on the fork/join mapping.

We assume that the supermarket wants to compare several quotations from different wholesalers and then decide which provider they will buy the product from. The Branch project introduces how to create the parallel task in WebSphere Business Modeler, as Figure 40 shows:


Figure 40. Parallel task
Parallel task

The left part of the choreograph is the Fork element in WebSphere Business Modeler, and the right part is the Join element. Fork splits the process flow into two or more alternative paths, enabling two or more tasks to be performed in parallel. Fork makes copies of its inputs and forwards them along each of the alternative paths.

The MakeDecision task must be performed after the APrice, BPrice and CPrice tasks have been completed, and these three tasks are performed concurrently and not sequentially. Using the Fork element enables the APrice, BPrice and CPrice tasks to be completed in parallel before the flow is recombined by the Joinelement and continues to the MakeDecision task.

Let's explore this model a bit more, and then import it into WebSphere Integration Developer:

  1. Switch to the Input branches tab of the Fork attribute, as Figure 41 shows, to see the input branch of the fork:

    Figure 41. Input branch of the fork
    Input branch of the fork

  2. Switch to the Output branches tab of the Fork attribute, as Figure 42 shows, to see the output branch of the Fork.

    Figure 42. Output branch of the fork
    Output branch of the fork

  3. Switch to the Input branches tab of the Join attribute, as Figure 43 shows, to see the input branch of the join.

    Figure 43. Input branch of join
    Input branch of join

  4. Switch to the Output branches tab of the Join attribute, as Figure 44 shows, to see the output branch of the join.

    Figure 44. Output branch of join
    Output branch of join

  5. After you imported the model project into WebSphere Integration Developer, you can open the process editor to see the Branch process choreograph. Since Join exports three quotations to the MakeDecision task, that is, the export result is an array type, WebSphere Integration Developer automatically generates a ListOf3To3Quotations data type as a container to hold the Quotation, as Figure 45 shows:

    Figure 45. Branch process choreograph in WebSphere Integration Developer
    Branch process choreograph in WebSphere Integration Developer

  6. Choose the Join snippet element, which is automatically generated to create a ListOf3To3Quotations object and pass it to the next activity, MakeDecision, as Figure 46 shows:

    Figure 46. Join snippet in WebSphere Integration Developer
    Join snippet in WebSphere Integration Developer



Back to top


Mapping implementation types

When defining a process in WebSphere Business Modeler, you can choose an implementation type for a certain task element. It provides five implementation types to map to service component types:

  • State machine
  • Rule group
  • Human task
  • Java
  • Process

In this part you'll learn how to define an implementation type for a certain element.

Before we get started on that, in WebSphere Business Modeler create a project called ImplementationType, then import the Basic.zip download file into your new project.

  1. Select the VerfiyProductName task and select Diagram - Technical attributes view - Implementation. Choose Human Task for the value of the implementation type, as Figure 47 shows:

    Figure 47. Human Task implementation type
    Human Task implementation type

  2. Select the APrice task, and select Diagram - Attributes - Resources. In the Individual Resource requirements column, add an Individual Resource requirement, and select Staff for the Individual Resource, as Figure 48 shows:

    Figure 48. Staff resource requirement
    Staff resource requirement

  3. When you import the model project into WebSphere Integration Developer, a Human Task service component called VerifyProductName is generated automatically, as Figure 49 shows:

    Figure 49. Human Task Component
    Human Task Component

  4. When you open it, you can see the detailed properties for this participating human task, as Figure 50 shows:

    Figure 50. Detailed properties for a participating human task
    Detailed properties for a participating human task

  5. Now open the process editor to see that a staff action is implemented by the Aprice human task.

    Figure 51. Staff action implemented by human task
    Staff action implemented by human task



Back to top


Summary

WebSphere Business Modeler supports the first step of the SOA application development cycle, business modeling. This article provides element mapping rules from WebSphere Business Modeler to WebSphere Integration Developer to speed up the development of business integration modules in WebSphere Integration Developer.


Back to top


Downloads

DescriptionNameSizeDownload method
FirstProject Example (Part 1)firstproject.zip62KBHTTP
Basic Example (Part 2)basic.zip59KBHTTP
MultiMethod Example (Part 3)multimethod.zip67KBHTTP
Branch Example (Part 4)Branch.zip72KBHTTP
ImplementationType Example (Part 5)ImplementationType.zip61KBHTTP
Information about download methods


Resources

Learn

Get products and technologies

Discuss


About the authors

author photo

Ji Wen Jin, PhD, is a Staff Software Engineer with the IBM Software Group, Application and Integration Middleware Software, in IBM Shanghai Globalization Lab. The fields he researches include EAI, Business Intelligence, MDA, and Java technology. He has worked on DB2 Cube Views, DB2 Alphablox,WebSphere DataStage, WebSphere Business Modeler, WebSphere Integration Developer, WebSphere Process Server and WebSphere Business Monitor.


Author picture

Sheng Ping Wang (cn.edu.shu.terry@gmail.com) is a software engineer at Shanghai University. He is currently an intern at IBM SGL/CSDL, and has experience developing with Websphere Modeler and Websphere Integration Developer.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top


This is the first trademark attribution statement. This is the second trademark attribution statement. Other company, product, or service names may be trademarks or service marks of others.