end-to-end bpel business activity monitoring with ibm soa...

46
End-to-end BPEL business activity monitoring with IBM SOA tools: Part 2: Developing the BPEL workflow application in WebSphere Integration Developer Bhargav Perepa WebSphere Integration Technology Specialist, SWG Federal Technical Sales IBM Washington D.C. Area Carol A. Serna Software Engineer, Content Editor, developerWorks WebSphere Santa Teresa Lab IBM San Jose, CA October 3, 2007 © Copyright International Business Machines Corporation 2007. All rights reserved. The second article in this series uses IBM WebSphere Integration Developer to import the business process model that you developed in the previous article using WebSphere Business Modeler. In this article, you refine, compose, and assemble a fully functional BPEL business process workflow application that is capable of being deployed onto an IT infrastructure such as WebSphere Process Server. You will learn how to seamlessly integrate various WebSphere SOA business activity monitoring solution authoring tools such as WebSphere Business Modeler and WebSphere Integration Developer to bridge gaps between business and IT domains. With minimal development effort, you will learn how to unit test a fully implemented BPEL business process workflow application using the WebSphere Process Server runtime embedded into WebSphere Integration Developer. Introduction This article uses IBM® WebSphere® Integration Developer to further develop the integrated BPEL workflow application that you created in part 1 of this series. In this article, you will: Compose, extend, refine, and augment the business process model project in WebSphere Integration Developer to complete a fully functional BPEL workflow integrated application. Unit test the application in the workbench runtime environment as well as operational runtime infrastructure.

Upload: others

Post on 28-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

End-to-end BPEL business activity monitoring with IBM SOA tools: Part 2: Developing the BPEL workflow application in WebSphere Integration Developer Bhargav Perepa WebSphere Integration Technology Specialist, SWG Federal Technical Sales IBM Washington D.C. Area Carol A. Serna Software Engineer, Content Editor, developerWorks WebSphere Santa Teresa Lab IBM San Jose, CA October 3, 2007 © Copyright International Business Machines Corporation 2007. All rights reserved. The second article in this series uses IBM WebSphere Integration Developer to import the business process model that you developed in the previous article using WebSphere Business Modeler. In this article, you refine, compose, and assemble a fully functional BPEL business process workflow application that is capable of being deployed onto an IT infrastructure such as WebSphere Process Server. You will learn how to seamlessly integrate various WebSphere SOA business activity monitoring solution authoring tools such as WebSphere Business Modeler and WebSphere Integration Developer to bridge gaps between business and IT domains. With minimal development effort, you will learn how to unit test a fully implemented BPEL business process workflow application using the WebSphere Process Server runtime embedded into WebSphere Integration Developer.

Introduction This article uses IBM® WebSphere® Integration Developer to further develop the integrated BPEL workflow application that you created in part 1 of this series. In this article, you will:

• Compose, extend, refine, and augment the business process model project in WebSphere Integration Developer to complete a fully functional BPEL workflow integrated application.

• Unit test the application in the workbench runtime environment as well as

operational runtime infrastructure.

Page 2: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Future articles in this series describe how to add the monitor measures model to the BPEL workflow application and unit test the BPEL application along with the monitor measures model. You will also learn how to deploy the fully monitorable integrated application (base BPEL workflow application, plus the monitor measures model application that you will build to monitor the base BPEL workflow application) into WebSphere Business Monitor Server V6.0.2. This article should be of interest to developers, customers, consultants and field sales professionals.

Customer Rewards Process scenario As stated previously in the first article of this series, one way to understand the comprehensive capabilities of the IBM WebSphere V6.0.2 SOA stack is to use WebSphere tools to develop an end-to-end application that implements a BPEL business activity monitoring (BAM) workflow. You will then want to unit test the application in embedded unit testing environments, deploy the application runtime artifacts on to WebSphere servers, and configure the dashboards to monitor the performance of business process model execution. To achieve this goal, you developed a brand new Customer Rewards business process model from the ground up using the Modeler tool in the first article of this series. In this article, you’ll compose, assemble, and implement a Rewards Handling BPEL process to deliver the capability of the “Customer Rewards” process model. You will use the exported Modeler project as your WebSphere Integration Developer starting point project to realize the BPEL workflow integrated application that handles requests from three classes of customers: platinum, gold, and silver. The composed and fully integrated application should appear as shown in Figure. 1. You will unit test and operationally deploy the completed BPEL application in Process Server runtime environment that is embedded in WebSphere Integration Developer tool. Figure 1. RewardsHandling BPEL process application overview

Page 3: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Compose an integrated BPEL workflow application This article guides you through the following steps to help you compose and realize a fully functional RewardsHandling BPEL workflow application:

1) Import the business modeling project 2) Map input and output parameter variables for tasks 3) Verify business objects imported 4) Verify interfaces imported 5) Implement human task component logic 6) Implement link traversal and snippet component logic 7) Implement Java™ component logic 8) Enable application and task event monitoring 9) Unit test application in workbench embedded runtime 10) Unit test application in operational runtime

