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 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
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
|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
|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
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
Figure 5 shows the variables defined and used for this human service.
Figure 5. 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 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
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
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
As you can see, the error string is also copied in the process variable
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
Figure 11 shows the variables for the KWSBPM - Show Results HS human service.
Figure 11. 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
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 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
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
Figure 15 shows the variables for the Show Error human service.
Figure 15. Variables for the Show Error human service
shows the diagram for Show Error human service.
Figure 16. 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
txtErrorMessage output Text control is bound to the
ErrorMessage variable, and passed as input to the Show Error
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.
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.
- Developing a transactional Advanced Integration Service with IBM Business Process Manager (4-part developerWorks series)
- The benefits of using IBM Business Process Manager Advanced – SOA, process integration, tools, and more (developerWorks article)
- Exploring WebSphere Process Server transactionality (developerWorks article)
- Configuring error handling for Advanced Integration Services in IBM Business Process Manager Advanced V8 (developerWorks article)
- Linking business processes and enterprise services together using IBM Business Process Manager Advanced (developerWorks BPM Journal article)
- WebSphere Application Server V7: Accessing Databases from WebSphere (IBM Redpaper)
- WebSphere Application Server V8: Administration and Configuration Guide (IBM Redbook)
- IBM BPM V8.0.1 Information Center
- Transactions in WebSphere Process Server (IBM webcast replay)
- Advanced Integration Service - Call a BPEL process from a BPD (Advanced Hiring Sample) (BPM Sample Exchange; requires an IBM BPM Community account)
- Building transactional Web services with WebSphere Application Server and Microsoft .NET using WS-AtomicTransaction (developerWorks article)
- Microsoft .NET WCF interoperability with a WebSphere ESB service gateway using WS-Atomic transactions (developerWorks article)
- Ensuring transactional integrity using Web Services Atomic Transaction support in WebSphere ESB and WebSphere Application Server (developerWorks article)
- Making web services enterprise-ready - Using the WS-Atomic Transaction protocol and WebSphere Application Server (developerWorks WebSphere Developer Technical Journal article)
- Web Services Atomic transaction (WS-AT) on IBM WebSphere Application Server 8.5 (WebSphere Application Server V8.5 Information Center)
- Tour Web Services Atomic Transaction operations (developerWorks article)
- developerWorks BPM zone: Get the latest technical resources for 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.
- Microsoft SQL Server 2008 R2 – Understanding XA Transactions (Microsoft MSDN Library)
- Configuring WS-Atomic Transaction Support in Windows 7 64-bit (Blog entry)
- C#.Net How To: Create a WCF Web Service in Visual Studio 2010 – Create a WCF WebService in C#.Net (Blog entry)
- Configuring WS-Atomic Transaction Support (Microsoft MSDN Library)
Dig deeper into Business process management on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.