process-mining
2024.10
true
UiPath logo, featuring letters U and I in white
Process Mining
Automation CloudAutomation Cloud Public SectorAutomation SuiteStandalone
Last updated 2024年11月11日

标签

简介

Process Mining 中,标签是您应用于数据的业务规则,使您能够检查流程中的一致性,例如效率低下、返工或违规。

备注:
如果要使用“标签”仪表板来分析标签,则数据集中必须存在 Tags 表的字段。

配置标签

如果要使用“标签”仪表板来分析流程中的标签,则必须为应用程序模板定义标签。

对于某些应用程序模板,提供开箱即用标签,这些标签将显示在仪表板中。 在特定应用程序模板的文档中,您将找到可用标签的概述。 “应用程序模板”页面包含指向所有可用应用程序模板的文档的链接。

所有自定义流程应用程序模板都具有一个开箱即用标签,用于检查案例是否具有由不同用户执行的返工活动。

如果“标签”仪表板中没有可用数据,则您需要使用数据转换配置自己的标签。 在这里,您还可以根据业务需求配置任何默认标签。 下面概述了不同应用程序模板的标签配置文件。

应用程序模板基于

标签配置文件

事件日志

models\5_business_logic\Tags_base.sql
自定义流程1models\5_business_logic\Tags_base.sql

购买到付款

models\5_business_logic\Tags.sql

订单到现金

models\5_business_logic\Tags.sql
1) 这适用于自定义流程应用程序模板和基于自定义流程的所有其他应用程序模板,例如 SAP 仓库管理。
对于自定义流程,您也可以使用Tags_raw.csv文件上传标签。 请参阅自定义流程输入字段

在转换中添加业务逻辑

在最后一个转换步骤中,根据需要添加业务逻辑以进行数据分析。

标签表中的每条记录代表特定案例的一个标签。 示例标签包括:

  • 违反合同的 SLA。
  • 由未经授权的人付款。
此表的必填字段为 Case_IDTag

并非所有案例都有标签,有些案例可能有多个标签。

有关更多信息,请参阅数据转换

用于配置标签的 SQL 示例

以下是一些 SQL 示例,您可使用这些示例来配置使用转换的标签

注意:
以下 SQL 示例基于事件日志应用程序模板,并且用具有Case_ID 。 如果要使用 SQL 示例为“采购到付款”应用程序模板或“订单到现金”应用程序模板定义标签,请确保使用适当的实体和相关的内部“entity_ID”。 扩展标签的实现时,请遵循现有实现。

直接关注

此 SQL 代码可识别活动“X”后直接跟有活动“Y”的情况,并将其标记为“违规”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Event log with current activity and next activity
Event_log_extended as (
    select
        Event_log_base."Case_ID",
        Event_log_base."Activity" as "Current_activity",
        lead(Event_log_base."Activity") over (order by "Event_end") as "Next_activity"
    from Event_log_base
),

-- This SQL code checks whether activity X is directly followed by Y in a given case
Directly_follows as (
    select
        Event_log_extended ."Case_ID",
        {{ pm_utils.as_varchar('Activity X directly followed by activity Y') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_extended 
    where Event_log_extended ."Current_activity" = 'X' and Event_log_extended ."Next_activity" = 'Y'
    group by Event_log_extended ."Case_ID"
)

select * from Directly_followswith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Event log with current activity and next activity
Event_log_extended as (
    select
        Event_log_base."Case_ID",
        Event_log_base."Activity" as "Current_activity",
        lead(Event_log_base."Activity") over (order by "Event_end") as "Next_activity"
    from Event_log_base
),

-- This SQL code checks whether activity X is directly followed by Y in a given case
Directly_follows as (
    select
        Event_log_extended ."Case_ID",
        {{ pm_utils.as_varchar('Activity X directly followed by activity Y') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_extended 
    where Event_log_extended ."Current_activity" = 'X' and Event_log_extended ."Next_activity" = 'Y'
    group by Event_log_extended ."Case_ID"
)

select * from Directly_follows

间接关注

此 SQL 代码可识别活动“X”后直接或间接后跟活动“Y”的情况,并将其标记为“违规”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

Cases_with_activity_X as (
    select
        Event_log_base."Case_ID",
        min(Event_log_base."Event_end") as "Event_end"
    from Event_log_base
    where Event_log_base."Activity" = 'X'
    group by Event_log_base."Case_ID"
),

-- Activity X is directly or indirectly followed by activity Y
Indirectly_follows as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Activity X indirectly followed by activity Y') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_base
    inner join Cases_with_activity_X
        on Event_log_base."Case_ID" = Cases_with_activity_X."Case_ID"
    where Event_log_base."Activity" = 'Y' and Event_log_base."Event_end" > Cases_with_activity_X."Event_end"
    group by Event_log_base."Case_ID"
)

select * from Indirectly_followswith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

Cases_with_activity_X as (
    select
        Event_log_base."Case_ID",
        min(Event_log_base."Event_end") as "Event_end"
    from Event_log_base
    where Event_log_base."Activity" = 'X'
    group by Event_log_base."Case_ID"
),

-- Activity X is directly or indirectly followed by activity Y
Indirectly_follows as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Activity X indirectly followed by activity Y') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_base
    inner join Cases_with_activity_X
        on Event_log_base."Case_ID" = Cases_with_activity_X."Case_ID"
    where Event_log_base."Activity" = 'Y' and Event_log_base."Event_end" > Cases_with_activity_X."Event_end"
    group by Event_log_base."Case_ID"
)

select * from Indirectly_follows

活动 X 多次

此 SQL 代码可识别多次发生活动“X”的情况,并将其标记为“效率低下”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- This SQL code checks if Activity X occurs twice or more times in the same case
Activity_X_multiple_times as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Activity X multiple times') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Event_log_base
    where Event_log_base."Activity" = 'X'
    group by Event_log_base."Case_ID"
    having count(Event_log_base."Activity") > 1
)

select * from Activity_X_multiple_timeswith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- This SQL code checks if Activity X occurs twice or more times in the same case
Activity_X_multiple_times as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Activity X multiple times') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Event_log_base
    where Event_log_base."Activity" = 'X'
    group by Event_log_base."Case_ID"
    having count(Event_log_base."Activity") > 1
)

