-
Language:
English
-
Language:
English
Chapter 6. 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. Newly created milestones are not set to Adhoc autostart
by default.
Case management milestones generally occur 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 Key Performance Indicator (KPI) tracking or identifying the tasks that are still to be completed.
Milestones can be in any of the following states during case execution:
-
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 by a signal or automatically if `Adhoc autostart`is configured when a case instance starts. Milestones can be triggered as many times as required, however, it is directly achieved when the condition is met.
6.1. Creating the Hardware spec ready milestone
Create a Hardware spec ready milestone that is reached when the required hardware specification document is completed.
Procedure
- In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas and place it on the right side of the Place order end event.
- Click the new milestone and in the upper-right corner, click to open the Properties panel.
-
Input
Hardware spec ready
in the Name field. -
Select
true
from the Adhoc autostart menu. Click the down arrow in the Assignments field and add the following new conditions in the Hardware spec ready Data I/O window.
Add
CaseData(data.get("hwSpec") != null)
by selecting Constant from the Source menu.- Click Save.
6.2. Creating the Manager decision milestone
This milestone is reached when the managerDecision
variable has been given a response.
Procedure
- In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Notify requestor script task.
- Click the new milestone and in the upper-right corner, click to open the Properties panel.
-
Input
Manager decision
in the Name field. -
Select
true
from the Adhoc autostart menu. Click the down arrow in the Assignments field and add the following new conditions in the Manager decision Data I/O window.
Add
CaseData(data.get("managerDecision") != null)
by selecting Constant from the Source menu.- Click Save.
6.3. Creating the Order placed milestone
This milestone is reached when the ordered
variable, which is part of the Place order sub-process, has been given a response.
Procedure
- In the process designer, click the default Milestone object.
- In the upper-right corner, click to open the Properties panel.
-
Input
Milestone 1: Order placed
in the Name field. -
Select
true
from the Adhoc autostart menu. - Click the down arrow in the Assignments field to add a new condition in the Milestone 1: Order placed Data I/O window.
Click the Source column drop-down, select Constant, and input
org.kie.api.runtime.process.CaseData(data.get("ordered") == true)
. This means that a case variable namedordered
exists with the valuetrue
.- Click Save.
Click Milestone 1: Order placed and create a new script task.
- Click the new script task and in the upper-right corner, click to open the Properties panel.
-
Input
Notify requestor
in the Name field. -
Click the down arrow in the Script field, input
System.out.println("Notification::Order placed");
, and click Ok. Click the Notify requestor scipt task and create a signal end event.
- Click the signal event and click to open the Properties panel.
- Click the down arrow in the Signal Scope field, select Process Instance.
-
Click the down arrow in the SignalRef field, input
Milestone 2: Order shipped
, and click Ok.
6.4. Creating the Order shipped milestone
The condition for this milestone is that a case file variable named shipped
is true
. Adhoc autostart
is not enabled for this milestone. Instead, it is triggered by a signal event when the order is ready to be sent.
Procedure
- In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Notify requestor script task.
- Click the new milestone and in the upper-right corner, click to open the Properties panel.
-
Input
Milestone 2: Order shipped
in the Name field. -
Select
false
from the Adhoc autostart menu. - Click the down arrow in the Assignments field to add a new condition in the Data Inputs and Assignments window.
-
Click the Source column drop-down, select Constant, and input
org.kie.api.runtime.process.CaseData(data.get("shipped") == true)
. This means that a case variable namedshipped
exists with the valuetrue
. - Click Save.
- Click Milestone 2: Order shipped and create a new script task.
- Click the new script task and in the upper-right corner, click to open the Properties panel.
-
Input
Send to tracking system
in the Name field. -
Click the down arrow in the Script field, input
System.out.println("Order added to tracking system");
, and click Ok. - Click the Send to tracking system scipt task and create a signal end event.
- Click the signal event and click to open the Properties panel.
- Click the down arrow in the Signal Scope field, select Process Instance.
-
Click the down arrow in the SignalRef field, input
Milestone 3: Delivered to customer
, and click Ok.
6.5. Creating the Delivered to customer milestone
The condition for this milestone is that a case file variable named delivered
is true
. 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.
Procedure
- In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Send to tracking system script task.
- Click the new milestone and in the upper-right corner, click to open the Properties panel.
-
Input
Milestone 3: Delivered to customer
in the Name field. -
Select
false
from the Adhoc autostart menu. - Click the down arrow in the Assignments field to add a new condition in the Milestone 3: Delivered to customer window.
-
Click the Source column drop-down, select Constant, and input
org.kie.api.runtime.process.CaseData(data.get("delivered") == true)
. This means that a case variable nameddelivered
exists with the valuetrue
. - Click Save.
- Click Milestone 3: Delivered to customer and create a new user task.
- Click the new user task and in the upper-right corner, click to open the Properties panel.
-
Input
owner
in the Actors field. -
Input
Customer satisfaction survey
in the Name field. -
Input
CustomerSurvey
in the Task Name field. Click the down arrow in the Assignments field to add data input and output assignments in the Milestone 3: Delivered to customer Data I/O window as shown below. For the output Data Type column, select Constant, and input
Survey [com.myspace.it_orders_new]
. Click Save.- Click the Customer satisfaction survey user task and create an end event.
- Click Save, and then Save to confirm your changes.
The IT Orders case can be closed after all milestone sequences are completed. However, due to the ad hoc nature of cases, the case could be reopened if, for example, the order was never received by the customer or the item is faulty. Tasks can be re-triggered or added to the case definition as required, even during run time.
For more information about ad hoc processes, see Chapter 8, Ad hoc and dynamic tasks.