- Release notes
- Before you begin
- Getting started
- Integrations
- Working with process apps
- Working with dashboards and charts
- Working with process graphs
- Working with Discover process models and Import BPMN models
- Showing or hiding the menu
- Context information
- Export
- Filters
- Sending automation ideas to UiPath® Automation Hub
- Tags
- Due dates
- Compare
- Conformance checking
- Root cause analysis
- Simulating automation potential
- Starting a Task Mining project from Process Mining
- Triggering an automation from a process app
- Viewing Process data
- Creating apps
- Loading data
- Transforming data
- Customizing process apps
- Publishing process apps
- App templates
- Additional resources

Process Mining
Configuring Due dates
If you want to use the Due dates dashboard to analyze due dates, due dates must be defined for your app template.
If there are out of the box due dates available for your app template, these due dates will be shown in the Due dates dashboard. In the documentation for your specific app template you will find an overview of the available due dates. The App Templates page contains links to the documentation for all available app templates.
models\5_business_logic\Due_dates_base.sql
file using data transformations. Here you can also configure any default due dates to your business needs.
Due_dates_raw.csv
file. Check out Custom process input fields.
In the last transformation step, business logic is added as needed for data analysis.
Each record in the due dates table represents one due date for a certain object. Example due dates are:
- a payment deadline for a payment object.
- an approval deadline for purchase requisition.
Case_ID
, Due_date
, Actual_date
, and Expected_date
.
Not all events will have a due date and some events may have multiple due dates.
Refer to Data transformations editor for more information.
You can provide additional input data to be used for the calculations in the Due dates dashboard using SQL statements in Data transformations. For all due dates, you can configure the following fields.
Name |
Type |
Description |
Due_date | Text |
The name of the due date. |
Due_date_type | Text |
The Due date type. |
Fixed_costs |
Boolean |
An indication whether costs are fixed or time based. |
|
Float |
Fixed costs: The amount of costs.
Variable costs: The amount of costs per Time and Type_type.
|
|
Integer |
A number indicating the amount of time in case of time-based costs. |
Time_type | Text | Type of time period for cost calculations. This can be any of the following values: day, hour, minute, second, millisecond. |
|
Text/Integer |
The ID of the Case to which the due date is related. |
For process apps that still contain the Due_dates_configuration_raw.csv seeds file in the seeds\ folder of the data transformations, you can use this file to provide additional input data to be used for the calculations in the Due dates dashboard.
Case_ID
. If you want to use the SQL examples to define Due dates for Purchase-to-Pay app templates or Order-to-Cash app templates, make sure to use the appropriate object and the related internal object_ID. For Purchase-to-Pay you can use the Purchase_order_item_end_to_end_events
event log, the Purchase_order_items
object and the Purchase_order_item_ID_internal
as Case_ID
. For Order-to-Cash you can use the Sales_order_item_end_to_end_events
event log, the Sales_order_items
object and the Sales_order_item_ID_internal
as Case_ID
.
The following code block shows an example SQL query to define a due date.
select
tableA."Case_ID",
{{ pm_utils.as_varchar('Name of Due date') }} as "Due_date",
tableB."SLA_date" as "Expected_date",
tableA."Executed_date" as "Actual_date"
from {{ ref('tableA') }} as tableA
left join {{ ref('tableB') }} as tableB
on tableA."Case_ID" = tableB."Case_ID"
select
tableA."Case_ID",
{{ pm_utils.as_varchar('Name of Due date') }} as "Due_date",
tableB."SLA_date" as "Expected_date",
tableA."Executed_date" as "Actual_date"
from {{ ref('tableA') }} as tableA
left join {{ ref('tableB') }} as tableB
on tableA."Case_ID" = tableB."Case_ID"
The following code block shows an example SQL query to configure due dates.
select
Due_dates_base."Case_ID",
Due_dates_base."Due_date",
Due_dates_base."Actual_date",
Due_dates_base."Expected_date",
{{ pm_utils.as_varchar('Type of Due date') }} as "Due_date_type",
case
when Due_dates_base."Actual_date" <= Due_dates_base."Expected_date"
then {{ pm_utils.to_boolean('true') }}
else {{ pm_utils.to_boolean('false') }}
end as "On_time",
case
-- when actual or expected date are null
when Due_dates_base."Actual_date" is null or Due_dates_base."Expected_date" is null
then {{ pm_utils.to_double('null') }}
-- when the due date is on time, the cost is 0
when Due_dates_base."Actual_date" <= Due_dates_base."Expected_date"
then {{ pm_utils.to_double('0') }}
-- when the due date is late, configure a cost
when Due_dates_base."Expected_date" > Due_dates_base."Actual_date"
then {{ pm_utils.to_double('10') }}
end as "Cost",
{{ pm_utils.datediff('millisecond', 'Due_dates_base."Expected_date"', 'Due_dates_base."Actual_date"') }} as "Difference"
from Due_dates_base
select
Due_dates_base."Case_ID",
Due_dates_base."Due_date",
Due_dates_base."Actual_date",
Due_dates_base."Expected_date",
{{ pm_utils.as_varchar('Type of Due date') }} as "Due_date_type",
case
when Due_dates_base."Actual_date" <= Due_dates_base."Expected_date"
then {{ pm_utils.to_boolean('true') }}
else {{ pm_utils.to_boolean('false') }}
end as "On_time",
case
-- when actual or expected date are null
when Due_dates_base."Actual_date" is null or Due_dates_base."Expected_date" is null
then {{ pm_utils.to_double('null') }}
-- when the due date is on time, the cost is 0
when Due_dates_base."Actual_date" <= Due_dates_base."Expected_date"
then {{ pm_utils.to_double('0') }}
-- when the due date is late, configure a cost
when Due_dates_base."Expected_date" > Due_dates_base."Actual_date"
then {{ pm_utils.to_double('10') }}
end as "Cost",
{{ pm_utils.datediff('millisecond', 'Due_dates_base."Expected_date"', 'Due_dates_base."Actual_date"') }} as "Difference"
from Due_dates_base
This SQL code identifies cases where the last occurrence of activity 'X' was done before date 'Y'.
with Event_log_base as (
select * from {{ ref('Event_log_base') }}
),
Cases_base as (
select * from {{ ref('Cases_base') }}
),
-- Last activity X of each case
Last_activity_X as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'X'
group by Event_log_base."Case_ID"
),
-- Last activity X should be done before Case date field Y
Activity_X_done_before_date_Y as (
select
Last_activity_X."Case_ID",
{{ pm_utils.as_varchar('Last activity X before Cases date field Y') }} as "Due_date",
Last_activity_X."Event_end" as "Actual_date",
Cases_base."Case_date_field_Y" as "Expected_date",
Last_activity_X."Event_ID"
from Last_activity_X
inner join Cases_base
on Last_activity_X."Case_ID" = Cases_base."Case_ID"
)
select * from Activity_X_done_before_date_Y
with Event_log_base as (
select * from {{ ref('Event_log_base') }}
),
Cases_base as (
select * from {{ ref('Cases_base') }}
),
-- Last activity X of each case
Last_activity_X as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'X'
group by Event_log_base."Case_ID"
),
-- Last activity X should be done before Case date field Y
Activity_X_done_before_date_Y as (
select
Last_activity_X."Case_ID",
{{ pm_utils.as_varchar('Last activity X before Cases date field Y') }} as "Due_date",
Last_activity_X."Event_end" as "Actual_date",
Cases_base."Case_date_field_Y" as "Expected_date",
Last_activity_X."Event_ID"
from Last_activity_X
inner join Cases_base
on Last_activity_X."Case_ID" = Cases_base."Case_ID"
)
select * from Activity_X_done_before_date_Y
This SQL code identifies cases for which the last occurence of activity 'X' happened within 5 days after the last occurence of activity 'Y'.
with Event_log_base as (
select * from {{ ref('Event_log_base') }}
),
-- Last activity X of each case
Last_activity_X as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'X'
group by Event_log_base."Case_ID"
),
-- Last activity Y of each case
Last_activity_Y as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'Y'
group by Event_log_base."Case_ID"
),
-- Last activity X should be done at date of last Event Y + 5 days
Activity_X_done_within_5_days_after_activity_Y as (
select
Last_activity_Y."Case_ID",
{{ pm_utils.as_varchar('Last activity X before last activity Y + 5 days') }} as "Due_date",
{{ pm_utils.dateadd('day', 5, 'Last_activity_Y."Event_end"') }} as "Expected_date",
Last_activity_X."Event_end" as "Actual_date",
Last_activity_Y."Event_ID" as "Event_ID"
from Last_activity_Y
inner join Last_activity_X
on Last_activity_Y."Case_ID" = Last_activity_X."Case_ID"
)
select * from Activity_X_done_within_5_days_after_activity_Y
with Event_log_base as (
select * from {{ ref('Event_log_base') }}
),
-- Last activity X of each case
Last_activity_X as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'X'
group by Event_log_base."Case_ID"
),
-- Last activity Y of each case
Last_activity_Y as (
select
Event_log_base."Case_ID",
max(Event_log_base."Event_end") as "Event_end",
max(Event_log_base."Event_ID") as "Event_ID"
from Event_log_base
where Event_log_base."Activity" = 'Y'
group by Event_log_base."Case_ID"
),
-- Last activity X should be done at date of last Event Y + 5 days
Activity_X_done_within_5_days_after_activity_Y as (
select
Last_activity_Y."Case_ID",
{{ pm_utils.as_varchar('Last activity X before last activity Y + 5 days') }} as "Due_date",
{{ pm_utils.dateadd('day', 5, 'Last_activity_Y."Event_end"') }} as "Expected_date",
Last_activity_X."Event_end" as "Actual_date",
Last_activity_Y."Event_ID" as "Event_ID"
from Last_activity_Y
inner join Last_activity_X
on Last_activity_Y."Case_ID" = Last_activity_X."Case_ID"
)
select * from Activity_X_done_within_5_days_after_activity_Y