Developing a transactional Advanced Integration Service with IBM Business Process Manager, Part 2: Defining the business process

Leveraging the capabilities of the Advanced Integration Services (AIS) in IBM® Business Process Manager V8 Advanced, this series describes how to implement a distributed ACID transactional scenario in IBM Business Process Manager that includes two databases on different machines. The scenario shows the automatic rollback capabilities offered by the SCA-based management in an AIS. Part 2 of the series describes how the business process is designed and implemented using the BPMN notation in Process Designer.

Carlo Randone (carlo_randone@it.ibm.com), Certified IT Architect , IBM

Carlo Randone photoCarlo Randone is a Certified IBM IT Architect and Open Group Master Certified IT Architect in IBM Global Business Services, Italy. Carlo has a deep knowledge of different development platforms and middleware on heterogeneous environments and operating systems. He worked for several years as a Certified Trainer and Solution Developer for a Microsoft® Certified Partner.

Since joining IBM in 2000, Carlo's main job interests are related to SOA and BPM, and their related software engineering methodologies and enabling platforms, and Enterprise Architecture planning and design. He enjoys collecting documentation and hardware pieces related to the historical development of IT, and to support this hobby he is a member of the Charles Babbage Institute.



13 March 2013

Define the BPMN process in IBM Process Designer

In Part 2, we'll define a process application called KBPM with a KBPM – Process1 business process definition (BPD). The complete process application, KBPM.twx, is provided for download in Part 1 of this series.

The high-level part of the solution proposed in this series is a business process modeled in business process modeling notation (BPMN) in the IBM BPM Process Designer. Figure 1 shows the KBPM – Process1 process as mapped in Process Designer.

Figure 1. The BPMN business process in Process Designer
The BPMN business process in Process Designer

The activities in the KBPM – Process1 process are as follows:

  • Input Data activity: Implemented as a user task with the human service KBPM - Input Data HS
  • Make Transaction activity: Implemented as a system task with the Advanced Integration Service (AIS) TxAIS
  • Error intermediate event My Error Event, attached to the Make Transaction activity: Catches the Make Transaction AIS errors, and can drive the execution flow to the Show Error activity (with a related human service and presentation Coach)
  • Show Results activity: Implemented as a user task with the KBPM – Show Results HS human service
  • Show Error activity: Implemented as a user task with the Show Error Human Service human service
  • Another Transaction gateway: Enables the loop to execute another transaction (based on an ExitCondition flag that the user can set in the Show Result or Show Error activities)

This article describes the process.

The process variables

The KBPM - Process1 BPD defines a set of variables to manage the configuration of the transaction and the transfer of values from the different activities involved in the process (which are implemented by three human services and an Advanced Integration Service). Figure 2 shows the variables defined at the process level.

Figure 2. The business process variables
The business process variables

Table 1 shows the default values for the business process variables provided in the downloadable example.

Table 1. Default values for the process variables
Variable Default value Note
Connection1Charge jdbc/bank1sqlserver jdbc connection name to the Bank1 database
Table1Charge dbo.Accounts Table of the account to charge (on Bank1)
Account1Charge Karl Name of the account to charge (on Bank1)
Amount 10 Amount to transfer
Connection2Credit jdbc/bank2db2 JDBC connection name to the Bank2 database
Table2Credit ADMINISTRATOR.Accounts Table of the account to credit (on Bank2)
Account2Credit Donald Name of the account to credit (on Bank2)
ExitCondition To manage the option to make another new transaction
OutputMessage Positive outcome message string
ErrorMessage Error message string

The KBPM – Input Data HS human service

The Input Data activity is implemented with the KBPM – Input Data HS human service. Figure 3 shows the I/O data mapping.

Figure 3. Data mapping for KBPM – Input Data HS human service
Data mapping for KBPM – Input Data HS human service

Figure 4 shows the diagram of this human service. There is only one Coach (KBPM – Input Data HS – Coach1), as shown.

Figure 4. Diagram of KBPM – Input Data HS human service
Diagram of KBPM – Input Data HS human service

Figure 5 shows the variables defined and used for this human service.

Figure 5. Variables for KBPM – Input Data HS human service
Variables for KBPM – Input Data HS human service

Figure 6 illustrates the layout of the Coach.

