Developing a distributed WS-AT transaction using an IBM BPM Advanced Integration Service, Part 3: Defining the business process

Leveraging the capabilities of the Advanced Integration Services (AIS) in IBM Business Process Manager V8.0.1 Advanced, this series describes the implementation of a distributed WS-AT scenario involving two databases (Microsoft® SQL Server and IBM® DB2®) installed on two different machines and accessed via two web services. The implementation illustrates the automatic rollback capabilities offered by the SCA-based management in an AIS in collaboration with the WS-AT protocol. In Part 3, you'll learn how to design and implement the business process using the BPMN notation in Process Designer.

Share:

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.



Marco Antonioni (marco_antonioni@it.ibm.com), Certified IT Architect, IBM

Marco Antonioni photoMarco Antonioni is a Certified IT Architect and Open Group Master Certified IT Architect in IBM Software Group, Italy. Marco has a deep knowledge of WebSphere platforms (WebSphere Application Server, WebSphere Process Server, IBM Business Process Manager, IBM Operational Decision Manager, IBM Business Monitor, WebSphere Service Registry and Repository, and WebSphere Message Broker). Since joining IBM in 2000, his main role has been as a BPM Solution Architect in IBM Software Services for WebSphere.



25 September 2013

Also available in Chinese

Introduction

In Part 3, we'll define a process application called KWSBPM with a KWSBPM - 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 article is a business process modeled in business process modeling notation (BPMN) in the IBM BPM Process Designer. Figure 1 shows the KWSBPM – Process1 process as mapped in Process Designer.

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

Click to see larger image

Figure 1. The BPMN business process in Process Designer

The BPMN business process in Process Designer

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

  • Input Data activity: Implemented as a user task with the human service KWSBPM - Input Data HS.
  • Make Transaction activity: Implemented as a system task with the AIS TxWSAIS.
  • 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 KWSBPM – Show Results HS human service.
  • Show Error activity: Implemented as a user task with the Show Error 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 in detail and how to implement it.

The process variables

The KWSBPM - 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 AIS. 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 the business process variables provided in the downloadable example in Part 1.

Table 1. Default values of the process variables
VariableDefault valueNotes
Connection1Charge Data Source=localhost; Uid=sa; Initial Catalog=Bank1; Pwd=mypwd Connection string used by the .NET web service on machine A to connect to the SQL Server Bank1 database. Change sa and mypwd to your real credentials.
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 (used by the JAX-WS web service on machine B to connect to the DB2 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 KWSBPM – Input Data HS human service

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

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

Click to see larger image

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

Data mapping for KWSBPM – Input Data HS human service

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

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

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

Figure 5. Variables of KWSBPM – Input Data HS human service
Variables of KWSBPM – Input Data HS human service

Figure 6 illustrates the layout of the Coach.

Figure 6. The Coach in KWSBPM – Input Data HS human service
The Coach in KWSBPM – 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 are passed to the transactional TxWSAIS AIS, as described in the next section.

Define the TxWSAIS AIS to support the Make Transaction activity

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

Figure 7. The AIS in Process Designer
The AIS in Process Designer

Click to see larger image

Figure 7. The AIS in Process Designer

The AIS 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

Click to see larger image

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 KWSBPM – Show Results HS human service

The KWSBPM – Show Results HS 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 KWSBPM – Show Results HS human service
Data mapping for KWSBPM – Show Results HS human service

Click to see larger image

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

Data mapping for KWSBPM – Show Results HS human service

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

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

Figure 12 shows the flow of the human service.

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

Click to see larger image

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

Diagram of KWSBPM – Show Results HS human service

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

Figure 13. The Coach in KWSBPM – Show Results HS human service
The Coach in KWSBPM – 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.

The Show Error Human Service

This human service shows the error condition eventually returned by the Make Transaction activity, which is 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

Click to see larger image

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 the Show Error human service
Variables for the Show Error human service

shows the diagram for Show Error human service.

Figure 16. The Show Error human service diagram
The Show Error human service diagram

This human services includes a Show Error Coach, shown in Figure 17.

Figure 17. The Coach in the Show Error human service
The Coach in the 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 3 of this series, we covered how to define and implement the business process in IBM Business Process Manager Advanced, using the IBM Process Designer 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 4, you'll learn how to implement the transactional AIS in IBM Integration Designer, based on an ESB mediation module that calls the two transactional web services.


Acknowledgements

The authors would like to thank their colleagues Giuseppe Bottura and Simone Chiucchi for their reviews of this article, and their colleagues Stefano Angrisano, Matteo Franciolli, and Daniele Rossi for their contributions. We also want to thank Andrew J. Howes, Billy Lo, Frank I. Toth, Dave Screen, Callum Jackson, Konstantin Luttenberger and Oliver Rebmann for their inspiring and thoughtful developerWorks articles.

Resources

Resources specific to the .NET platform

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=946091
ArticleTitle=Developing a distributed WS-AT transaction using an IBM BPM Advanced Integration Service, Part 3: Defining the business process
publish-date=09252013