filter_rules {processcheckR} | R Documentation |
Filter Using Declarative Rules
Description
This function can be used to filter event data using declaritive rules or constraint templates.
It needs a log
(object of class log
or derivatives, e.g. grouped_log
,
eventlog
, activitylog
, etc.). and a set of rules
.
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
filter_rules(log, ..., eventlog = deprecated())
## S3 method for class 'log'
filter_rules(log, ..., eventlog = deprecated())
Arguments
log |
|
... |
Name-rule pairs created by rule functions. |
eventlog |
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
A filtered log (of same type as input) that satisfied the specified rules.
Methods (by class)
-
filter_rules(log)
: Filter alog
using declaritive rules.
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)
# Filter where Blood test precedes MRI SCAN and Registration is the start of the case.
patients %>%
filter_rules(precedence("Blood test","MRI SCAN"),
starts("Registration"))