check_rule {processcheckR} | R Documentation |
Check Declarative Rule(s)
Description
This function can be used to check rules or constraint templates on event data.
It needs a log
(object of class log
or derivatives, e.g. grouped_log
,
eventlog
, activitylog
, etc.). and (a) rule
(s).
Rules can be made with the following templates:
-
Cardinality:
-
absent
: Check if the specified activity is absent from a case, -
contains
: Check if the specified activity is present (contained) in a case, -
contains_between
: Check if the specified activity is present (contained) in a case between the minimum and maximum number of times, -
contains_exactly
: Check if the specified activity is present (contained) in a case for exactlyn
times.
-
-
Relation:
-
ends
: Check if cases end with the specified activity, -
starts
: Check if cases start with the specified activity. -
precedence
: Check for precedence between two activities, -
response
: Check for response between two activities, -
responded_existence
: Check for responded existence between two activities, -
succession
: Check for succession between two activities.
-
-
Exclusiveness:
Usage
check_rule(log, rule, label = NULL, eventlog = deprecated())
## S3 method for class 'log'
check_rule(log, rule, label = NULL, eventlog = deprecated())
check_rules(log, ..., eventlog = deprecated())
## S3 method for class 'log'
check_rules(log, ..., eventlog = deprecated())
Arguments
log |
|
rule |
A rule created by a rule function. |
label |
|
eventlog |
|
... |
Name-rule pairs created by rule functions. |
Details
The rules or constraint templates in this package are (partially) based on DecSerFlow (Declarative Service Flow Language). For more information, see the References below.
Grouped Logs
When applied to a grouped_log
, the grouping variables are ignored but retained in the returned log.
Value
An annotated log (of same type as input), where – for every rule – a new column indicates whether the rule holds or not.
The name of the new column can optionally be set using the label
argument, or by the name of each rule in the name-rule pairs.
Methods (by class)
-
check_rule(log)
: Check rule on alog
.
Functions
-
check_rules(log)
: Check rules on alog
.
References
van der Aalst, W. M. P., & Pesic, M. (2006). DecSerFlow: Towards a Truly Declarative Service Flow Language. In M. Bravetti, M. Núñez, & G. Zavattaro (Eds.), Proceedings of the 3rd International Workshop on Web Services and Formal Methods (Vol. 4184, pp. 1–23). Springer. doi:10.1007/11841197_1
See Also
Examples
library(bupaR)
library(eventdataR)
# Check whether MRI Scan is preceded by Blood test.
patients %>%
check_rule(precedence("Blood test","MRI SCAN"))
# Check whether MRI Scan is preceded by Blood test, and the case starts with Registration.
patients %>%
check_rules(rule1 = precedence("Blood test","MRI SCAN"),
rule2 = starts("Registration"))