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 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
ExitConditionflag 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
Table 1 shows the default values for the business process variables provided in the downloadable example.
Table 1. Default values for the process variables
|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
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
Figure 5 shows the variables defined and used for this human service.
Figure 5. 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 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
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
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 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
Figure 11 shows the variables for the KBPM - Show Results HS human service.
Figure 11. 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
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 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 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
Figure 15 shows the variables for the Show Error Human Service.
Figure 15. Variables for Show Error Human Service
Figure 16 shows the diagram for Show Error Human Service.
Figure 16. 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
txtErrorMessage Output Text control is bound
ErrorMessage variable, and passed as
input to the Show Error Human Services.
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.
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.
- The benefits of using IBM Business Process Manager Advanced – SOA, process integration, tools, and more, developerWorks, 2012
- Exploring WebSphere Process Server transactionality, developerWorks, 2009
- BPEL fault handling in WebSphere Integration Developer and WebSphere Process Server, developerWorks, 2007
- Configuring error handling for Advanced Integration Services in IBM Business Process Manager Advanced V8, developerworks, 2012
- Linking business processes and enterprise services together using IBM Business Process Manager Advanced, developerWorks, 2012
- WebSphere Application Server V7: Accessing Databases from WebSphere, IBM Redpaper
- WebSphere Application Server V8: Administration and Configuration Guide, IBM Redbook
- IBM BPM V8 Information Center
- IBM BPM V8.0.1 Information Center
- IBM webcast replay: Transactions in WebSphere Process Server
- Sample Exchange: Advanced Integration Service - Call a BPEL process from a BPD (Advanced Hiring Sample) (requires an IBM BPM Community account)
- Microsoft SQL Server 2008 R2 – Understanding XA Transactions
- Service Runtime Exception handling in the IBM WebSphere Process Server V7 Information Center
- Application design considerations for exceptions and faults in the IBM WebSphere Process Server V7 Information Center
- IBM WebSphere Process Server Best Practices in Error Prevention Strategies and Solution Recovery, IBM Redpaper
- 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.