Import the business modeling project Let’s begin our BPEL workflow application by importing the business modeling project. This step becomes the foundation for business to IT handoff and becomes a basis for bridging the gap between business and IT stakeholders. Since we are using the business modeling project to start our IT implementation, we have a clear contract between business and IT domain professionals, there is less chance for miscommunication

Page 4: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

between business and IT domain stakeholders and there is improved traceability and accountability. You can start by importing the business modeling project: 1. Launch WebSphere Integration Developer. 2. Open the Business Integration perspective by clicking Window => Open

Perspective => Other => Business Integration (default) => OK. 3. Open the Physical Resources view by clicking Window => Show View => Other

=> Business Integration => Physical Resources => OK (Figure 2).

Figure 2. WebSphere Integration Developer Business Integration Perspective

4. Enable WebSphere Integration Developer tool capabilities by clicking Window => Preferences => Workbench => Capabilities. Check each capabilities checkbox (Figure 3). Figure 3. WebSphere Integration Developer Workbench Capabilities Specification

Page 5: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

5. Right-click in the Project Tree pane and select Import => Project Interchange => Browse => 6-17-2007-MODWID-CustomerRewards.zip => Select All => Finish (Figure 4). Figure 4. WebSphere Integration Developer Import Project Interchange Project

Page 6: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

6. Confirm that the Problems pane reports 38 errors as shown in Figure 5: Figure 5. WebSphere Integration Developer Problems View

Page 7: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

7. Open the RewardsHandling process by double clicking on 6-17-2007-MODWID-CustomerRewards => Business Logic => Processes => RewardsHandling entry. Click OK on Information dialog (Figure 6).

Figure 6. WebSphere Integration Developer Process Editor View

8. Reconfirm that the Process Editor reports errors as shown in Figure 7:

Figure 7. WebSphere Integration Developer Process Editor View

Page 8: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

In summary, we have enabled the WebSphere Integration Developer tool for BPEL and integration developer role development capabilities, imported the process model project developed in WebSphere Business Modeler into WebSphere Integration Developer as a project interchange format file and are getting ready to specify the required project details in the integration tool. Depending on the specific version of WebSphere Integration developer tool with appropriate patch levels, you may or may not see the above errors that require the following manual mapping steps.

Map the input and output parameter variables for tasks

In order to resolve the above errors, we need to map input and output parameter variables to various tasks showing errors in the process editor. Let’s use the following steps:

1. Select receive task that has an error indicator. Select the

Properties View and then select the Details tab . Notice that input has no variable mapped. This is the cause of error. We need to map a variable for input.

Figure 8. WebSphere Integration Developer Properties View

Page 9: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

2. Open Project Tree => 6-17-2007-MODWID-CustomerRewards => Interfaces =>

RewardsHandling interface by double-clicking on it. Notice that handleRewards operation takes an input of type Request (Figure 9).

Figure 9. WebSphere Integration Developer Interface Editor

3. Perform input variable mapping by clicking on of . Select Select Variable for Input => RequestVariable => OK (Figure 10).

Figure 10. WebSphere Integration Developer Variable Mapping Dialog

Page 10: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

4. Verify that input variable has been mapped for selected receive task. Click CTRL+S

to save. Notice that error indicator disappears for the task . Also notice that error count has decreased in Problems View.

.

Figure 10. WebSphere Integration Developer Properties View

Page 11: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

5. Repeat the above mapping steps for the tasks that show an error in the Process Editor. The following table summarizes the mappings to be performed:

Table 1. Input/Output Parameter Variable Mappings for Process Tasks Task Name Operation Input(s) Output(s) Acknowledge Customer Request AckCustReq RequestVariable RequestVariable Service Platinum Customer Request servicePlatinum RequestVariable RequestVariable Service Gold Customer Request serviceGold RequestVariable RequestVariable Gold Customer Request Processing goldCustProcess ResponseVariable ResponseVariable Service Silver Customer Request serviceSilver RequestVariable RequestVariable Silver Customer Request Processing silverCustProcess ResponseVariable ResponseVariable Risk Assessment By Specialist riskAssess RiskAssessmentReportVariable

RiskEvalCriteria RiskEvalOverride

Notify And Complete Service Fullfilment

notifyNcomplete ResponseVariable ResponseVariable

Rewards HandlingReply handleRewards N/A ResponseVariable 6. Save the work by pressing CTRL+S. Create a new String variable by name

RiskEvalOverride by selecting Add Variable button 7. Verify that Problems View shows no errors . 8. Rename variable from stringVariable to RequestStatus. To perform this step,

select Variables => stringVariable => Description => RequestStatus. 9. Rename “Case” label to “Platinum Customer” for Platinum leg of BPEL flow logic.

To perform this step, select task Case => Properties => Description => Platinum Customer. Select Platinum Customer => Properties => Details. Modify the Java snippet code to reflect (Figure 11 and Figure 12).

return (RequestVariable.getString("Level"). compareToIgnoreCase

("PLATINUM") == 0);

Figure 11. WebSphere integration Developer BPEL Process Editor

Figure 12. WebSphere integration Developer Java Snippet Editor

