< Previous | Next >

Complete the clipsbpm monitor model

Now you will complete the expressions for the six decision percentage metrics in the monitor details model. There are three decisions in the process model, so there is a yes metric and a no metric in the monitor model for the result of each decision. There will be a measure in the dimensional model that averages each metric, so the measure will show the percentage of the time that the branch was taken.

If a decision has not been traversed, then you do not want to include it in the averaging calculation. For example, the Approve Without Review? task in the process model is the only decision point that is always traversed. Account in Good Standing? and the Acceptable Credit Risk? tasks are only traversed under specific conditions while the order is being handled.

If the value of a metric is null, then the averaging functions will not include that metric’s value in the calculation. Therefore, you will set the default value to null for each metric as the starting condition. Its value will only be set if the decision point is reached. If it isn’t reached, it will remain null and therefore be excluded from the averaging calculation.

You will also create a trigger for each decision that determines when the yes branch is taken, sets the value of the yes metric to 100, and also sets the value of the no metric to 0. Then you will create a trigger for each decision that determines when the no branch is taken, sets the value of the no metric to 100, and also sets the value of the yes metric to 0. Therefore, when the measure averages each metric for the instances, the values will be null, 0 or 100, and the average will represent the percentage of the time that the branch was taken.

From the process model, only the Approve Without Review? task is guaranteed to always be set to a non-null value at the completion of the process. Of the other two, at least one task will be set to non-null and possibly both, depending on the path the customer order takes through the process.

