Skip to main content

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

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

All information submitted is secure.

  • Close [x]

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.

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

All information submitted is secure.

  • Close [x]

Using the Undercover Agent with a message event in WebSphere Lombardi Edition V.7.2

Danh Ngoc Phi (phidn@vn.ibm.com), IT Specialist, IBM
Photo of Danh Ngoc Phi
Danh Ngoc Phi is a Software Developer with the IBM Software Group in IBM Vietnam. He has more than five years of experience in software development, maintenance, deployment, and support as an IT Specialist, Technical Team Leader, and Technical Architect.

Summary:  This tutorial demonstrates both the Intermediate and Start Message Events to restart an activity, terminate a process, update a process state, and start a new process application in WebSphere® Lombardi Edition. The events are released by the Undercover Agent. You will learn about the Undercover Agent, services, message events, human services, and some basic tasks in Lombardi Edition.

Date:  26 Oct 2011
Level:  Intermediate PDF:  A4 and Letter (1272 KB | 24 pages)Get Adobe® Reader®

Activity:  13857 views
Comments:  

Using IME to terminate the process

In this process, during the Review Request activity, if a reviewer detects an error and wants to terminate this request without any further investigation, he can press the End Process button. Hence, the End Process can yield an event to the BPD. In this BPD, you can use the IME (event handler) to capture this event and terminate this process.

  1. Create the UCA to generate the End Process event. The event can come from different sources, one of which is the UCA. In this tutorial, we use the UCA to generate an event. The UCA requires a service to receive and output data. At minimum, the UCA needs one variable for both input and output, which is the correlationID. Because an IME listener lives within an existing process instance when an event occurs, that event must be matched against the correct instance of the process for which the event is destined. The ability to match the event against this correct instance is called a "correlation".
  2. Define the End Process Service and variables as shown in Figures 15 and 16.

    Figure 15. End Process Service diagram
    End Process Service diagram



    Figure 16. Variable of End Process Service
    Variable of End Process Service

  3. Create the UCA for the Release End Process event (Figure 17).

    Figure 17. Configuration of End Process UCA
    Configuration of End Process UCA

  4. Re-design the Review Request coach, so that whenever the user clicks on the End Process! button, the UCA generates a terminate event for the process. The UCA connects to a Confirm End Process Coach before reaching the End event, as shown in Figure 18.

    Figure 18. Review Request Coach diagram
    Review Request Coach diagram

  5. Map the data for the End Process UCA to tw.local.request.requestID (current process instance ID). Design the Confirm End Process Coach (Figure 19.)

    Figure 19. Design of Confirm End Process Coach
    Design of Confirm End Process Coach

    In this coach, you are just displaying a static message to inform the end user: "Terminate this process".

  6. Add the IME to the BPD to listen to the End Process event (Figure 20).

    Figure 20. BPD diagram after adding the IME
    BPD diagram after adding the IME

    There are two kinds of IMEs: attached IME and inlined IME. In this tutorial, we use the attached IME to listen to the event coming from the Review Request activity. The circled envelop is the newly added IME. However, you need to configure the new IME to listen to the End Process event, released from End Process UCA, and terminate the process with the Terminate Process Event, as shown in Figure 21.



    Figure 21. Configuration of the End Process IME
    Configuration of the End Process IME

    In Figure 21, Attached UCA is now the End Process UCA. Consume Message is checked, which means that you just received the message once. correlationID is tw.local.request.requestID, which is used to identify the current process instance ID.

  7. You can now test this new process by running the process application. Run the application in the web browser. If you arrive at the Review Request activity, click on the End Process! button to terminate the process, as shown in Figure 22.

    Figure 22. UI of Review Request activity on the web
    UI of Review Request activity on the web

You just went through the steps on how to build an IME to terminate the entire process. The next lesson is to build an IME to restart an activity by pressing the Re-submit Request button in the Review Request Coach.

4 of 11 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere
ArticleID=767712
TutorialTitle=Using the Undercover Agent with a message event in WebSphere Lombardi Edition V.7.2
publish-date=10262011
author1-email=phidn@vn.ibm.com
author1-email-cc=dwu@us.ibm.com