Page 12: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

10. Rename “Case” label to “Gold Customer” for Gold leg of BPEL flow logic. Repeat the step 8 (Figure 13 and 14).

Figure 13. WebSphere integration Developer BPEL Process Editor

Figure 14. WebSphere Integration Developer Java Snippet Editor

11. Rename “Case” label to “Silver Customer” for Silver leg of BPEL flow logic. Repeat

the step 8 (Figure 15 & 16).

Figure 15. WebSphere Integration Developer BPEL Process Editor

Figure 16. WebSphere Integration Developer Java Snippet Editor

Page 13: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

12. Rename “Case” label to “Accept” for Accept leg of BPEL flow logic (Figure 17).

Modify the Java snippet code to reflect (Figure 18).

Figure 17. WebSphere Integration Developer BPEL Process Editor

Figure 18. WebSphere Integration Developer Java Snippet Editor

13. Rename “Case” label to “Reject” for Reject leg of BPEL flow logic (Figure 19).

Modify the Java snippet code to reflect (Figure 20).

Figure 19. WebSphere Integration Developer BPEL Process Editor

Figure 20. WebSphere Integration Developer Java Snippet Editor

14. Verify the assembly diagram components.

Page 14: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

You want to verify the assembly diagram components that came from our modeler project. In the previous article, you specified Java implementations for various business process model tasks in the Modeler project on technical attributes view’s implementation tab. We specified human task implementation for one of our business process model tasks in our Modeler project on the technical attributes view implementation tab. The following table summarizes the modeler artifact transformations into WebSphere Integration Developer assembly and implementation.

Table 2. Assembly Diagram Components Task Name Modeler

Implementation WebSphere Integration Developer Assembly Implementation

Assembly Component

Acknowledge Customer Request Java Java Service Platinum Customer Request Java Java Service Gold Customer Request Java Java Gold Customer Request Processing Java Java Service Silver Customer Request Java Java Silver Customer Request Processing Java Java Risk Assessment By Specialist Human Task Human Task Notify And Complete Service Fulfillment

Java Java

Verify the imported business objects You need to verify the business objects that came from the Modeler project’s business items. The following series of diagrams show the Modeler business items and their corresponding WebSphere Integration Developer business objects for Request (Figure 21 and 22), Response (Figure 23 and 24) and RiskAssessmentReport (Figure 25 and 26) business objects respectively.

Figure 21. WebSphere Business Modeler Request Business Item

Page 15: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 22. WebSphere Integration Developer Request Business Object

Figure 23. WebSphere Business Modeler Response Business Item

Page 16: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 24. WebSphere Integration Developer Response Business Object

Page 17: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 25. WebSphere Business Modeler Risk Assessment Report Business Item

Figure 26. WebSphere Integration Developer RiskAssessmentReport Business Object

Page 18: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Verify the imported interfaces Let’s verify the interfaces that came from our Modeler project. We have an interface definition for each of local tasks defined in our business process model. Additionally, we have an interface definition for our BPEL workflow application. The following table summarizes the interface definitions that get created from our Modeler project:

Table 3. Interface definitions Modeler task name WebSphere Integration Developer interface N/A RewardsHandling Acknowledge Customer Request AcknowledgeCustomerRequest Service Platinum Customer Request ServicePlatinumCustomerRequest Service Gold Customer Request ServiceGoldCustomerRequest Service Silver Customer Request ServiceSilverCustomerRequest Gold Customer Request Processing GoldCustomerRequestProcessing Silver Customer Request Processing SilverCustomerRequestProcessing Risk Assessment By Specialist RiskAssessmentBySpecialist Notify And Complete Service Fulfillment NotifyAndCompleteServiceFulfillment

Implement the human task component logic Now you are ready to minimally implement the human task component logic. You need to do away with the Potential instance creator role that enables a staff member to create an instance of a human task. You also need to include all the staff members into the

Page 19: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Potential owner role, so that everyone can claim, work on, and finish the tasks requiring human attention. We want to define the Business Process Choreographer explorer as a client user interface so that the staff members can interact with human task activities. This user interface features JSF/HTML-based Web technologies and comes out-of-box from a product that requires minimal programming. This user interface is customizable and extensible, however. To perform the above tasks, follow the steps outlined below: 15. Open Project Tree => 6-17-2007-MODWID-CustomerRewards => Business

Logic => Human Tasks => RiskAssessmentBySpecialistHTM. 16. Select Receiver settings => Potential Instance Creator. Click the delete icon . 17. Select Receiver settings => Potential Owner. Select Properties => Staff Group >

Staff Group (Verb) => Everybody (Figure 27).

18. Select Client settings. Click on this icon to create Business Process Choreographer Explorer client user interface for staff interactions (Figure 28).

19. Press CTRL+S to save. Figure 27. WebSphere Integration Developer Receiver Staff Role Verb Definition

Page 20: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 28. WebSphere Integration Developer Client User Interface Definition

Page 21: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Implement link traversal and the snippet component logic We are now ready to implement link traversal and the snippet logic with minimal Java code. To perform the above tasks, follow these steps: 20. Click on the BPEL process diagram’s link

