Process Mining Objects in Expression Language

From QPR ProcessAnalyzer Wiki
Revision as of 20:45, 23 January 2018 by Ollvihe (talk | contribs) (→‎Array)
Jump to navigation Jump to search

This chapter lists all the object types in the expresssion language and properties and functions that they support. After the property or function name there is the type of the returned object mentioned. Asterisk (*) after the type means that it returns an array of objects.

Array

Array functions Parameters Description
IndexOfSubArray (Integer)
  1. Optional object on which to operate
  2. Sub-array to search(array)
  3. Array from where to search the sub-array (array)

Returns the indexes of given sub-array (1. parameter) within the given array (2. parameter). If not given, the array in the current context object is used. Returns starting indexes of all the occurrences of given sub-array within given array. Examples:

[[1,2,3,4,1,2,5]].IndexOfSubArray([1,2])
IndexOfSubArray([1,2], [1,2,3,4,1,2,5])
Return: [0, 4]

[[1,2,3,4,1,2,5]].IndexOfSubArray([1,2,3,4,5])
Returns: []

[[1,2,3,4,1,2,5],[3,4],[0,1,2,3]]:IndexOfSubArray([1,2])
Returns:
[
  HierarchicalArray([1,2,3,4,1,2,5], [0,4]),
  HierarchicalArray([0,1,2,3], [1])
]

AttributeType

AttributeType functions Description
EventsHavingValue
  1. Value to use for matching.

Returns all the event objects that have given value for this attribute. If the attribute type is a case attribute, then all the returned events belong to a case that has the specified value as the value of this case attribute. If the attribute type is an event attribute, then all the returned events have the specified value as the value of this event attribute.

Examples:

eventLog.EventAttributes.Where(Name=="SAP_User").EventsHavingValue("James")
Returns: An array of events that have "James" as the value of "SAP_User" event attribute.

eventLog.EventAttributes:EventsHavingValue("James")
Returns: A hierarchical array of event attributes with each having a sub array of events that have "James" as the value of the parent event attribute.

eventLog.CaseAttributes.Where(Name=="Region").EventsHavingValue("Dallas")
Returns: An array of events that have "Dallas" as the value of their case's "Region" case attribute.

eventLog.CaseAttributes:EventsHavingValue("Dallas")
Returns: A hierarchical array of case attributes with each having a sub array of events that have "Dallas" as the value of the parent case attribute of their case.
CasesHavingValue
  1. Value to use for matching.

Returns all the case objects that have given value for this attribute. If the attribute type is a case attribute, then all the returned cases have the specified value as the value of this case attribute. If the attribute type is an event attribute, then all the returned cases have at least one event that has the specified value as the value of this event attribute.

Examples:

eventLog.EventAttributes.Where(Name=="SAP_User").CasesHavingValue("James")
Returns: An array of cases that have at least one event which has "James" as the value of "SAP_User" event attribute.

eventLog.EventAttributes:CasesHavingValue("James")
Returns: A hierarchical array of event attributes with each having a sub array of cases that have at least one event which has "James" as the value of the parent event attribute.

eventLog.CaseAttributes.Where(Name=="Region").CasesHavingValue("Dallas")
Returns: An array of cases that have "Dallas" as the value of "Region" case attribute.

eventLog.CaseAttributes:CasesHavingValue("Dallas")
Returns: A hierarchical array of case attributes with each having a sub array of cases that have "Dallas" as the value of the parent case attribute.
Case properties Description
Id (Integer) AttributeType Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
Name (String) Attribute name.
Values (String Array) Returns an array of all the existing unique values for this attribute type.

Case

Case properties Description
Duration (TimeSpan) Case duration, i.e. duration between case start and case end time.
EndTime (DateTime) Case end time, i.e. timestamp of the last event.
Events (Event) All events of the case.
FlowOccurrences (FlowOccurrence) All flow occurrences the case contains.
Flows (Flow) All flows the case goes through.
Id (Integer) Case Id. Case id is generated by QPR ProcessAnalyzer when the model is loaded.
Name (String) Case name. The case name comes with the source data when data is imported to QPR ProcessAnalyzer.
StartTime (DateTime) Case start time, i.e. timestamp of the first event.
Variation (Variation) Variation the case belongs to.
Case functions Parameters Description
Attribute (Object)
  • attribute name (string)
Returns case attribute value. Case attribute name is provided as a parameter. This function is needed when there are spaces in the case attribute name. If there are no spaces, syntax .attributeName can be used.
EventsByType (Event*)
  • EventType object or EventType name (string)

