 | 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.
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 item | Data type | | Array of business items as input/output parameters | A new data type with a field to contain the array | | Folder hierarchy | Namespace |
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).
- In WebSphere Business Modeler, create a new business modeling project, called
FirstProject.
- From the menu bar, select Business items - New - Business item. In the Name of new business item field , enter
Quotation.
- 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
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:
- Right-click the current project FirstProject and select Export.
- Select WebSphere Process Server as the export type.
- Specify the target directory and click Finish.
Now you import the exported result file into WebSphere Integration Developer using the file system option.
- Create a new Module project named
FirstProject.
- 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
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
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
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:
- Click Task, choose the Attributetab, choose the Outputs sub-tab, and add an Output
- 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
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
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.
- 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
-
Choose the default Business items data catalog, and rename it to
supermarket, as Figure 8 shows:
Figure 8. Rename default Data Catalog Business items
-
Right-click supermarket and choose New - Data Catalog, as Figure 9 shows:
Figure 9. Create new sub data catalog
-
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
-
Right-click price and choose New - Business Item, as Figure 11 shows:
Figure 11. Create new Quotation business item
- 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
-
Refer back to Figure 1 and specify the
ProviderName, ProductName and Price business item attributes. Optionally, you can specify attribute descriptions.
-
Export the business modeling project. You can locate
price.xsd and open it, as Figure 13 shows:
Figure 13. price.xsd
- 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
 |
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 Hierarchy | NameSpace | | Process Name | Process PortType Name | | Input/Output Name of Process | Operation Input/Output Parameter of Process PortType | | Input Criteria of Process | Operation Name of Process PortType | | Local Task Name | Reference 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
- In WebSphere Business Modeler, right-click Process, choose New - Process Catalog and in the Name of new process catalog field, enter
supermarket.
- 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
- 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
Mapping input/output names to input/output parameters
- 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
- 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
- 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
- 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
Mappings tasks to operations
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
 |
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.
- 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
- In the Inputs tab, add two inputs called
productA and productB, as Figure 30 shows:
Figure 30. Define task inputs
- In the Outputs tab, add two outputs called
QuotationA and QuotationB, as Figure 31 shows:
Figure 31. Define task outputs
- Define input criteria in the Input Logic tab, as Figure 32 shows:
Figure 32. Define task input logic
- Define output criteria in the Output Logic tab, as Figure 33 shows:
Figure 33. Define task output logic
-
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
-
Choose BPrice and make sure that associated input criteria getPriceB is checked, as Figure 35 shows:
Figure 35. Advanced output logic for PriceB
-
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
-
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
-
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
-
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
 |
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
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:
-
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
-
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
-
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
-
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
-
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
-
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
 |
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.
-
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
-
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
-
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
- 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
-
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
 |
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.
Downloads | Description | Name | Size | Download method |
|---|
| FirstProject Example (Part 1) | firstproject.zip | 62KB | HTTP |
|---|
| Basic Example (Part 2) | basic.zip | 59KB | HTTP |
|---|
| MultiMethod Example (Part 3) | multimethod.zip | 67KB | HTTP |
|---|
| Branch Example (Part 4) | Branch.zip | 72KB | HTTP |
|---|
| ImplementationType Example (Part 5) | ImplementationType.zip | 61KB | HTTP |
|---|
Resources Learn
Get products and technologies
Discuss
About the authors  | 
|  | 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. |
 | 
|  | 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
|  |