select * from Activity_X_multiple_times

案例包含活动 X

此 SQL 代码可识别具有一个或多个名称中包含“X”的活动的案例,并将其标记为“效率低下”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Case has activity with name like X
Case_has_activity_X as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Case has activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Event_log_base
    where {{ pm_utils.charindex('X', 'Event_log_base."Activity"') }} > 0
    group by Event_log_base."Case_ID"
)

select * from Case_has_activity_Xwith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Case has activity with name like X
Case_has_activity_X as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.as_varchar('Case has activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Event_log_base
    where {{ pm_utils.charindex('X', 'Event_log_base."Activity"') }} > 0
    group by Event_log_base."Case_ID"
)

select * from Case_has_activity_X

案例没有活动 X

此 SQL 代码可识别不存在名称中包含“X”的活动的案例,并将其标记为“效率低下”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

Cases as (
    select * from {{ ref('Cases') }}
),

-- Case has no activity with name like X
-- Obtained by subtracting the set of cases that have activity X from the set of all cases
Case_has_no_activity_X as (
    select
        Cases."Case_ID",
        {{ pm_utils.as_varchar('Case has no activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Cases
    where Cases."Case_ID" not in (
        -- Case has activity with name like X
        select
            Event_log_base."Case_ID"
        from Event_log_base
        where {{ pm_utils.charindex('X', 'Event_log_base."Activity"') }} > 0
        group by Event_log_base."Case_ID"
    )
)

select * from Case_has_no_activity_Xwith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

Cases as (
    select * from {{ ref('Cases') }}
),

-- Case has no activity with name like X
-- Obtained by subtracting the set of cases that have activity X from the set of all cases
Case_has_no_activity_X as (
    select
        Cases."Case_ID",
        {{ pm_utils.as_varchar('Case has no activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from Cases
    where Cases."Case_ID" not in (
        -- Case has activity with name like X
        select
            Event_log_base."Case_ID"
        from Event_log_base
        where {{ pm_utils.charindex('X', 'Event_log_base."Activity"') }} > 0
        group by Event_log_base."Case_ID"
    )
)

select * from Case_has_no_activity_X

开头为

此 SQL 代码可识别以活动“X”开头的案例,并将其标记为“违规”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Add row_number to initial event log
Event_log_base_numbered as (
    select
        Event_log_base."Case_ID",
        Event_log_base."Activity",
        Event_log_base."Event_end",
        row_number() over (partition by Event_log_base."Case_ID" order by Event_log_base."Event_end") as "Row_number"
    from Event_log_base
),

-- Case starts with activity X
Starts_with as (
    select
        Event_log_base_numbered."Case_ID",
        {{ pm_utils.as_varchar('Case starts with activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_base_numbered
    where
        Event_log_base_numbered."Row_number" = 1
        and Event_log_base_numbered."Activity" = 'X'
)

select * from Starts_withwith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Add row_number to initial event log
Event_log_base_numbered as (
    select
        Event_log_base."Case_ID",
        Event_log_base."Activity",
        Event_log_base."Event_end",
        row_number() over (partition by Event_log_base."Case_ID" order by Event_log_base."Event_end") as "Row_number"
    from Event_log_base
),

-- Case starts with activity X
Starts_with as (
    select
        Event_log_base_numbered."Case_ID",
        {{ pm_utils.as_varchar('Case starts with activity X') }} as "Tag",
        {{ pm_utils.as_varchar('Violation') }} as "Tag_type"
    from Event_log_base_numbered
    where
        Event_log_base_numbered."Row_number" = 1
        and Event_log_base_numbered."Activity" = 'X'
)

select * from Starts_with

吞吐时间超过 10 天

此 SQL 代码可识别吞吐时间超过 10 天的案例,并将其标记为“低效率”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Throuput time of each case
Throughput_time_per_case as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.datediff('day', 'coalesce(min(Event_log_base."Event_start"), min(Event_log_base."Event_end"))', 'max(Event_log_base."Event_end")') }} as "Throughput_time"
    from Event_log_base
    group by Event_log_base."Case_ID"
),

-- Case throughput time is longer than 10 days
Throughput_time_longer_than_10_days as (
    select
        Throughput_time_per_case."Case_ID",
        {{ pm_utils.as_varchar('Throughput time is longer than 10 days') }} as "Tag",
        {{ pm_utils.as_varchar('Inneficiency') }} as "Tag_type"
    from Throughput_time_per_case
    where Throughput_time_per_case."Throughput_time" > 10
)

select * from Throughput_time_longer_than_10_dayswith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- Throuput time of each case
Throughput_time_per_case as (
    select
        Event_log_base."Case_ID",
        {{ pm_utils.datediff('day', 'coalesce(min(Event_log_base."Event_start"), min(Event_log_base."Event_end"))', 'max(Event_log_base."Event_end")') }} as "Throughput_time"
    from Event_log_base
    group by Event_log_base."Case_ID"
),

-- Case throughput time is longer than 10 days
Throughput_time_longer_than_10_days as (
    select
        Throughput_time_per_case."Case_ID",
        {{ pm_utils.as_varchar('Throughput time is longer than 10 days') }} as "Tag",
        {{ pm_utils.as_varchar('Inneficiency') }} as "Tag_type"
    from Throughput_time_per_case
    where Throughput_time_per_case."Throughput_time" > 10
)

select * from Throughput_time_longer_than_10_days

持续时间超过 30 分钟

此 SQL 代码可识别活动“X”和活动“Y”之间的持续时间超过 30 分钟的情况,并将其标记为“低效率”。

with Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- First activity X of each case
First_activity_X_of_each_case as (
    select
        Event_log_base."Case_ID",
        min(Event_log_base."Event_end") as "Event_end"
    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_of_each_case as (
    select
        Event_log_base."Case_ID",
        max(Event_log_base."Event_end") as "Event_end"
    from Event_log_base
    where Event_log_base."Activity" = 'Y'
    group by Event_log_base."Case_ID"
),

-- Time between first X and last Y > 30 minutes
Duration_more_than_30_minutes as (
    select
        First_activity_X_of_each_case."Case_ID",
        {{ pm_utils.as_varchar('Duration more than 30 minutes') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from First_activity_X_of_each_case
    inner join Last_activity_Y_of_each_case
        on First_activity_X_of_each_case."Case_ID" = Last_activity_Y_of_each_case."Case_ID"
    where {{ pm_utils.datediff('minute', 'First_activity_X_of_each_case."Event_end"', 'Last_activity_Y_of_each_case."Event_end"') }} > 30
)

select * from Duration_more_than_30_minuteswith Event_log_base as (
    select * from {{ ref('Event_log_base') }}
),

-- First activity X of each case
First_activity_X_of_each_case as (
    select
        Event_log_base."Case_ID",
        min(Event_log_base."Event_end") as "Event_end"
    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_of_each_case as (
    select
        Event_log_base."Case_ID",
        max(Event_log_base."Event_end") as "Event_end"
    from Event_log_base
    where Event_log_base."Activity" = 'Y'
    group by Event_log_base."Case_ID"
),

-- Time between first X and last Y > 30 minutes
Duration_more_than_30_minutes as (
    select
        First_activity_X_of_each_case."Case_ID",
        {{ pm_utils.as_varchar('Duration more than 30 minutes') }} as "Tag",
        {{ pm_utils.as_varchar('Inefficiency') }} as "Tag_type"
    from First_activity_X_of_each_case
    inner join Last_activity_Y_of_each_case
        on First_activity_X_of_each_case."Case_ID" = Last_activity_Y_of_each_case."Case_ID"
    where {{ pm_utils.datediff('minute', 'First_activity_X_of_each_case."Event_end"', 'Last_activity_Y_of_each_case."Event_end"') }} > 30
)

select * from Duration_more_than_30_minutes

分析标签

标签仪表板

标签”仪表板使您能够分析流程中出现的标签。

请按照以下步骤显示“标签”仪表板。

  1. 在仪表板左侧的菜单中选择“标签”。

系统将显示“标签”仪表板。

指标

以下是可用于分析标签用例的指标的说明。

指标

描述

案例数

已分配标签的用例数量。

标签数

分配的标签数量。

  • 简介
  • 配置标签
  • 在转换中添加业务逻辑
  • 用于配置标签的 SQL 示例
  • 分析标签
  • 标签仪表板

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2024 UiPath。保留所有权利。