Part 2 describes how to use the most common features of WebSphere Lombardi V7.1 (hereafter called Lombardi) to model the sample process. We'll walk through the basic modeling of the business scenario process including the following features:
- Process modeling using business process definition (BPD)
- Integration service
- Human service
- Rule service
In the sample process, the buyer submits a purchase order using the web-based user interface (web UI), and then the customer relationship management (CRM) system automatically sends a notification to the supplier. The suppliers can confirm the order using a web UI with the following options: accept the order without any change, accept the order with changes, or reject the order.
In the case of accepting the order, if the supplier raises the unit price of goods, the system needs to notify the buyer to reconfirm the updated order. The buyer has the following options:
- If the buyer accepts the updated order, the system automatically generates the final purchase order.
- If the buyer does not accept the update order, the system sends a notification to the supplier and the purchase order process is halted.
If the buyer does not confirm the order, the system automatically generates the formal purchase order.
A business process is a collection of activities designed to produce a specific output for a particular objective, involving both human and system interactions. The process can include not only general integration services, activities, gateways and rule services, but may also use timer, message, and exception events.
When you model a process, you are creating a reusable business process definition (BPD). A BPD enables you to define the process workflow for end users by creating logic inside a process and integrating with other applications and data sources.
You can follow the steps below to create the sample process application from scratch, or import the ready-to-use process application provided for download with this article.
To create the sample process application, complete the following steps:
- Click the Process Apps tab, then click Create New Process
App and provide the Process App Name (for example,
Purchase Order Process), Acronym (for example,POP. The acronymn must be unique within your Lombardi environment.), and an optional Description (for example,This presents an example of a process for handling a purchase order.). - Open Designer and select Create Business Process Definition (BPD).
- Click the Process App tab and select the Purchase Order Process in the Process App list to open the process in Designer.
- In Designer, select Processes => Create New => Business Process Definition.
- Create a BPD with the name
Purchase Order Process. - Next you need to create lanes. BPDs must include a lane for each
system or group of users that participate in a process. A lane is the
container for all the activities to be performed by a specific system
or group of users.
You add lanes to your process diagram to hold the activities and events that take place during process execution. When a new BPD is created, it contains two lanes by default. Drag the right side of the lane icon in the detail panel to the existing lane to create two new lanes. You can specify an optional name and color for each lane by selecting the lane, and specifying the name and presentation color in the properties section.
In our example, there are four lanes in the main process: Buyer, Supplier, CRM and ERP.
- Now you need to create participant groups. These groups typically
represent the user groups or departments in a business organization.
In the Designer view, click the plus sign (+) next to
Processes, then select Participant Group and enter the
participant group name.
In our example, there are four participant groups: Buyer, Supplier, CRM and ERP.
- Next, you'll create activities and a decision gateway. To do this,
drag the Activity element in the right palette into one of the
appropriate lanes of the process diagram to create the activities.
Then drag the Decision Gateway element into the diagram, and
specify
Accept Order?as its name. If the status of the order is specified asAccepted by supplier, the decision gateway will go to the Need Buyer's Reconfirm? activity; otherwise, it will go to Send Reject Notification to Buyer activity. - Using the same process, create two more decision gateways:
Need Confirm? (by using the
needBuyerConfirmvariable to describe its value), and Buyer Accept? (by using the status of the order to describe its value). If the status of the order is specified asAccepted by buyer, the decision gateway will go to the Generate Order activity; otherwise, it will go to the Send Reject Notification to Supplier activity. - For each BPD that you create, you need to declare variables to capture the business data that is passed from step to step in your process. To do this, on the Variables tab, click Add private to add a private variable called Order with a type of Order, and a private variable called needReconfirm with a type of Boolean.
You have now created the sample process application. The resulting business process is shown in Figure 1.
Figure 1. Purchase order process
(See a larger version of Figure 1.)
An integration service is usually used when you want to integrate with an external system to complete a task. For example, you can build an integration service that calls a web service to perform some business logic. Integration services are the only services that can include web service integration and Java™ Integration components.
Create a web service integration
In our example, we use one Web service integration to implement the notification function that is invoked in the process. To create this service, do the following:
- Select Implementation => Integration Service and create an
integration service called
SendNotification. - In the diagram of the new SendNotification integration service, drag
Web Service Integration from the right palette and rename
it
Send Notification by Email, then use the sequence flow to link it with the start and the end of the integration service diagram. - To discover the web service, on the Implementation tab of the
property view, specify the WSDL URI of the web service and click
Discover, as shown in Figure 2.
You can get the WSDL and XSD files from the Downloads section of this article and develop your customized web services based on these WSDL and XSD files. Then you can deploy these web services on your application server,
Figure 2. Discover the web service
- Click Generate Types, then accept the default options to
generate variable types. This generates variable types as shown in
Figure 3.
Figure 3. Generated variable types provided by web service
- Select the Send Notification by Email web service integration and, in the property view, select Notify Supplier from the discovered operation list.
- On the Variable tab, click Add Input to create an input
variable. Specify the name of the variable as
inputOrderand change the Variable Type to Order. - Repeat the previous step to create an output variable called
outputResultwith a type of String. - In the Data Mapping property of the SendNotification
integration service, map the
inputOrdertoorderandoutputResulttoresult.
In our example, we use the Java integration component to integrate the external Java class in order to implement the price calculation and payment function that is invoked in the process.
- Before creating the integration service, add the JAR file that contains the classes by clicking the plus sign (+) next to Files in the library in the Designer view and select Server File. In the New File dialog, click Browse and select the payment.jar file provided in the Downloads section.
- Create an integration service, then drag a Java integration component from the palette to the service diagram and use sequence lines to connect the component to the Start and End events.
- Click the Java integration component in the diagram, then click
Definition in the properties. Click Select beside
Java Class and choose the JAR file and the class, as shown
in Figure 4.
Figure 4. Java integration
A human service is the only type of service that can contain coaches and user interaction. Build a human service when you want a step in your BPD to create an interactive task that process participants can perform in a web UI. When you build human services, you include coaches, which are the web-based forms that provide process-related data to end users, as well as collect input from those users. Coaches enable you to easily add standard fields and controls, such as radio buttons, drop-down menus, and so on.
Create a human service called Submit Purchase Order by following the steps below:
- Open the Purchase Order Process BPD, right-click the Submit Purchase Order activity and select Activity Wizard from the list of options.
- In the Set Up Activity dialog, specify Human Service (Service with human interaction) as the service type and create a new service called Submit Purchase Order, then click Next.
- In the Parameters dialog, select the existing process variable order to use as input and output for the new service, then click Finish. The new service is created and automatically attached to the activity.
- The new service includes a single coach. Click the Coaches tab, then click the listed coach component to open the Coach Designer.
- Drag the orderHead and orderDetail variables into the
coach form page, as shown in Figure 5.
Figure 5. Coach for Submit Purchase Order
In general, coaches are highly customized to render a particular look and feel in a typical Lombardi deployment. For example, you may want to customize coaches to use corporate logos and colors. In many cases, you can meet your customization requirements by configuring the presentation and visibility properties available in the Designer interface. In Part 3 of this series, you'll learn about the advanced features of coaches.
Use a rule service when you want a condition to determine the execution path or make variable assignments based on potential values of other variables. For example, when a certain condition evaluates to true, the JavaScript expression that you provide as the action is executed. The action of a rule service cannot directly invoke Java or web service integrations. You can call a rule service from any other type of service, and a rule service can call other nested services.
In our scenario, if the supplier changes the quantity or price of goods, the rule service will validate the order change following the business rules below:
- If the added quantity rate is less than or equal to 10%, and the updated price is not higher than the original price, then the buyer need not reconfirm.
- If the added quantity rate is less than or equal to10%, but the updated price is higher than the original price, then the buyer needs to reconfirm.
- Otherwise, if the added quantity rate is greater than 10%, then the buyer also needs to reconfirm.
Because there are multiple order items within one order, the rule service must be executed repeatedly. To accomplish this, select the Need Buyer's Reconfirm? activity, and click Step in the properties. Then select the Simple Loop option from the Loop Type drop-down list under Behavior. Then under Simple Looping, specify the length of the order items as the loop maximum value as shown in Figure 6.
Figure 6. Simple loop
Create the rule service called Need Buyer's Reconfirm? by completing the following steps:
- Open the Purchase Order Process BPD, right-click the Need Buyer's Reconfirm? activity and select Activity Wizard.
- In the Set Up dialog of the Activity Wizard, specify Rule Service
(Rule based service without human interaction) as the service
type and create a new service called
NeedReconfirm?, then click Next. - In the Parameters dialog, specify the existing process variable
needReconfirmas output for this new service, then click Finish. The new rule service is created and automatically attached to the activity. - Create an input variable with the name of
orderDetailand a variable type ofOrderDetail. Then create two private variables calledupdatedQuantityPercentandupdatedUnitPricePercentusing the same decimal type. - Add one service script activity before the rule script activity, and implement this activity using the JavaScript expression as shown in Listing 1.
Listing 1. Initialization for rule service
if(tw.local.orderDetail.quantity == 0 ){
tw.local.updatedQuantityPercent = 1;
}else{
tw.local.updatedQuantityPercent = (tw.local.orderDetail.updatedQuantity -
tw.local.orderDetail.quantity)*1.00/tw.local.orderDetail.quantity;
}
if(tw.local.orderDetail.unitPrice == 0 ){
tw.local.updatedUnitPricePercent = 1;
}else{
tw.local.updatedUnitPricePercent = (tw.local.orderDetail.updatedUnitPrice -
tw.local.orderDetail.unitPrice)*1.00/tw.local.orderDetail.unitPrice;
}
|
- Double-click the rule script to open it for editing. Click the
Rule tab, and click the Add a variable (column) to the
rule icon (the green plus sign in the upper left) to add the
variables
updatedQuantityPercentandupdatedUnitPricePercent. - Specify the value for each cell according to the business rule
described in the previous section. The result should look like Figure
7.
Figure 7. Rule script
- Finally, you need to specify the input mapping between the Need
Buyer's Reconfirm? activity and the rule service. In this
example, the value for the input is:
tw.local.order.orderDetail[tw.system.step.counter].
The Lombardi Authoring Environment Inspector is key to an iterative approach to process development. Using the Inspector, developers can run processes and services on the Process Center server or remote runtime process servers. An entire development team can use Inspector to run and test the process.
To run a process and then manage running and completed instances of that process in the Inspector, do the following:
- Open the Purchase Order Process and click the Run Process icon in the upper right. When prompted whether you want to change to the Inspector interface, click Yes.
- In the Process Instances tab, you can see all currently active and completed process instances. To control instances, select an instance from the list and then click the toolbar option that you want. For example, to stop an instance that you started earlier, click the instance, then click the icon to terminate the instance.
- Click the new or received task, then click the Run task icon
in the upper right, as shown in Figure 8. In some cases, you may need
to select a user account and password in order to run a task. This is
controlled by lane assignments and routing for activities.
Figure 8. Run the Submit Purchase Order task
- Select Task:Submit Purchase Order and click Runs the selected task. In the purchase order BPD, the coach for the Submit Purchase Order task opens in a browser as shown in Figure 9.
- Fill in the fields and click OK button. The BPD continues to
the next step. The Inspector shows the progress by moving the token to
the next step in both the BPD diagram and the tree view.
Figure 9. Submit Purchase Order coach user interface
This article showed you how to use some of the common features of WebSphere Lombardi Edition V7.1 to model a business process. These common features included BPD, integration services, human services, and rule services. In Part 3, you'll learn how to use the advanced features of WebSphere Lombardi Edition V7.1 to enrich the sample process to address more complex requirements and user interaction.
| Description | Name | Size | Download method |
|---|---|---|---|
| Purchase Order Process file | PurchaseOrderProcess_v6.zip | 416KB | HTTP |
| WSDLs | WSDLs.zip | 3KB | HTTP |
| Payment JAR file | payment.jar | 2KB | HTTP |
Information about download methods
- IBM
WebSphere Lombardi Edition 7.1.0 Information Center: Get complete
production documentation.
- WebSphere Lombardi edition: Get product information, including
features and benefits, how to buy, training, support, services, and
more.
-
developerWorks BPM zone: Get the latest technical resources on
IBM BPM solutions, including downloads, demos, articles, tutorials,
events, webcasts, and more.
-
IBM BPM
Journal: Get the latest articles and columns on BPM solutions in
this quarterly journal, also available in both Kindle and PDF versions.