(Available in QPR ProcessAnalyzer 2018.1) Returns all Events of this case which are of given type. The parameter can be either EventType object or the name of the event as a string.

Examples:

case.EventsByType("Invoice")
Returns: Array of events having event type named "Invoice".

case.EventsByType((EventLog.EventTypes.Where(Name=="Invoice"))[0])
Returns: Array of events having event type named "Invoice".
FlowOccurrencesByType (FlowOccurrence*)
  • Flow object or id of FlowOccurrence(integer)

(Available in QPR ProcessAnalyzer 2018.1) Returns all FlowOccurrences of this case which are of given type. The parameter can be either a Flow object or an integer identifying the id of the flow occurrence.

Examples:

case.FlowOccurrencesByType(EventLog.Flows[0])
Returns: All the flow occurrences in the case belonging to the first flow in event log.

case.FlowOccurrencesByType(EventLog.Flows[0].Id)
Returns: All the flow occurrences in the case belonging to the first flow in event log.

DateTime

DateTime represents a timestamp.

DateTime properties Description
Day (Integer) The day of the calendar month represented by the DateTime. Number between 1 and 31.
Hour (Integer) The hour component of the date represented by the DateTime. Number between 0 and 23.
Millisecond (Integer) The millisecond component of the date represented by the DateTime. Number between 0 and 999.
Minute (Integer) The minute component of the date represented by the DateTime. Number between 0 and 59.
Month (Integer) The calendar month component of the date represented by the DateTime. Number between 1 and 12.
Second (Integer) The second component of the date represented by the DateTime. Number between 0 and 59.
Ticks (Integer) Number of ticks represented by the DateTime.
Year (Integer) The year component of the date represented by the DateTime. Number between 1 and 9999.
DateTime functions Parameters Description
Round (DateTime)
  • attribute name (TimeSpan)

Rounds the DateTime to the defined TimeSpan.

Example:

Round to the nearest hour:
Round(DateTime(2017, 1, 1, 14, 48), TimeSpan(0, 1))

Event

Event properties Description
Case (Case) Case the event belongs to.
Id (Integer) Event id. It's generated by QPR ProcessAnalyzer when the model is loaded.
IndexInCase (Integer) Index (running) number of the event in the case (ordered temporally). The first event has index number 0.
IncomingFlowOccurrences (FlowOccurrence*) (Available in QPR ProcessAnalyzer 2018.1) All FlowOccurrencies that end to this Event.
Model (Model) Model the event belongs to.
NextInCase (Event) Temporally next event in the case. For the last event, return EMPTY.
PreviousInCase (Event) Temporally previous event in the case. For the first event, return EMPTY.
OutgoingFlowOccurrences (FlowOccurrence*) (Available in QPR ProcessAnalyzer 2018.1) All FlowOccurrencies that start from this Event.
TimeStamp (DateTime) Timestamp of the event.
Type (EvenType) Event type of the event.
Event functions Parameters Description
Attribute (object)
  • attribute name (string)
Return event attribute value. Event attribute name is provided as a parameter. This function is needed when there are spaces in the event attribute name. If there are no spaces, syntax .attributeName can be used.

EventLog

EventLog is a list of events that is a result of a filtering operation. Also Model contain an EventLog composing of the whole model contents. i.e. filters have been applied yet. EventLogs can be fetched by the filter id using function EventLogById(filterId).

EventLog properties Description
CaseAttributes (AttributeType*) Used case attribute in the EventLog.
Cases (Case*) Cases that belong to the EventLog.
EventAttributes (AttributeType*) Used event attributes in the EventLog.
Events (Event*) Events that belong to the EventLog.
EventTypes (EventType*) EventTypes in the EventLog.
FilterEventLog Returns EventLog object representing all the available events in the filter in which the current event log resides (if the event log has, e.g., applied selection filters).
Flows (Flow*) Flows that the part of the EventLog.
Id (Integer) EventLog Id.
Model (Model) Model where the EventLog belongs.
ModelEventLog Returns EventLog representing all the available events in the model in which the current event log resides.
Name EventLog name.
Variations (Variation*) Variations that are in the EventLog
EventLog functions Parameters Description
EventsByType (Event*)
  • EventType object or EventType name (string)

(Available in QPR ProcessAnalyzer 2018.1) Returns all Events from this EventLog which are of the given type.

Examples:

eventLog.EventsByType("Invoice")
Returns: Array of events having event type named "Invoice".