Req_to_AcknowledgeCustomerRequestReq as shown in Figure 29. Select Properties => Details => Expression language: Java => Expression Type: Java. Enter the snippet logic shown in Figure 30.

Figure 29. WebSphere Integration Developer BPEL Process Editor

Figure 30. WebSphere Integration Developer Java Snippet Editor

Page 22: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

21. Click on the BPEL process diagram’s Generate Platinum Customer Response Java

snippet task as shown in Figure 31. Select Properties => Details. Enter the snippet logic shown in Figure 32.

Figure 31. WebSphere Integration Developer BPEL Process Editor

Figure 32. WebSphere Integration Developer Java Snippet Editor

22. Click on the BPEL process diagram’s Prepare Gold Response Generation Java

snippet task as shown in Figure 33. Select Properties => Details. Enter the snippet logic shown in Figure 34.

Figure 33. WebSphere Integration Developer BPEL Process Editor

Figure 34. WebSphere Integration Developer Java Snippet Editor

Page 23: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

23. Click on the BPEL process diagram’s Generate Gold Customer Response Java

snippet task as shown in Figure 35. Select Properties => Details. Enter the snippet logic shown in Figure 36.

Figure 35. WebSphere Integration Developer BPEL Process Editor

Figure 36. WebSphere Integration Developer Java Snippet Editor

24. Click on the BPEL process diagram’s Prepare Silver Response Generation Java

snippet task as shown in Figure 37. Select Properties => Details. Enter the snippet logic shown in Figure 38.

Figure 37. WebSphere Integration Developer BPEL Process Editor

Figure 38. WebSphere Integration Developer Java Snippet Editor

25. Click on the BPEL process diagram’s Prepare Silver Customer Additional

Processing Java snippet task as shown in Figure 39. Select Properties => Details. Enter the snippet logic shown in Figure 40.

Figure 39. WebSphere Integration Developer BPEL Process Editor

Page 24: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 40. WebSphere Integration Developer Java Snippet Editor

26. Click on the BPEL process diagram’s Generate Silver Customer Accept Response

Java snippet task as shown in Figure 41. Select Properties => Details. Enter the snippet logic shown in Figure 42.

Figure 41. WebSphere Integration Developer BPEL Process Editor

Figure 42. WebSphere Integration Developer Java Snippet Editor

27. Click on the BPEL process diagram’s Generate Silver Customer Reject Response

Java snippet task as shown in Figure 43. Select Properties => Details. Enter snippet logic shown in Figure 44.

Figure 43. WebSphere Integration Developer BPEL Process Editor

Figure 44. WebSphere Integration Developer Java Snippet Editor

Page 25: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

28. Click on the BPEL process diagram’s link RespCritToRewardsHandling_RespCrt

as shown in Figure 45. Select Properties => Details => Expression language: Java => Expression Type: Java. Enter the snippet logic shown in Figure 46.

Figure 45. WebSphere Integration Developer BPEL Process Editor

Figure 46. WebSphere Integration Developer Java Snippet Editor

29. Press CTRL+S to save. 30. Switch to the Problems View. You should see six errors as shown in Figure 47. To

resolve these, click anywhere on the RewardsHandling process canvas that is open in the Process Editor. Select Properties => Java Imports. Enter the import statement as shown in Figure 48.

31. Select Project Tree => Physical Resources => 6-17-2007-MODWID-CustomerRewards => processes => rewardshandling => Import… => File system => Next => Browse…. Navigate to the file location and select file RewardHandlingUtil.java. Select Finish.

Figure 47. WebSphere Integration Developer Problems View

Page 26: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 48. WebSphere Integration Developer Properties View