Figure 6. The Coach in KBPM – Input Data HS human service
The Coach in KBPM – Input Data HS human service

The only purpose of this human service, and its related Coach, is to harvest the required values for the parameters necessary to drive the transaction. The values of these parameters will be passed to the transactional TxAIS AIS, as described in the next section.


Define the TxAIS Advanced Integration Service to support the Make Transaction activity

This TxAIS component is core part of our solution. From the point of view of the Process Designer, it's only another service to invoke, and is described by its interface. Figure 7 shows the AIS configuration screen in Process Designer.

Figure 7. The Advanced Integration Service in Process Designer
The Advanced Integration Service in Process Designer

As you can see, the parameters provided to the AIS correspond well with the process variables described earlier, and define the required configuration for the transaction to be performed, including source connection, table and account, amount, and destination connection, table and account.

The values for these parameters are configured in the Data Mapping properties of the Make Transaction activity, as shown in Figure 8.

Figure 8. Data mapping for the transactional activity
Data mapping for the transactional activity

In case of error, the error intermediate event attached to the Make Transaction activity catches the exception. It's configured to receive the error message contained on the ErrorMessage parameter of the AIS, as shown in Figure 9.

Figure 9. The implementation of the error event
The implementation of the error event

As you can see, the error string is also copied in the process variable ErrorMessage.

The KBPM – Show Results HS human service

This human service shows the positive outcome of the transaction executed by the Make Transaction activity. Figure 10 shows the data mapping for the Show Results activity implemented by this human service.

Figure 10. Data mapping for KBPM – Show Results HS human service
Data mapping for KBPM – Show Results HS human service

Figure 11 shows the variables for the KBPM - Show Results HS human service.

Figure 11. Variables for KBPM – Show Results HS human service
Variables for KBPM – Show Results HS human service

Figure 12 shows the flow of the human service.

Figure 12. Diagram of KBPM – Show Results HS human service
Diagram of KBPM – Show Results HS human service

There is only one Coach in this human service, called KBPM – Show Results HS – Coach1, as shown in Figure 13.

Figure 13. The coach in KBPM – Show Results HS human service
The coach in KBPM – Show Results HS human service

The Output Text controls are bound with the input variables, and the two buttons enable the user to terminate the process or to restart with a new transaction with new parameters values.

The two server scripts EvaluateExitConditionToTrue and EvaluateExitConditionToFalse are designed only to set the ExitCondition boolean value to true or to false respectively.

The Show Error Human Service

This human service shows the error condition eventually returned by the Make Transaction activity (the activity that uses the transactional AIS implementation).

Figure 14 shows the data mapping for the Show Error activity implemented by the Show Error Human Service.

Figure 14. Data mapping for Show Error activity
Data mapping for Show Error activity

Figure 15 shows the variables for the Show Error Human Service.

Figure 15. Variables for Show Error Human Service
Variables for Show Error Human Service

Figure 16 shows the diagram for Show Error Human Service.

Figure 16. The Show Error Human Service diagram
The Show Error Human Service diagram

In this human service there is a Show Error Coach, shown in Figure 17.

Figure 17. The Coach in Show Error Human Service
The Coach in Show Error Human Service

The txtErrorMessage Output Text control is bound to the ErrorMessage variable, and passed as input to the Show Error Human Services.


Conclusion

In Part 2 of this series, we covered how to define and implement the business process in IBM Business Process Manager Advanced, using the Process Designed tool and the BPMN notation. You've learned how to create the Business Process Definition, the human services, the coaches, and how to define the process variables to support the configuration and the management of the outcomes from the transactional service. In Part 3, you'll learn how to implement the transactional AIS in Integration Designer, based on an SCA BPEL microflow with a couple of Java-based SCA components.


Acknowledgements

The author would like to thank his colleagues Stefano Angrisano, Marco Antonioni, Giuseppe Bottura, Matteo Franciolli and Daniele Rossi, and his good friends Claudio Cantoni and Alberto Venditti (author, about eight years ago, of a similar demo on a different technological platform) for their reviews and contributions to this article.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=861287
ArticleTitle=Developing a transactional Advanced Integration Service with IBM Business Process Manager, Part 2: Defining the business process
publish-date=03132013