Examples of Custom metrics
The following are some examples of custom metrics that can be applied in your IBM Process Mining project.
Define SLA based on the priority custom field
The following custom metric computes the Case SLA in milliseconds based on the priority field, which makes it suitable for the ticketing process.
Data type: Duration
case when max(priority) = 'High' then 1*24*60*60*1000
else case when max(priority) = 'Medium' then 2*24*60*60*1000
else 5*24*60*60*1000
end
end
Group by: Case ID
Count the number of specific deviations per case
The following custom metric computes the number of activities with the word change in their name.
Data type: Numeric
count(activity)
Group by: Case ID
Where:
activity LIKE '%Change%'
Compute the case risk by basing it on the occurrences of some activities
The following custom metric computes case risk by basing it on the Count the number of specific deviations per case custom metric.
Data type: Numeric
SQL_MIN (7*count_changes,100)
Group by: Case ID
Define the positive or negative outcome by basing it on occurrences of a specific activity
The following custom metric returns true if the activity Resolution Rejected occurs.
Data type: Boolean
case when listagg(activity) LIKE '%Resolution Rejected%' then 1 else 0
end
Group by: Case ID
listagg(activity) requires
Resolution Rejected to be written inside the
LIKE function.Development Working Time for SDLC processes
This custom metric calculates working time based on story points in a Software Development Life Cycle (SDLC) process. This metric can be used as a working time attribute in the Attributes settings.
In SDLC processes, work items (such as user stories or tasks) are often estimated using story points. You can use story points to calculate the expected working time for development activities. This created custom metric has the following qualities:
- It calculates working time based on the
story_pointsattribute from theworkitemtable - It applies the calculation only to "Commit Code" activities
- It uses a conversion factor of 4 hours per story point (4 * 3600 * 1000 milliseconds)
- It returns 0 for activities other than "Commit Code"
Before you create this custom metric, make sure that:
- Your project includes a
workitemobject table with astory_pointsattribute - The
workitemtable is joined to the event log using thework_item_idfield - Your event log includes "Commit Code" as an activity
Create the development working time custom metric using Advanced mode:
- Name: Development Working Time
- Data Type: Duration
SELECT case when MIN(el.ACTIVITY) = 'Commit Code'
then MIN(wi.story_points * 4 * 3600 * 1000)
else 0 end as dev_wt, el.id
FROM workitem wi
JOIN eventlog el ON (el.CASEID = wi.work_item_id)
GROUP BY el.id
After creating the Development Working Time custom metric, you can configure it as the working time attribute:
- Go to Data & Settings > Data > Attributes.
- In the Working time attribute section, select Development Working Time from the drop-down list.
- Click Apply to save your changes.
When you configure working time through the Attributes settings, the system automatically falls back to the cost settings if the working time value is NULL or 0 for a specific event. This ensures comprehensive cost coverage across all activities.
For more information about configuring working time attributes, see Attributes and Activity working time.