In the following expressions, the WebSphere® Integration Developer BPEL editor contains the names of the links (for example, “AcceptableCreditRiskOutput_to_Merge2Input2”) for the process.

  1. Create triggers to indicate flow on each of the decision links:
    1. In the Monitor Details Model tab, expand clipsbpm and select OrderHandling (Future1). Right-click in the Monitor Details Model navigator, and select New > Trigger. (You can right-click OrderHandling (Future1) or anywhere in the Monitor Details Model as long as OrderHandling (Future1) or one of its components is selected.)
    2. For the name, enter Acceptable Credit Risk Yes Trigger. Click OK. The Monitor Details Model tab view now displays the details for this trigger. Note that selecting an element in the Monitor Details Model navigator updates the view with the details for the selected element.
    3. In Trigger Sources, click Add (or double-click in the first row). From the Select Trigger Source menu, select Other source type and navigate to Order Handling (Future 1) > OrderHandlingFuture1_FlowCONDTRUE. Click OK. OrderHandlingFuture1_FlowCONDTRUE is an event that is sent when a branch from the flow is taken in the process.
    4. To fire this trigger when the link from Acceptable Credit Risk to the Merge is traversed, in the Trigger Condition field, enter the following text:

      OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'AcceptableCreditRiskOutput_to_Merge2Input2'

      Note: Pay close attention to the text in the trigger condition. It must match exactly. To ensure that the text matches exactly, copy it from this document.

      Save your work.

      Trigger condition field

    5. Repeat the previous steps for the following triggers, adding the corresponding trigger conditions. The Trigger Source is Order Handling (Future 1) > OrderHandlingFuture1_FlowCONDTRUE for all the triggers.
      Acceptable Credit Risk No Trigger
      Condition: OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'AcceptableCreditRiskOutput2_to_CancelOrderandSendNotificationInput'
      Account in Good Standing Yes Trigger
      Condition: OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'AccountinGoodStandingOutput_to_Merge2Input'
      Account in Good Standing No Trigger
      Condition: OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'AccountinGoodStandingOutput2_to_MergeInput'
      Approve Without Review Yes Trigger
      Condition: OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'ApproveWithoutReviewOutput_to_CheckCustomerAccountStatusInput'
      Approve Without Review No Trigger
      Condition: OrderHandlingFuture1_FlowCONDTRUE/BPELData/bpc:elementName eq 'ApproveWithoutReviewOutput2_to_MergeInput2'
    6. Save your work.
  2. Set flow metric values to denote that the decision was skipped (value of null) or that the flow path was taken (value of 100) or not taken (value of 0).
    1. In the Monitor Details Model tab, select the Acceptable Credit Risk? No Percentage metric.
    2. Remove the default value of 0 by backspacing over it. Deleting this value will give the default a value of null.
    3. In the Metric Value Expressions table click Add.
    4. In the Trigger column, select the first row, click ... in the field, and select Acceptable Credit Risk Yes Trigger from the dialog box. Click OK.
    5. In the Expression column, select the first row and click ... in the field, and enter 0.
    6. In the Metric Value Expressions table click Add. For the trigger, select Acceptable Credit Risk No Trigger. For the expression, specify 100.
      Trigger expression
    7. Repeat the previous steps for the following metrics. Remember to remove the default value for each metric so it is treated as null.
      Monitor Details Model Metric Default Value Trigger Metric Value Expression
      Acceptable Credit Risk? Yes Percentage <empty> Acceptable Credit Risk Yes Trigger 100
      Acceptable Credit Risk No Trigger 0
      Account in Good Standing? No Percentage <empty> Account in Good Standing Yes Trigger 0
      Account in Good Standing No Trigger 100
      Account in Good Standing? Yes Percentage <empty> Account in Good Standing Yes Trigger 100
      Account in Good Standing No Trigger 0
      Approve Without Review? No Percentage <empty> Approve Without Review Yes Trigger 0
      Approve Without Review No Trigger 100
      Approve Without Review? Yes Percentage <empty> Approve Without Review Yes Trigger 100
      Approve Without Review No Trigger 0
    8. Save your work.
  3. Alerts are initiated by situation events. Specify the trigger conditions that will generate situation events for the Alerts.
    1. Select the KPI Model tab and expand clipsbpm > Template KPI Context. Select Average Process Duration Trigger 1 so that you can update it. The Average Process Duration Trigger 1 trigger will be used to emit the situation event indicating that the process duration is too long. A situation event is used to initiate an alert.
    2. In the Trigger Source table, click Add and select Recurring wait time. Click OK. The recurring wait time default is 1 minute. Adding the recurring wait time sets a timer that will check the trigger condition every minute.
    3. For Trigger condition, enter the following expression:
      Average_Process_Duration ge dayTimeDuration('P3DT1H')

      Trigger source and condition

      The trigger condition checks whether the Average Process Duration is greater than 3 days and 1 hour.

    4. Repeat the previous steps to update Percentage of Orders Shipped Trigger 1. The Percentage of Orders Shipped Trigger 1 trigger will be used to emit the situation event indicating that the percentage of shipped orders is too low. For the trigger condition, enter the following expression:
      Percentage_of_Orders_Shipped < 85

      Trigger source and condition

  4. The Average Process Duration KPI will now be implemented.
    1. From the KPI Model tab, select Average Process Duration.
    2. Because this was copied from another model, you need to update the Monitoring context. Scroll down to the KPI Details section. Click Browse for Monitoring context, and navigate to clipsbpm > Order Handling (Future 1). Then click OK. The metric value is blank.
      Note: There is another KPI, Order Handling (Future 1) Average Elapsed Duration, which has the same function as Average Process Duration. Order Handling (Future 1) Average Elapsed Duration was auto-generated. You can review it to see which metric should be used. It will be filled in during the next step.
    3. While you are still in the KPI Details section, click Browse for Metric and then navigate to Order Handling (Future 1) > Order Handling (Future 1) Elapsed Duration for KPI. Click OK.
    4. Set the Aggregation function to Average from the drop-down list.

      KPI Details

    5. In the KPI Model tab, select Order Handling (Future 1) Average Elapsed Duration, right-click and select Delete. It is a duplicate of the Average Process Duration KPI.
    6. Save your work.
  5. In the KPI model, implement the KPI Percentage of Orders Shipped. To calculate the percentage of orders that are shipped, you will create a KPI for the number of shipped orders, and you will create another KPI for the total number of orders. Then you can determine the percentage by dividing the shipped orders by the total orders:
    1. Click the Monitor Details Model tab, right-click in the Monitor Details Model navigator, and select New > Trigger.
    2. For the name, enter Shipped Order Trigger and click OK.
    3. In Trigger Sources, click Add and then select Other source type. Navigate to Order Handling (Future 1) > Ship Order to CustomerEXIT and click OK.

      Trigger source for Event

    4. In the Monitor Details Model tab, right-click in the Monitor Details Model navigator and select New > Trigger.
    5. For the name, enter Cancelled Order Trigger, click OK.
    6. In Trigger Sources, click Add and then select Other source type. Navigate to Order Handling (Future 1) > Cancel Order and Send NotificationEXIT and click OK.

      Trigger source for event

  6. Create a new metric to contain the status of the Order.
    1. Right-click in the Monitor Details Model navigator and selectNew > Metric.
    2. For the name, enter Order Status. For the type, select String and click OK.
    3. Because a dimension will use this metric, and dimensions require a value for dimensional analysis, select 'A value is required for this metric'.
    4. For the Default value, enter 'New' with the quotation marks.
    5. In Metric value expressions, click Add. In the Trigger cell, select Cancelled Order Trigger for the trigger. In the Expression cell, enter 'Cancelled' with the quotation marks.
      Note: You have to click the icon in the cell to enter the text.
    6. Again, in Metric Value Expressions, click Add. In the Trigger cell, select Shipped Order Trigger for the trigger. In the Expression cell, enter 'Shipped' with the quotation marks.

      Metric Value Expressions

  7. Create a new KPI to count the number of shipped orders. You will use the Instance ID metric to count all incoming instances and then filtering the incoming instances by order status so only shipped orders are counted. You will also filter the instances by the process state so that only completed process instances are counted. In the KPI model, create a new KPI called Shipped Orders:
    1. Select the KPI Model tab.
    2. In the KPI model navigator, right-click and select New > KPI. For the name, enter Shipped Orders and click OK.
    3. Set the Type to Decimal.
    4. Scroll down to the KPI Definition section if it is not visible. For KPI value, select 'Base this KPI on a metric and an aggregation function'.
    5. For the Monitoring context, browse to Order Handling (Future 1).
    6. For the Metric, browse to Order Handling (Future 1) Instance ID.
    7. For the Aggregation function, select Count.
    8. For the Data Filter, click Add and then browse to Order Handling (Future 1) > Order Status. Then click OK. In the Values cell, enter 'Shipped' with the quotation marks.
    9. Again in the Data Filter, click Add and then browse to Order Handling (Future 1) > Order Handling (Future 1) State. Then click OK. In the values cell, enter '3 - STATE_FINISHED' with the quotation marks.

      Data filter

  8. Create a KPI to count the total number of orders. You will use the Instance ID metric to count all incoming instances. You will also filter the instances by the process state so that only completed process instances are counted. In the KPI model, create a new KPI called Total Orders:
    1. In the KPI model navigator, right-click and select New > KPI. For the name, enter Total Orders click OK.
    2. Set the Type to Decimal.
    3. For the KPI value, select 'Base this KPI on a metric and an aggregation function'.
    4. For the Monitoring context, browse to Order Handling (Future 1).
    5. For the Metric, browse to Order Handling (Future 1) Instance ID.
    6. For the Aggregation function, select Count.
    7. For the Data Filter, click Add and then browse to Order Handling (Future 1) > Order Handling (Future 1) State. Then click OK. In the values cell, enter '3 - STATE_FINISHED' with the quotation marks.

      Data filter

  9. Now you will complete the Percentage of Orders Shipped KPI:
    1. In the KPI model navigator, select KPI Percentage of Orders Shipped.
    2. Set the Type to Decimal.
    3. For the KPI Value, select 'Write an expression to calculate this KPI based on existing KPIs'.
    4. For the KPI Calculation, enter (Shipped_Orders div Total_Orders) * 100.
    5. Save your work.

      KPI Calculation

  10. In the next procedure, you will create the ShippedPercentage.cbe event definition. This event is used to initiate an alert when there is a problem with the shipped orders percentage.
    1. In the project tree, right-click Event Definitions and then select New > Event Definition … (cbe). For file name, enter ShippedPercentage.cbe, and then click Finish. The event definition editor opens.
    2. Double-click the hierarchical icon next to the label Parent
    3. On the Select Event Definition dialog box, double-click ActionServicesEvent. ActionServicesEvent is now shown as the parent of ShippedPercentage.
      ShippedPercentage CBE
    4. Save your work.
  11. Use this event definition to create the Shipped Percentage Event outbound event definition in the monitor model:
    1. In the clipsbpm model, click the KPI Model tab.
    2. In the KPI Model navigator, right-click and select New > Outbound Event.
    3. For the Name, enter Shipped Percentage Event.
    4. Select the check box for 'Configure this event to generate an alert in the dashboards'.
    5. For the Trigger, browse to Template KPI Context > Percentage of Orders Shipped Trigger 1 and click OK.
    6. Click OK.
    7. In Event Type Details, for the extension name, browse to clips > ShippedPercentage.cbe > Shipped Percentage and then click OK.
    8. In Event Attributes Details, navigate to BusinessSituationName. The value of the situation name is set to 'Shipped Percentage Event'.
      Event Attributes Details
    9. Save your work.
  12. Create the OrderFulfillmentTime.cbe outbound event for the order processing time situation:
    1. In the project tree, right-click Event Definitions and select New > Event Definition... (cbe).
    2. For the file name, enter OrderFulfillmentTime.cbe and then click Finish. The event definition editor opens.
    3. Double-click the hierarchical icon hierarchical icon next to the label Parent. On the Select Event Definition dialog box, double-click ActionServicesEvent. ActionServicesEvent is now the parent of OrderFulfillmentTime.
    4. In the Extended Data section, click the Add Extended Data icon Add extended data icon.
    5. Change the name of the extended data element to OrderDuration and change the type to string.

      Extended data element OrderfullfillMentTime

    6. Save your work.
  13. Create the Order Fulfillment Event outbound event:
    1. In the clipsbpm model, click the KPI Model tab.
    2. Right-click in the navigator, select New > Outbound Event.
    3. For the Name, enter Order Fulfillment Event.
    4. Select the check box for 'Configure this event to generate an alert in the dashboards'.
    5. For the Trigger, browse to Template KPI Context > Average Process Duration Trigger 1 and click OK.
    6. Click OK.
    7. In Event Type Details, for the extension name, browse to clips > OrderFulfillmentTime.cbe > OrderFulfillmentTime and then click OK.
    8. Again in Event Attributes Details, navigate to BusinessSituationName. The value of the situation name is set to 'Order Fulfillment Event'.
    9. Set the expression for OrderDuration to xs:string(Average_Process_Duration).

      Event Attribute Details

    10. Save your work.
    Note: Notice that in both of the events (CBEs) created above that the Extended Data element BusinessSituationName was not created. This is because it is inherited from the parent event ActionServicesEvent. Actually, the ShippedPercentage.cbe did not even need to be created. The outbound event Shipped Percentage Event in the monitor model could have been created with the default Extension name of ActionServicesEvent.cbe > ActionServicesEvent. Event definitions (CBEs) for situation events only need to be created if Extended Data other than BusinessSituationName is needed. This is frequently the case however as additional process or business data is typically needed in the Alert and thus must be carried in the event.
  14. There are count measures in the monitor model that will now be removed, these counts can be derived from a provided measure named Instances Count.
    1. Click the Dimension Model tab.
    2. Delete Declined Order Count, Order Count, and Shipped Order Count. Instead, you can get this information using the provided measure InstancesCount and then creating a dimension on Order Status which will be used to aggregate order instances by the order status, e.g. new orders, shipped orders, and cancelled orders. In effect, this counts the order instances by their status.
  15. Create the dimension Order Status so that orders can be aggregated by their status.
    1. In the Dimensional Model navigator, right-click Order Handling (Future 1) Cube, then select New > Dimension.
    2. For the Name, enter Order Status and then click OK.
    3. In the Dimensional Model navigator, right-click Order Status and select New > Dimension Level.
    4. Name the dimensional level Order Status. Then click Browse next to Source Metric and navigate to Order Handling (Future 1) > Order Status. Then click OK.

      Order Status metric

    5. To see the dimension level, click Order Status under Order Status.
  16. Create the State dimension so that orders can be aggregated by the process completion state.
    1. In the Dimensional Model navigator, right-click Order Handling (Future 1) Cube and then select New > Dimension.
    2. For the Name, enter State.
    3. In the Dimensional Model navigator, right-click State and select New > Dimension Level.
    4. Name the dimension level State. Then click Browse next to Source Metric, and navigate to Order Handling (Future 1) > Order Handling (Future 1) State. Then click OK.
    5. Click OK. There is an error on this dimension because the Order Handling (Future 1) State metric is not initialized when the monitoring context is created. To solve this problem, in the Monitor Details Model tab, update the Order Handling (Future 1) State metric by selecting 'A value is required for this metric' and changing the default value to 'New', including the quotation marks.
  17. There is a dimension called Location in the dimensional model, but there are errors associated with it. This dimension came from the business measures model, and it should contain two levels: the country and the city. Create metrics for country and city and then update the Location dimension to refer to the metrics.
    1. Right-click in the Monitor Details Model navigator and select New > Metric.
    2. For the name, enter Country. For the type, select String. Then click OK.
    3. Because a dimension will use this metric and the metric requires a value for dimensional analysis, select 'A value is required for this metric'.
    4. For the default value, enter an empty string, which is two single quotation marks.
    5. In Metric value expressions, click Add. In the Expression cell, use content assist (Ctrl + Space bar) to navigate to the following inbound event field for country:
      Check_Order_Handling_Policy_for_Automatic_ApprovalENTRY/Input/Customer/Country
      Metric value expression
    6. Create a City metric, following the previous steps but selecting the following inbound event field for city:
      Check_Order_Handling_Policy_for_Automatic_ApprovalENTRY/Input/Customer/City

      Metric value expression

  18. In the Dimensional model, update the Location dimension with the two metrics:
    1. In the Dimensional model, delete the Location level under the Location dimension.
    2. In the Dimensional Model navigator, right-click Location and select New > Dimension Level.
    3. Name it Country and then click Browse next to Source Metric and navigate to Order Handling (Future 1) > Country. Then click OK.
    4. Click OK.
    5. In the Dimensional Model navigator, right-click Location and select New > Dimension Level.
    6. Name it City and then click Browse next to Source Metric and navigate to Order Handling (Future 1) > City. Then click OK.
    7. Click OK. In the Dimensional Model navigator, Location is listed with two sublevels:

      Dimensional Model navigator

  19. In the Dimensional model, update the Order Price Average measure. You will create a price metric to use as a source for this measure.
    1. Right-click in the Monitor Details Model navigator and select New > Metric.
    2. For the name, enter Total Price. For the type, select Decimal. Click OK.
    3. In Metric value expressions, click Add. In the Expression cell, navigate to the following inbound event field for total price:
      Check_Order_Handling_Policy_for_Automatic_ApprovalENTRY/Input/TotalPrice

      Metric Value Expression

  20. In the dimensional model, update the Order Price Average measure with the new metric:
    1. Select the Dimensional Model tab and then select the Order Price Average measure.
    2. For the source metric, browse toOrder Handling (Future 1) > Total Price and click OK.

      source metric

  21. In the dimensional model, update the Order Price Total measure with the new metric:
    1. Select the Dimensional Model tab and then select the Order Price Total measure.
    2. For source metric, browse to Order Handling (Future 1) > Total Price and click OK.

      source metric

    3. Save your work.
    4. Select Project > Clean, and then select 'Clean all projects'. Click OK.
    5. Check for errors in the Problems view and resolve the errors before continuing. Warnings and informational messages might be present, but they will not be a problem. If the errors do not disappear, close WebSphere Integration Developer, reopen WebSphere Integration Developer, and then rebuild all the projects by clicking Project > Clean.
< Previous | Next >