Red Hat Training

A Red Hat training course is available for Red Hat Process Automation Manager

Chapter 9. Milestones

Milestones are a special service task that can be configured in the case definition designer by adding the milestone node to the process designer palette. When creating a new case definition, a milestone configured as Adhoc autostart is included on the design palette by default.

Case management milestones usually occurs at the end of a stage, but they can also be the result of achieving other milestones. A milestone always requires a condition to be defined in order to track progress. Milestones react to case file data when data is added to a case. A milestone represents a single point of achievement within the case instance. It can be used to flag certain events, which can be useful for KPI tracking or identifying the tasks that are still to be completed.

Milestones can have three states:

  • Active - The condition has been defined on the milestone but it has not been met.
  • Completed - The milestone condition has been met, the milestone has been achieved, and the case can proceed to the next task.
  • Terminated - The milestone is no longer a part of the case process and is no longer required.

While a milestone is available or completed it can be triggered manually using a signal or can be automatically started (by configuring Adhoc autostart) when a case instance starts. Milestones can be triggered as many times as required, however, it is directly achieved when the condition is met.

9.1. Milestone configuration and triggering

Case milestones can be configured to start automatically when a case instance starts or they can triggered using a signal, which is configured manually during the case design.

Prerequisite

  • A case project has been created in Business Central.
  • A case definition has been created.

Procedure

  1. In the process designer, click right arrows to open the Object Library on the left of the design palette.
  2. From the list, open Milestone and drag the Milestone object onto the palette.

    Milestone
  3. With the milestone node selected, click left arrows to open the Properties panel on the right.
  4. Open Assignments to add a completion condition. Milestones include a condition parameter by default.
  5. To define the completion condition to for the milestone, select Constant from the list. The condition must be provided using the Drools syntax.
  6. Configure the Adhoc autostart property.

    • Set this property to true for milestones that are required to start automatically when a case instance starts.
    • Set this property to false for milestones that are to be triggered by a signal event.
  7. (Optional) Configure a signal event to trigger a milestone once a case goal has been reached.

    1. With the signal event selected in the case design palette, open the Properties panel on the right.
    2. Set the Signal Scope property to Process Instance.
    3. Open the SignalRef expression editor and type the name of the milestone to be triggered.

      Milestone trigger expression

      Click Ok to finish.

9.2. IT Orders case milestones

Milestones are configured in the process designer by adding a milestone node to the design palette.

The following milestones are configured in the IT Orders sample project:

Hardware spec ready

This milestone is reached when the required hardware specification document is completed. This is configured using the following condition:

org.kie.api.runtime.process.CaseData(data.get("hwSpec") != null)

Adhoc autostart is enabled for this milestone.

Manager decision

This milestone is reached when the managerDecision variable has been given a response. It is configured using the following condition:

org.kie.api.runtime.process.CaseData(data.get("managerDecision") != null)

Adhoc autostart is enabled for this milestone.

Milestone 1: Order placed

This milestone is in a wait state until the completion condition is met.

The condition for this milestone is that a case file variable named ordered exists with the value true. This is configured using the following condition:

org.kie.api.runtime.process.CaseData(data.get("ordered") == true)

A script task then sends a notification that the hardware order has been placed.

Adhoc autostart is enabled for this milestone.

Milestone 2: Order shipped

The condition for this milestone is that a case file variable named shipped is true. This is configured using the following condition:

org.kie.api.runtime.process.CaseData(data.get("shipped") == true)

The Send to tracking system script is executed when the condition is met.

Adhoc autostart is not enabled for this milestone. Instead, it is triggered by a signal event when the order is ready to be sent.

Milestone 3: Delivered to customer

The condition for this milestone is that a case file variable named delivered is true. This is configured using the following condition:

org.kie.api.runtime.process.CaseData(data.get("delivered") == true)

A Customer satisfaction survey task is created when the condition is met.

Adhoc autostart is not enabled for this milestone. Instead, it is triggered by a signal event after the order has successfully shipped to the customer.