Run the sample

Before running the sample, download and import the sample *.twx published in the download section. The name of the sample is: LaptopOrder_-_COMPLETE3.twx

After the import, in IBM Process Designer, you will find the sample in Process Center:

05_SampleInProcessCenter 

Select the sample and click on ‘Open in Designer’.

Before you start executing the process application, monitoring is switched on for this process application. However you have to update the performance warehouse to see the monitoring data in Process Portal.

Do the following the update the performance warehouse: In IBM Process Designer, under File, click on UpdateTrackingDefinitions:

051_UpdateTrackingDefinitions 

With that, the tracking definitions are deployed, and you can monitor the exection of the sample in Process Portal. What to do there in detail is described in the sample named ‘Monitor your first BPD’.

Now, let’s get started and run the process application. After opening the process application in Designer, the process application is opened showing the process application settings.

On the left hand tree, click on processes to see that there are three processes available in the process application:

06_ListOfBPDs

In the following, I will briefly explain the BPDs. You can open them all at once (by double clicking on the processes as listed in the processes folder), or once you’ve read through the next few paragraphs here in this section.

Process 1 – LaptopOrder_EditAndFile

This is the process to start the whole scenario. You have to start this process manually, for example from Designer or Inspector perspective.

07_Process1_LaptopOrder_EditAndFile

Briefly, the process does the following: 
  1. The first activity allows to order a specific laptop model. If you enter a price of more than 1000, then an additional manager approval is required. If you select to order the laptop type "IBM Thinkpad w300" then the delivery process will generate an exception because this laptop is no longer available

  2. In any case, most important is to remember the Order ID, as the Order ID is used to correlate between this process an another process which does send either the order modify or order cancel event expected at the event gateway.

  3. Every timer in this process is set to 10 minutes. Which means that the manager has 10 minutes time to approve the order, before the timer fires and another activity is made ready to remember the manager to approve the order. The second timer is part of the event gateway and will fire after 10 minutes once the process engine has navigated to the event gateway. This happens always unless the modify or cancel event is sent to the process instance, correlated using the Order ID.

  4. Once the File Order activity completes, this process ends and sends a message to the Laptop_Deliver process to start the delivery of the ordered laptop

Process 2 – LaptopOrder_Modify

This process is used to either modify or cancel a laptop order, using the Order ID as correlation key between this process and the LaptopOrder_EditAndFile. You have to start this process manually, for example from Designer or Inspector perspective.

08_Process2_LaptopOrder_Modify

Briefly, the process does the following: 
  1. The first activity allows to define whether a specific laptop order identified with the Order ID should be modified, or cancelled. You have to know the Order ID for your laptop order edited in process 1.

  2. Accordingly, the corresponding message is sent to the LaptopOrder_EditAndFile process.

Process 3 – LaptopOrder_Deliver

This process is started via a process message start event sent from the LaptopOrder_EditAndFile process once this completes after the File Order activity.

09_Process3_LaptopOrder_Deliver

Briefly, the process does the following:

  1. The laptop order is presented to change the Employee Department Discount Factor, which however has no effect for the execution of the process instance

  2. Then the delivery service is started which does trigger the delivery of the laptop unless the laptop type is not "IBM Thinkpad w300". In this case the service thrown an exception which is catched by the event subprocess.

  3. The event subprocess presents the laptop order again, and once it completes, a process message end event is sent, which is received by the LaptopOrder_EditAndFile process, and the cycle starts again.

  4. If the service works fine, then the process completes normally, and the scenario ends.

All together, the process application looks like this:

10_FullPAScenario 

It is therefore still a simple scenario, however shows most of the events added in IBM Business Process Manager v751.

Now – let’s get started.

In IBM Process Designer, open the LaptopOrder_EditAndFile process, and the other two processes as well.

In the LaptopOrder_EditAndFile process, click on the start icon to run a first instance of this process:

11_Process1_LaptopOrder_EditAndFile_Start

Click on the first activity and click start as well:

12_Process1_LaptopOrder_EditAndFile_StartActivity 

When asked to pick a user role, for all activities in this scenario, use the role tw_admin:

13_PickUserRole

This activity allows to specify the laptop order.

14_SpecifyLaptopOrder

Remember the OrderID, because you need this if you want to modify that order, or if you want to cancel the order.

Select a price of more than 1000 to have the order to be approved by a manager.

Select the "IBM Thinkpad w300" to have the service used in the LaptopOrder_Deliver process to throw an exception and to trigger the event subprocess. The LaptopOrder_Deliver process however is started automatically.

Now, if you want to modify or cancel the process, start an instance of the LaptopOrder_Modify process, either from the Designer or Inspector perspective.

15_Process2_LaptopOrder_Modify_Start

Select the activity made ready and click start:

16_Process2_LaptopOrder_Modify_StartActivity

Then add the Order ID specified for your order, and decide whether to cancel or modify the order. Click ok when done.

17_ModifyLaptopOrder

According to your selection, the process instance performing the laptop order with the entered Order ID will either branch back to modify the laptop order, or navigate to the Cancel Order activity. This is what the event gateway is all about.

Now – in some cases, the LaptopOrder_EditAndFile process will reach the File Order activity, complete this step, and trigger the LaptopOrder_Deliver process to start. If this is the case, you will find the instance in the process instance list in the Inspector perspective.

Select this instance, then select the activity that is made ready for execution, and start this activity:

18_Process3_LaptopOrder_Deliver_StartActivity

The activity simply requires to click ok, and then – depending on the laptop type ordered – the event subprocess is triggered catching the exception, or not. If the event subprocess was triggered, then the InformOrderer activity will be made ready. Select the activity, start and execute it.

19_Process3_LaptopOrder_Deliver_InformOrderer

After this, a new instance of the LaptopOrder_EditAndFile process order is created, and the cycle repeats, again depending on the laptop order data, as you define it in the Edit Laptop Order activity.

This describes the scenario.

You may or may not run several instances in parallel, to see various execution paths of the process application.

As mentioned in the beginning, monitoring is enabled, and instead of running the samples in IBM Process Designer, you can do run the samples in IBM Process Portal as well. Logon with userID and password ‘tw_admin’, create process instances from there, and select the tasks you want to work on.

20_ProcessPortal

Click on the MyTasks and MyScoreBoards links to handle activity execution and monitoring from there. Details are is described in the sample named ‘Monitor your first BPD’.

This is it.

There’s much more to explore in IBM Business Process Manager v751.

But for this time, this is the end of the sample.