32. Press CTRL+S to save. There should not be any errors at this time. In summary, we have mapped input and output variables to various BPEL tasks (in case they are not already mapped when imported into tool, verified that business objects and interfaces are imported, implemented human task component, link traversal, and snippet component logic statements and imported the source file that has the logic provided.

Implement the Java component logic We are now ready to implement bare bone Java logic. Table 4 summarizes the methods you will implement, the source files in which methods live, and the actual Java method logic listings. WebSphere Integration Developer tool generates the wrapper code with placeholder comment //TODO Needs to be implemented for the method names and Java source files shown in the table. You only need to implement logic for the listed methods while benefiting from rest of tool generated wrapper code.

Table 4. Java Method Implementations Source File Name Method Name AcknowledgeCustomerRequestImpl AckCustReq(DataObject) ServicePlatinumCustomerRequestImpl servicePlatinum(DataObject) ServiceGoldCustomerRequestImpl serviceGold(DataObject) ServiceSilverCustomerRequestImpl serviceSilver(DataObject) GoldCustomerRequestProcessingImpl goldCustProcess(DataObject) SilverCustomerRequestProcessingImpl silverCustProcess(DataObject) NotifyAndCompleteServiceFulfillmentImpl notifyNcomplete(DataObject)

Page 27: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

The logic in the following listings simply prints out the parameter values into the output console. You can perform whatever business logic you need to perform in these listed methods, in reality. Listing 1. AcknowledgeCustomerRequestImpl.java code public DataObject AckCustReq(DataObject Input) { System.out.print("\n[AckCustReq]:\n"); return new RewardHandlingUtil().traceRequest(Input); } Listing 2. ServicePlatinumCustomerRequestImpl.java code public DataObject servicePlatinum(DataObject Input) { System.out.print("\n[servicePlatinum]:\n"); return new RewardHandlingUtil().traceRequest(Input); } Listing 3. ServiceGoldCustomerRequestImpl.java code public DataObject serviceGold(DataObject Input) { System.out.print("\n[serviceGold]:\n"); return new RewardHandlingUtil().traceRequest(Input); } Listing 4. ServiceSilverCustomerRequestImpl.java code public DataObject serviceSilver(DataObject Input) { System.out.print("\n[serviceSilver]:\n"); return new RewardHandlingUtil().traceRequest(Input); } Listing 5. GoldCustomerRequestProcessingImpl.java code public DataObject goldCustProcess(DataObject Input) { System.out.print("\n[goldCustProcess]:\n"); int timeToProcess = new RewardHandlingUtil().generateCustomerProcessTime("GOLD"); new RewardHandlingUtil().serviceCustomerRequest(timeToProcess); Input.setString("ProcessTime",new Integer(timeToProcess).toString()); return Input;

Page 28: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

} Listing 6. SilverCustomerRequestProcessingImpl.java code public DataObject silverCustProcess(DataObject Input) { System.out.print("\n[silverCustProcess]:\n"); int timeToProcess = new RewardHandlingUtil().generateCustomerProcessTime("SILVER"); new RewardHandlingUtil().serviceCustomerRequest(timeToProcess); Input.setString("ProcessTime",new Integer(timeToProcess).toString()); return Input; } Listing 7. NotifyAndCompleteServiceFulfilmentImpl.java code public DataObject notifyNcomplete(DataObject Input) { System.out.print("\n[notifyNcomplete]:\n"); return new RewardHandlingUtil().traceResponse(Input); } Having implemented the business logic of tracing and logging as shown above, we are now ready to enable event monitoring using the hooks provided by the tooling.

Enable the application and task event monitoring You need to enable Common Event Infrastructure (CEI) event monitoring across process and various process tasks to facilitate the WebSphere infrastructure (Bhargav, I don’t understand this part…gather events of our interest). You also need to enable Full monitoring of various events to gather information about all attributes of a business object when the event of interest occurs. To perform event monitoring, follow the steps outlined below: 33. Click anywhere on the RewardsHandling BPEL process diagram. Select Properties

=> Event Monitor. Select the All radio button for Monitor column. Select Full for Event Content column. Click CTRL+S to save. See Figure 49.

Figure 49. WebSphere Integration Developer Properties View

Page 29: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

34. Click task Rewards HandlingReceive. Select Properties => Event Monitor. Select

the All radio button for Monitor column. Select Full for Event Content column. Click CTRL+S to save. See Figure 50.

Figure 50. WebSphere Integration Developer Properties View

35. Perform the event monitoring enablement for each task listed in Table 5.

Table 5. Task event monitoring to be enabled Task Name Event Content Acknowledge Customer Request Full Determine Customer Status Full Service Platinum Customer Request Full Generate Platinum Customer Response Full Service Gold Customer Request Full Prepare Gold Response Generation Full Gold Customer Request Processing Full Generate Gold Customer Response Full Service Silver Customer Request Full Prepare Silver Response Generation Full Silver Customer Request Processing Full Prepare Silver Customer Additional Processing

Full

Risk Assessment By Specialist Full Acceptable Risk? Full Generate Silver Customer Accept Response Full Generate Silver Customer Reject Response Full Notify And Complete Service Fulfillment Full Rewards HandlingReply Full

Page 30: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Unit test application in the workbench embedded runtime We are now ready to test the fully functional and fully implemented BPEL workflow application. Let us now deploy the application into the workbench embedded WebSphere Process Server runtime and use the Business Process Choreographer (BPC) Explorer interface to test the application. To perform the above task, follow the steps outlined below: 1. Select Servers View => WebSphere Process Server v6.0 => right-click => Add

and remove projects… => 6-17-2007-MODWID-CustomerRewardsApp => Add > => Finish (Figure 51).

Figure 51. WebSphere Integration Developer Servers View

2. Verify from the console output that the application starts successfully (Figure 52). Figure 52. WebSphere Integration Developer Console View

3. Launch Business Process Choreographer Explorer. Select Servers View =>

WebSphere Process Server v6.0 => right-click => Launch => Business Process Choreographer Explorer (Figure 53).

Figure 53. WebSphere Integration Developer BPC Explorer

Page 31: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

4. Unit test the application. Select Business Process Choreographer Explorer => My

Process Templates => RewardsHandling => Operations => handleRewards. Enter the input values shown (Figure 54).

Figure 54. WebSphere Integration Developer BPC Explorer

5. Click the Submit button. Verify the Console View (Figure 55). Verify the output

(Figure 56).

Page 32: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 55. WebSphere Integration Developer Console View

Figure 56. WebSphere Integration Developer Console Output [7/29/07 14:05:47:312 EDT] 00000080 SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [7/29/07 14:05:49:578 EDT] 0000008d SystemOut O [AckCustReq]: [ Id=1, Name=Platinum Customer, Level=Platinum, Business Volume=1200, City=Leesburg, State=VA, Country, Remarks=Platinum Customer Test ] [servicePlatinum]: [ Id=1, Name=Platinum Customer, Level=Platinum, Business Volume=1200, City=Leesburg, State=VA, Country, Remarks=Platinum Customer Test ] [Generate Platinum Customer Response]: [mapRespFromReq]: [ Id=1, Name=Platinum Customer, Level=Platinum, Business Volume=1200, City=Leesburg, State=VA, Country, Remarks=Platinum Customer Test ] [notifyNcomplete]: [ Id=1, Name=Platinum Customer, Level=Platinum, BusinessVolume=1200, City=Leesburg, Country=USA, Remarks=Platinum Customer Test, ProcessTime=0 ] [7/29/07 14:05:50:297 EDT] 0000008d SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

6. Specify the following inputs (Figure 57) and click Submit. Verify the following

output (Figure 58). Figure 57. WebSphere Integration Developer BPC Explorer

Page 33: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Figure 58. WebSphere Integration Developer Console Output [7/29/07 14:15:06:500 EDT] 00000080 SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [7/29/07 14:15:06:781 EDT] 00000097 SystemOut O [AckCustReq]: [ Id=2, Name=Gold Customer, Level=Gold, Business Volume=800, City=Austin, State=TX, Country, Remarks=Gold Customer Test ] [serviceGold]: [ Id=2, Name=Gold Customer, Level=Gold, Business Volume=800, City=Austin, State=TX, Country, Remarks=Gold Customer Test ] [Prepare Gold Response Generation]: [mapRespFromReq]: [ Id=2, Name=Gold Customer, Level=Gold, Business Volume=800, City=Austin, State=TX, Country, Remarks=Gold Customer Test ] [goldCustProcess]: [Generate Gold Customer Response]: [ Id=2 , Name=Gold Customer , Level=Gold , Business Volume=800 , City=Austin , StateTX , CountryUSA , Remarks=Gold Customer Test , ProcessTime=1000 ] [7/29/07 14:15:08:594 EDT] 00000097 SystemOut O

Page 34: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

[notifyNcomplete]: [ Id=2, Name=Gold Customer, Level=Gold, BusinessVolume=800, City=Austin, Country=USA, Remarks=Gold Customer Test, ProcessTime=1000 ] [7/29/07 14:15:08:672 EDT] 00000097 SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

7. Specify the following inputs (Figure 59) and click Submit. Figure 59. WebSphere Integration Developer BPC Explorer

8. Select BPC Explorer => My Tasks => Check RiskAssessmentBySpecialistHTM

=> Work on (Figure 60). Figure 60. WebSphere Integration Developer BPC Explorer

Page 35: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

9. Enter Output => and use Accept for the Output entry field value. Click Complete

(see Figure 61). Figure 61. WebSphere Integration Developer BPC Explorer

10. Verify the following output (Figure 62). Figure 62. WebSphere Integration Developer Console Output [7/29/07 14:17:34:562 EDT] 00000069 SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [7/29/07 14:17:35:047 EDT] 00000097 SystemOut O [AckCustReq]:

Page 36: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

[ Id=3, Name=Silver Customer Accept, Level=Silver, Business Volume=600, City=Moline, State=IL, Country, Remarks=Silver Customer Accept Test ] [serviceSilver]: [ Id=3, Name=Silver Customer Accept, Level=Silver, Business Volume=600, City=Moline, State=IL, Country, Remarks=Silver Customer Accept Test ] [Prepare Silver Response Generation]: [mapRespFromReq]: [ Id=3, Name=Silver Customer Accept, Level=Silver, Business Volume=600, City=Moline, State=IL, Country, Remarks=Silver Customer Accept Test ] [silverCustProcess]: [Prepare Silver Customer Additional Processing]: Id=3 Name=Silver Customer Accept Level=Silver BusinessVolume=600 City=Moline Country=USA Remarks=Silver Customer Accept Test ProcessTime=6000 [7/29/07 14:17:42:016 EDT] 00000091 SystemOut O [getSilverCustRiskAssessment]: [7/29/07 14:17:49:562 EDT] 0000006a ServletWrappe A SRVE0242I: [BPCExplorer_Node01_server1] [/bpc] [/pages/layouts/views/TaskMessageView.jsp]: Initialization successful. [7/29/07 14:17:49:625 EDT] 0000006a ServletWrappe A SRVE0242I: [BPCExplorer_Node01_server1] [/bpc] [/pages/layouts/content/TaskMessage.jsp]: Initialization successful. [Generate Silver Customer Accept Response]: [notifyNcomplete]: [ Id=3, Name=Silver Customer Accept, Level=Silver, BusinessVolume=600, City=Moline, Country=USA, Remarks=Silver Customer Accept Test, ProcessTime=6000, RiskEvalCriteria=Please Evaluate This Customer Risk [Accept or Reject], RiskEvalOverride=Accept, PaymentHistoryRisk=Medium, PaymentHistoryWeight=35%, OutstandingDebtRisk=High, OutstandingDebtWeight=30%, DurationOfCreditHistoryRisk=Medium, DurationOfCreditHistoryWeight=15%, RepayCapacityRisk=Medium, RepayCapacityWeight=10%, TypesOfCreditRisk=Low, TypesOfCreditWeight=10%, OverallRiskAssessment=Accept ] [7/29/07 14:17:58:078 EDT] 0000009f System Out O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

11. Specify the following inputs (Figure 63) and click Submit. Figure 63. WebSphere Integration Developer BPC Explorer

Page 37: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

12. Select BPC Explorer => My Tasks => Check RiskAssessmentBySpecialistHTM

=> Work on (Figure 64). Figure 64. WebSphere Integration Developer BPC Explorer

13. Enter Output => and use Reject for Output entry field value. Click Complete

(Figure 65). Figure 65. WebSphere Integration Developer BPC Explorer

Page 38: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

14. Verify the following output (Figure 66). Figure 66. WebSphere Integration Developer Console Output [7/29/07 14:20:01:562 EDT] 0000006a System Out O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [7/29/07 14:20:01:922 EDT] 00000097 System Out O [AckCustReq]: [ Id=4, Name=Silver Customer Reject, Level=Silver, Business Volume=400, City=Chicago, State=IL, Country, Remarks=Silver Customer Reject Test ] [serviceSilver]: [ Id=4, Name=Silver Customer Reject, Level=Silver, Business Volume=400, City=Chicago, State=IL, Country, Remarks=Silver Customer Reject Test ] [Prepare Silver Response Generation]: [mapRespFromReq]: [ Id=4, Name=Silver Customer Reject, Level=Silver, Business Volume=400, City=Chicago, State=IL, Country, Remarks=Silver Customer Reject Test ] [silverCustProcess]: [Prepare Silver Customer Additional Processing]: Id=4 Name=Silver Customer Reject Level=Silver BusinessVolume=400 City=Chicago Country=USA Remarks=Silver Customer Reject Test ProcessTime=3000 [7/29/07 14:20:05:391 EDT] 0000008a SystemOut O [getSilverCustRiskAssessment]: [Generate Silver Customer Reject Response]:

Page 39: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

[notifyNcomplete]: [ Id=4, Name=Silver Customer Reject, Level=Silver, BusinessVolume=400, City=Chicago, Country=USA, Remarks=Silver Customer Reject Test, ProcessTime=3000, RiskEvalCriteria=Please Evaluate This Customer Risk [Accept or Reject], RiskEvalOverride=Reject, PaymentHistoryRisk=Low, PaymentHistoryWeight=35%, OutstandingDebtRisk=High, OutstandingDebtWeight=30%, DurationOfCreditHistoryRisk=High, DurationOfCreditHistoryWeight=15%, RepayCapacityRisk=Medium, RepayCapacityWeight=10%, TypesOfCreditRisk=Low, TypesOfCreditWeight=10%, OverallRiskAssessment=Reject ] [7/29/07 14:20:17:484 EDT] 0000008a SystemOut O ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

15. Select Servers View => WebSphere Process Server v6.0. Right-click to get the

context sensitive menu. Select Launch => Common Base Event Browser (Figure 67).

Figure 67. WebSphere Integration Developer Common Base Event Browser

16. Notice that 150 events were retrieved by the CBE browser from the event store. Click

the Get Events button to refresh the browser information (Figure 67). 17. We are primarily interested in our process generated events. Select BPEL Process

Events => RewardsHandling. You can see four instances, each one represents each of the code paths we executed above (Figure 68).

Figure 68. WebSphere Integration Developer Common Base Event Browser

Page 40: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

18. We can drill-down each process instance for detailed events. Select the

entry. You can see that this process instance has 24 CBE events generated during its code path execution (Figure 69).

Figure 69. WebSphere Integration Developer Common Base Event Browser

19. Select the event entry. You can see the complete event information for this BPC.BFM.PROCESS.START event (Figure 70).

Figure 70. WebSphere Integration Developer Common Base Event Browser

Page 41: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

20. You can explore the rest of the events generated and understand the detailed

information contained in the individual events.

Unit test the application in operational runtime We are now ready to perform out application testing in the fully operational runtime environment. To perform the above task, follow the steps outlined below: 1. Select Servers View => WebSphere Process Server v6.0 => right-click => Add

and remove projects… => 6-17-2007-MODWID-CustomerRewardsApp => < Remove => Finish (Figure 51).

2. Select Project Tree => 6-17-2007-MODWID-CustomerRewards => right-click => Export => Ear file => Next > => EAR project: 6-17-2007-MODWID-CustomerRewardsApp => Destination: C:\Bhar\devWorks\6-7-2007\6-17-2007-MODWID-CustomerRewardsApp.ear => Finish (Figure 71).

Figure 71. WebSphere Integration Developer EAR Export Wizard

Page 42: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

3. Select Servers View => right-click => Run administrative console => User ID:

bvperepa => Log in. Expand Applications => Enterprise Applications => Install => Browse… => 6-17-2007-MODWID-CustomerRewardsApp.ear => Open => Next => Next => Step 7 => Finish => Save to Master Configuration => Save. (Figure 72).

Figure 72. WebSphere Integration Developer Administrative Console

Page 43: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

4. Start the application. Open a browser window and point URL to

http://localhost:9080/bpc/. Now we are ready to perform our application unit testing in the operational runtime environment (Figure 73).

Figure 73. Web Browser Business Process Choreographer Explorer

5. The Event browser has been integrated into Administrator Console. Select Admin

Console => Integrated Applications => Common Base Event Browser. Verify that the events are flowing and visible in operational setup. Review the events generated (Figure 74).

Figure 74. Admin Console Common Base Event Browser

Page 44: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Conclusion Congratulations, you have successfully composed an integrated BPEL workflow application using WebSphere Integration Developer. You picked your IT project in WebSphere Integration Developer tool from where you left off your business process model project in WebSphere Business Modeler. You have composed, extended, refined, and augmented your business process model project in WebSphere Integration Developer tool to complete fully functionally implemented BPEL workflow integrated application. You have additionally unit tested your application in the workbench runtime environment as well as the operational runtime infrastructure. In future articles, we will add a monitor measures model to our BPEL workflow application and unit test the BPEL application along with monitor measures model. We would then deploy the fully monitorable integrated application (base BPEL workflow application plus monitor measures model application that we will build to monitor the base BPEL workflow application) into WebSphere Business Monitor Server v6.0.2.

Acknowledgements The authors would like to gratefully thank Rick Osowski, Software Engineer for IBM Business Monitor and John Andersen, Chief Architect, Strategic Transformation for meticulously and comprehensively reviewing the article and providing the authors with thoughtful suggestions.

Page 45: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

Resources

• IBM WebSphere Business Process Management Version 6.0 information center • Using Loops in WebSphere Business Modeler v6 to improve simulations and

export to BPEL (developerWorks, March 2007) • Process anti-patterns: How to avoid the common traps of business process

modeling, Part 1 (developerWorks, February 2007) • Business Process Execution Language for Web Services version 1.1

(developerWorks, February 2007) • Transforming models from WebSphere Business Modeler to WebSphere

Integration Developer (developerWorks, May 2005) • Using WebSphere Business Modeler, Monitor, and Process Server for BPM

(WB170 or VB170) • WebSphere Business Modeler: Process Mapping, Simulation, and Analysis

(WB182 or VB182) • WebSphere Business Modeler: Process Mapping and Analysis (BI184 or VB184) • Designing for Performance Measurement Using WebSphere Business Monitor

(WB189 or VB189) • WebSphere Business Modeler information • WebSphere Integration Developer information • Redbook: Business Process Management: Modeling through Monitoring Using

WebSphere V6 Products • Redbook: Best Practices for Using WebSphere Business Modeler and Monitor • Redbooks: Patterns: SOA Foundation - Business Process Management Scenario • IBM Modeler User's Group (IMUG) • Sharing business processes in a team environment using WebSphere Business

Modeler and CVS (developerWorks, February 2007) • developerWorks WebSphere development tools • developerWorks WebSphere business integration

About the authors Bhargav Perepa is a WebSphere IT Specialist at IBM Federal Software Group in Washington D.C. area. He was a WebSphere developer in IBM Austin WebSphere Development Lab and had previous Smalltalk, C++ development experience in IBM Chicago. Bhargav holds a Masters degree in Computer Sciences from IIT, Chicago and an MBA degree from UT-Austin, Texas. You can reach Bhargav at [email protected]. Carol Serna is an Advisory Software Developer at Silicon Valley Lab in San Jose, CA. She currently works on content editing and acquisitions for developerWorks WebSphere and manages the WebSphere business integration zone. Carol holds a B.S. in Business (Management Information Systems) and a minor in technical writing from San Jose State University. You can reach Carol at [email protected]. Trademarks

Page 46: End-to-end BPEL business activity monitoring with IBM SOA ...public.dhe.ibm.com/software/dw/wes/pdf/0710_perepa-end-to-end-B… · Business Modeler. In this article, you refine, compose,

• IBM and WebSphere are trademarks or registered trademarks of IBM Corporation in

the United States, other countries, or both. • Java and all Java-based trademarks and logos are trademarks or registered trademarks

of Sun Microsystems, Inc. in the United States, other countries, or both. • Other company, product, and service names may be trademarks or service marks of

others. IBM copyright and trademark information: http://www.ibm.com/legal/copytrade.phtml ----------------------------------------------------- References WebSphere Collateral Assets – XL and IBM Intranet Resources

Steph
Should this be moved to the resources section? Do you have a URL?