case.EventsByType((EventLog.EventTypes.Where(Name=="Invoice"))[0])
Returns: Array of events having event type named "Invoice".

EventType

EventType properties Description
Cases (Case*) Cases that have events of this EventType.
Count (Integer) Number of Events that have this EventType.
Events (Event*) Events of that EventType.
Id (Integer) EventType Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
IncomingFlows (Flow*) All Flows that start from the EventType.
Name (string) EventType name.
OutgoingFlows (Flow*) All Flows that end to the EventType.
UniqueCount (Integer) Number of Cases having events of this EventType.

Expression

Expression is an object type that encapsulates a KPI expression language expression. Expression inside expression object can be evaluated by using the expression object as if it was a function by using <expression object name>(<parameter list>) syntax. Expression objects can be created in the following ways:

  • Using Def function
  • Whenever & prefix is used in Def function for an attribute

Examples:

Def(null, "a", "b", a+b)._(1,2)
Returns: 3

[Def("", "a", "b", a+b), Def("", "a", "b", a*b)].(_(1,2))
Returns: [3, 2]

Flow

Flow is a combination of two EventTypes where there are FlowOccurrences between them. Unlike FlowOccurrencies, a Flow is not related to a single case. Flowchart shows Flows and EventTypes (not FlowOccurences or Events). In a Case, the may be several FlowOccurrences of a single Flow.

Flow properties Description
Cases (Case*) Cases that contain the flow, i.e. there is a flow occurrence between Flow's starting and ending events.
FlowOccurrences (FlowOccurrence*) Flow occurrences the flow belongs to.
From (EventType) EventType from which this Flow starts.
Id (Integer) Flow Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
Name (String) Identifying name of the Flow.
To (EventType) EventType to which this Flow ends.

FlowOccurrence

FlowOccurrence represents a transition from an event to another event in a case. Thus, FlowOccurrence is related to a single case. There is also a FlowOccurrence from the "start" of the case to the first event of the case, and a FlowOccurrence from the last event of the case to the "end" of the case. Corresponding flow is visible in BPMN kind of flowcharts showing separate start and event icons. Thus, there are one more FlowOccurrences in a case than the number of events.

FlowOccurrence properties Description
Case (Case) Case the current FlowOccurrence belongs to.
Flow (Flow) Corresponding Flow of the current FlowOccurrence.
From (Event) Event where the current FlowOccurrence starts.
Id (Integer) FlowOccurrence Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
Name (String) Identifying name of the current FlowOccurrence.
OccurrenceIndex (Integer) Number tells how many times the current FlowOccurrence has occurred in the case until that point.
To (Event) Event where the this FlowOccurrence ends.

Model

Model properties Description
CaseAttributes (AttributeType*) CaseAttributes of the model.
DefaultFilterId (Integer) Id of the default filter for the model.
EventAttributes (AttributeType*) EventAttributes of the model.
EventLog (EventLog) EventLog of the model. Model EventLog contains all events of the model, i.e. no filters have been applied.
Id (Integer) Model Id. Model Id is generated by QPR ProcessAnalyzer when the model is created.
Name (String) Name of the model.
Project (Project) The Project the this model belongs to.

TimeSpan

TimeSpan represents a temporal duration. TimeSpan is not bound to calendar time. Difference between two TimeStamps is TimeSpan. TimeStamp added by TimeSpan is TimeStamp.

TimeSpan properties Description
Ticks (Integer) Number of ticks represented by the TimeSpan.
TotalDays (Float) TimeSpan value in days (one day is 24 hours) (both whole and fractional).
TotalHours (Float) TimeSpan value in hours (both whole and fractional).
TotalMilliseconds (Float) TimeSpan value in milliseconds (both whole and fractional).
TotalMinutes (Float) TimeSpan value in minutes (both whole and fractional).
TotalSeconds (Float) TimeSpan value in seconds (both whole and fractional).

Project

Project properties Description
Id (Integer) Id of the Project.
Name (String) Name of the Project.
Models (Model*) Models that belong to this Project.

Variation

Variation properties Description
CaseCount (Integer) Number of cases in the variation.
Cases (Case*) Cases that belong to the variation.
EventTypeCount (Integer) Number of events in the variation.
EventTypes (EventType*) Event types belonging to the variation.
Flows (Flow*) (Available in QPR ProcessAnalyzer 2018.1) Flows that belong to the variation.
Id (Integer) Variation Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
UniqueEventTypeCount (Integer) Number of different (unique) event types in the variation.