Process Mining Objects in Expression Language: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
(126 intermediate revisions by the same user not shown)
Line 2: Line 2:


In the tables in this page, after the property or function name there is the type of the returned object in parenthesis. Asterisk (*) after the type means that the return value is an array of objects (multiple objects instead of one).
In the tables in this page, after the property or function name there is the type of the returned object in parenthesis. Asterisk (*) after the type means that the return value is an array of objects (multiple objects instead of one).
= QPR ProcessAnalyzer objects =
 
== AttributeType ==
== AttributeType ==
{| class="wikitable"
!'''AttributeType properties'''
! '''Description'''
|-
||CalculationExpression (String)
||Expression used to calculate values for the calculated attribute. Value is ''null'' if the attribute is ''imported''.
|-
||Datatype (String)
||Data type of the attribute. For imported attributes, the data type comes from the datasource (e.g. datatable column datatype). For calculated attributes, the data type is explicitly defined for the attribute (the actual data produced by the calculation expression must match with the attribute data type).
|-
||Id (Integer)
||AttributeType Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
|-
||EventLog (EventLog)
||EventLog where the attribute belongs to.
|-
||Name (String)
||Attribute name.
|-
||UniqueCount (Integer)
||Returns the number of unique (different) values that this AttributeType contains in this EventLog (with filters applied). The result is same as ''Count(Values)'' except performance is better and memory consumption is lower.
|-
||ValueOrigin (String)
||Describes where the attribute values are coming from as follows:
* '''Calculated''': Attribute values are calculated during the model loading using an expression.
* '''Imported''': Attribute values are imported to QPR ProcessAnalyzer, e.g. they are in a datatable or they are read from the ODBC data source.
An attribute may also be both, so the value is imported but there is also a calculation expression for the attribute. In that case, the attribute is considered ''calculated''. In the calculation expression, the imported value can be used as an input.
|-
||Values (String Array)
||Returns an array of all unique values (duplicates removed) that this AttributeType contains in this EventLog (with filters applied).
|}


{| class="wikitable"
{| class="wikitable"
Line 51: Line 84:
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.
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.
</pre>  
</pre>  
|}
{| class="wikitable"
!'''AttributeType 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 AttributeType.
|}
|}


Line 74: Line 93:
! '''Description'''
! '''Description'''
|-
|-
||Duration (TimeSpan)
||Duration (Timespan)
||Case duration, i.e. duration between Case start and Case end time. Case duration is zero for Cases having only one Event.
||Case duration, i.e. duration between Case start and Case end time. Case duration is zero for Cases having only one Event.
|-
|-
||EndTime (DateTime)
||EndTime (DateTime)
||Case end time, i.e. timestamp of the last Event.
||Case end time, i.e. timestamp of the last Event.
|-
||EventLog (EventLog)
||EventLog where the Case belongs to.
|-
|-
||Events (Event*)
||Events (Event*)
Line 118: Line 140:
# Parameters
# Parameters
||
||
Checks whether the Case conforms with given [[Conformance_Checking_in_QPR_ProcessAnalyzer#DesignModel|DesignModel]] and reports a list of violations if the case doesn't conform. The function returns an array where the first item is the [[Conformance_Checking_in_QPR_ProcessAnalyzer#Identified_Reasons_for_Nonconformance|nonconformance reason]] as an integer. Next items in the array depends on the reasons, and thus there may be none or several further items in the array.
Checks whether the Case conforms with given [[Conformance_Checking#DesignModel|DesignModel]] and reports a list of violations if the case doesn't conform. The function returns an array where the first item is the [[Conformance_Checking#Identified_Reasons_for_Nonconformance|nonconformance reason]] as an integer. Next items in the array depends on the reasons, and thus there may be none or several further items in the array.


The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: [[Conformance_Checking_in_QPR_ProcessAnalyzer#Conformance_Checking_Settings|allowed settings]]).
The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: [[Conformance_Checking#Conformance_Checking_Settings|allowed settings]]).


Examples:
Examples:
<pre>
<pre>
Let("myConformanceModel", ConformanceModelFromXml(xml));
let myConformanceModel = DesignModelFromXml(xml);
Let("myEventLog", EventLogById(1));
let myEventLog = EventLogById(1);
Let("cases", OrderBy(EventLogById(1).Cases, Name));
let cases = OrderBy(EventLogById(1).Cases, Name);
cases.(
cases.(
   Let("analysis",AnalyzeConformance(myConformanceModel)),
   Let("analysis",AnalyzeConformance(myConformanceModel)),
Line 145: Line 167:
</pre>
</pre>
|-
|-
|| Attribute (Object)
||Attribute (Object)
||
attribute name (string)
||Returns case attribute value for a case attribute provided as a parameter. This function must be used when there are spaces in the case attribute name. If there are no spaces, syntax '''.attributeName''' can be used.
 
If the case attribute is not found, en error is given.
|-
||Duration (Timespan)
||Business calendar
||Case duration (i.e. duration between Case start and Case end time) taking into account the provided business calendar.
|-
||DurationBetweenEvents (Timespan)
||
# Starting event (String, String*, EventType or EventType*)
# Ending event (String, String*, EventType or EventType*)
# Starting event occurrence index (Integer)
# Ending  event occurrence index (Integer)
# Business calendar
||
Returns duration between two specified events in the Case. Returns ''null'', if the duration cannot be calculated in the following situations:
* Specified starting or ending event doesn't occur in the Case
* Ending event occurs before the starting event
* Starting or ending event doesn't occur the defined occurrence index number of times
 
Several EventTypes for the starting and ending event can also be defined. Then the first occurred event is chosen if the occurrence index is positive, and the last occurred event is chosen, if the occurrence index is negative.
 
When the 3. and 4. parameters are not defined, the first occurrence of the starting event is chosen and the last occurrence of the ending event.
 
Parameters:
# '''Starting event''': Starting event name to calculate the duration. This parameter can also be given as an EventType object, and both can also be given as an array to define several types of events.
# '''Ending event''': Ending event name or EventType object to calculate the duration. This parameter can also be given as an EventType object, and both can also be given as an array to define several types of events. Default value is same as the starting event
# '''Starting event occurrence index''' (default 0): Specifies which event occurrence to choose if the Case has multiple occurrences of the specified event. First occurence is 0, the second is 1 and so on. The last occurence is -1 and the second from the end is -2. Default value is 0.
# '''Ending event occurrence index''' (default -1): Same logic as in the ''Starting event order number'' parameter. Default value is -1.
# '''Business calender''': Optional [[Business_Calendar|business calendar]]. If provided, the duration is calculated based on the business calendar instead of 24 hours per day.
<pre>
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Product returned");
Returns: Duration between the first "Order confirmation" and last "Product returned".
 
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Product returned", 0, 0);
Returns: Duration between the first "Order confirmation" and first "Product returned".
 
EventLogById(1).Cases[0].DurationBetweenEvents(["Order confirmation", "Order received"], "Product returned");
Returns: Duration between the first "Order confirmation" or "Order received" (which one occurs first) and last "Product returned".
 
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Order confirmation", 0, 1);
Returns: Duration between the first and second "Order confirmation".
 
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Order confirmation", 0, 1, myBusinessCalendar1);
Returns: Duration between the first and second "Order confirmation".
 
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation");
Returns: Duration between the first and last "Order confirmation".
</pre>
|-
||EventCountByType (Integer)
||
* EventType object(s) or EventType name(s) (string or array)
||
||
* attribute name (string)
Returns the number of Events in the Case, that are of given type(s). Can be either EventType object, a string identifying the name of the event type, or an array of EventType objects and event type name strings.
||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.
 
Examples:
<pre>
EventLogById(1).EventCountByType("Invoice")
Returns: Number of "Invoice" type of events in the event log with filter id = 1
 
EventLogById(1).EventCountByType(EventLog.EventTypes.Where(Name=="Invoice"))
Returns: Number of "Invoice" type of events in the event log with filter id = 1
 
EventLogById(1).EventCountByType(["Invoice", "Shipment"])
Returns: Number of "Invoice" and "Shipment" type of events in the event log with filter id = 1
 
EventLogById(1).EventCountByType(EventLog.EventTypes.Where(Name=="Invoice" || Name=="Shipment"))
Returns: Number of "Invoice" and "Shipment" type of events in the event log with filter id = 1
</pre>
|-
|-
|| EventsByType (Event*)
|| EventsByType (Event*)
||
||
* EventType object or EventType name (string or array)
* EventType object(s) or EventType name(s) (string or array)
||
||
Returns all Events in the Case which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.
Returns all Events in the Case which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.
Line 171: Line 263:
</pre>
</pre>
|-
|-
|| EventTimeStampsByType ()
|| EventTimestampsByType (DateTime*)
||
||
*  
* EventType object(s) or EventType name(s) (string or array)
||
||
Returns all timestamps of all the Events of this Case of events which are of given type. This function behaves the same as first using EventsByType function for a case followed by querying TimeStamp property for each returned event. The only difference is that this function is more efficient.
Returns timestamps of all Events of given type in the Case.
2. Parameters:
 
2.1. type: Can be either EventType (#27616#) -object, a string identifying the name of the event type, or an array of EventType -objects and event type name strings.
Example:
2.1.1. If EventType -object, specifies the event type for events that will be returned.
<pre>
2.1.2. If string, specifies the name of the event type for events that will be returned.
case.EventTimestampsByType("Invoice")
2.1.3. If an array, specifies all the types of event types to be returned.
</pre>
3. Returns all the event objects in this case matching given event type.
Note: The result is same than (except the first one is faster to calculate):
<pre>
case.EventsByType("Invoice").Timestamps
</pre>


NOTE:
The result of:
  case.EventsByType("Invoice").Timestamps
is equal to:
  case.EventTimeStampsByType("Invoice")
|-
|-
|| FlowOccurrencesByType (FlowOccurrence*)
|| FlowOccurrencesByType (FlowOccurrence*)
Line 209: Line 299:
# Parameters
# Parameters
||
||
Checks whether the Case conforms with given [[Conformance_Checking_in_QPR_ProcessAnalyzer#ConformanceModel|ConformanceModel]]. Returns ''true'' if the Case conforms with the given design model.
Checks whether the Case conforms with given [[Conformance_Checking#ConformanceModel|ConformanceModel]]. Returns ''true'' if the Case conforms with the given design model.


The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: [[Conformance_Checking_in_QPR_ProcessAnalyzer#Conformance_Checking_Settings|allowed settings]]).
The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: [[Conformance_Checking#Conformance_Checking_Settings|allowed settings]]).


Examples:
Examples:
<pre>
<pre>
Let("myConformanceModel", ConformanceModelFromXml(xml));
let myConformanceModel = DesignModelFromXml(xml);
Let("myEventlog", EventLogById(1));
let myEventlog = EventLogById(1);
Count(myEventlog.Cases.Where(IsConformant(myConformanceModel))) / Count(myEventlog.Cases)
Count(myEventlog.Cases.Where(IsConformant(myConformanceModel))) / Count(myEventlog.Cases)


Line 231: Line 321:
||Case (Case)
||Case (Case)
||Case the event belongs to.
||Case the event belongs to.
|-
||EventLog (EventLog)
||EventLog where the Event belongs to.
|-
|-
||Id (Integer)
||Id (Integer)
Line 240: Line 333:
||IncomingFlowOccurrence (FlowOccurrence)
||IncomingFlowOccurrence (FlowOccurrence)
||Preceding FlowOccurrence of the Event.
||Preceding FlowOccurrence of the Event.
|-
||Model (Model)
||Model the event belongs to.
|-
|-
||NextInCase (Event)
||NextInCase (Event)
||Temporally next event in the case. For the last event, return EMPTY.
||Temporally next event in the case. For the last event, return EMPTY.
|-
||OutgoingFlowOccurrence (FlowOccurrence)
||The following FlowOccurrence of the Event.
|-
|-
||PreviousInCase (Event)
||PreviousInCase (Event)
||Temporally previous event in the case. For the first event, return EMPTY.
||Temporally previous event in the case. For the first event, return EMPTY.
|-
|-
||OutgoingFlowOccurrence (FlowOccurrence)
||Timestamp (DateTime)
||The following FlowOccurrence of the Event.
||Timestamp of the Event.
|-
||TimeStamp (DateTime)
||Timestamp of the event.
|-
|-
||Type (EventType)
||Type (EventType)
Line 271: Line 361:
||
||
* attribute name (string)
* 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.
||Return event attribute value for an event attribute provided as a parameter. This function must be used when there are spaces in the event attribute name. If there are no spaces, syntax '''.attributeName''' can be used.
 
If the case attribute is not found, en error is given.
|}
|}


== EventLog ==
== EventLog ==
[[EventLog in QPR ProcessAnalyzer|EventLog]] is a list of events and information related to them, such as event and case attributes. There are following types of EventLogs:
EventLog is a list of events and information related to them, such as event and case attributes. Each Model consists of an EventLog, called model EventLog, containing all the events in the Model. In addition, there are filtered EventLogs which are subsets of a certain Model EventLog. The filter EventLog is created by applying a filter (set of filter rules) to model EventLog.
* '''Model EventLog''' represents all the data within a QPR ProcessAnalyer model
* '''Filter EventLog''' represents data related to a filter in a model


{| class="wikitable"
{| class="wikitable"
Line 284: Line 374:
|-
|-
||CaseAttributes (AttributeType*)
||CaseAttributes (AttributeType*)
||Used case attribute in the EventLog.
||[[#AttributeType|CaseAttributes]] in the EventLog returned in the alphabetical order. Note that filtering affects which attributes exist in the EventLog.
|-
|-
||Cases (Case*)
||Cases (Case*)
||Cases that belong to the EventLog.
||Cases in the EventLog.
|-
||CaseCount (Integer)
||Number of cases in the EventLog.
|-
|-
||EventAttributes (AttributeType*)
||EventAttributes (AttributeType*)
||Used event attributes in the EventLog.
||[[#AttributeType|EventAttributes]] in the EventLog returned in the alphabetical order. Note that filtering affects which attributes exist in the EventLog.
|-
||EventCount (Integer)
||Number of events in the EventLog.
|-
|-
||Events (Event*)
||Events (Event*)
||Events that belong to the EventLog.
||Events in the EventLog.
|-
||EventTypeNames (String*)
||
Returns all event type names in the model EventLog in the alphabetical order. For filter EventLogs, the model EventLog information is returned (i.e. filter rules are not applied for the list of event types). When case level permissions are in use, all event type names in the model are still returned (i.e. allowing user to see event type names for which user cannot see events).
|-
|-
||EventTypes (EventType*)
||EventTypes (EventType*)
||EventTypes in the EventLog.
||EventTypes in the EventLog.
|-
||FilterEventLog (EventLog)
||Returns an EventLog representing all the events in the filter (where the current EventLog resides) (for example, if the EventLog has applied selection filters).
|-
|-
||Flows (Flow*)
||Flows (Flow*)
Line 312: Line 409:
||ModelEventLog (EventLog)
||ModelEventLog (EventLog)
||Returns an EventLog representing all the events in the QPR ProcessAnalyzer model (where the current EventLog resides).
||Returns an EventLog representing all the events in the QPR ProcessAnalyzer model (where the current EventLog resides).
|-
||Name (String)
||EventLog name.
|-
|-
||Variations (Variation*)
||Variations (Variation*)
Line 324: Line 418:
! '''Parameters'''
! '''Parameters'''
! '''Description'''
! '''Description'''
|-
|CaseByName (Case)
||Case name (String)
||Gets the Case from the EventLog by the case id (case name). If the case is not found, ''null'' is returned. This function is a faster performing way to find a case by id than the ''Where'' function.
|-
|-
|| EventsByType (Event*)
|| EventsByType (Event*)
Line 330: Line 428:
||
||
Returns all Events in the EventLog which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.
Returns all Events in the EventLog which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.
|-
||EventCountByType (Integer)
||
* EventType object(s) or EventType name(s) (string or array)
||
Returns the number of Events belonging to the Case which are of given type(s). Can be either EventType object, a string identifying the name of the event type, or an array of EventType objects and event type name strings.
Examples:
<pre>
case.EventCountByType("Invoice")
Returns: Number of "Invoice" type of events in the case.
case.EventCountByType(EventLog.EventTypes.Where(Name=="Invoice"))
Returns: Number of "Invoice" type of events in the case.
case.EventCountByType(["Invoice", "Shipment"])
Returns: Number of "Invoice" and "Shipment" type of events in the case.
case.EventCountByType(EventLog.EventTypes.Where(Name=="Invoice" || Name=="Shipment"))
Returns: Number of "Invoice" and "Shipment" type of events in the case.
</pre>
|-
||EventsWindow (Event*)
||
# First index (Integer)
# Maximum count (Integer)
||
Returns a range of events in the EventLog between the provided first index and maximum count. Events are ordered primarily based on cases and secondarily based on event timestamps within the case. If the specified window is partly or completely outside of the actual events, the result will only include those events that fit into the specified window.
Parameters:
# ''First index'': Index of the first event to return (indexing starts from 0). If negative, the first index is [total event count] + [first index].
# ''Maximum count'': The maximum number of events to return.
Examples:
<pre>
EventLogById(1).EventsWindow(0, 10)
Returns: 10 first events.
EventLogById(1).EventsWindow(10, 10)
Returns: 10 events starting from event at index 10.
EventLogById(1).EventsWindow(-10, 10)
Returns: 10 last events.
</pre>
|-
||[[FindRootCauses_Function|FindRootCauses]] (DataFrame)
||
Settings (Dictionary)
||
|}
Eventlog related generic functions:
{| class="wikitable"
!'''Function'''
!'''Parameters'''
! '''Description'''
|-
||EventLogById
||
FilterId (Integer)
||
Returns EventLog object corresponding to the provided filter Id.
|}
Eventlog related generic properties:
{| class="wikitable"
!'''Function'''
!'''Parameters'''
! '''Description'''
|-
|-
||EventLog (EventLog)
||
Returns the EventLog in which context the expression is being evaluated.
|-
||ComparisonEventLog (EventLog)
||
Returns eventlog calculated by applying the ''Comparison'' property for the EventLog in the context. ComparisonEventLog is available only in the [[Web_API:_Expression/query|expression query]] when the ''ContextType'' is ''Eventlog''. The ComparisonEventLog helps in implementing the root causes analysis.
|}
|}


Line 344: Line 520:
||Count (Integer)
||Count (Integer)
||Number of Events that have this EventType.
||Number of Events that have this EventType.
|-
||EventLog (EventLog)
||EventLog where the EventType belongs to.
|-
|-
||Events (Event*)
||Events (Event*)
Line 372: Line 551:
! '''Description'''
! '''Description'''
|-
|-
||AverageDuration (TimeSpan)
||AverageDuration (Timespan)
||Returns the average duration of Flow within the EventLog, i.e. average duration of the related FlowOccurrence durations.
||Returns the average duration of Flow within the EventLog, i.e. average duration of the related FlowOccurrence durations.
|-
|-
Line 378: Line 557:
||Cases that contain the flow, i.e. there is a flow occurrence between Flow's starting and ending events.
||Cases that contain the flow, i.e. there is a flow occurrence between Flow's starting and ending events.
|-
|-
||DurationStandardDeviation (TimeSpan)
||DurationStandardDeviation (Timespan)
||Returns the standard deviation of the Flow duration within the EventLog, i.e. standard deviation of the related FlowOccurrence durations.
||Returns the standard deviation of the Flow duration within the EventLog, i.e. standard deviation of the related FlowOccurrence durations.
|-
||EventLog (EventLog)
||EventLog where the Flow belongs to.
|-
|-
||FlowOccurrences (FlowOccurrence*)
||FlowOccurrences (FlowOccurrence*)
Line 390: Line 572:
||Flow Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
||Flow Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
|-
|-
||MedianDuration (TimeSpan)
||MedianDuration (Timespan)
||Returns the median duration of Flows within the EventLog, i.e. median duration of the related FlowOccurrence durations.
||Returns the median duration of Flows within the EventLog, i.e. median duration of the related FlowOccurrence durations.
|-
|-
Line 398: Line 580:
||To (EventType)
||To (EventType)
||EventType to which this Flow ends. Value is ''null'' for ending flows.
||EventType to which this Flow ends. Value is ''null'' for ending flows.
|}
{| class="wikitable"
!'''Flow&nbsp;functions'''
! '''Parameters'''
! '''Description'''
|-
||AverageDuration (Timespan)
||
Business calendar
||
Same as the AverageDuration property (documented in the above table), but the duration is instead based on the provided [[Business_Calendar|business calendar]].
<pre>
flow1.AverageDuration(businessCalendar1)
</pre>
|-
||DurationStandardDeviation (Timespan)
||
Business calendar
||
Same as the DurationStandardDeviation property (documented in the above table), but the duration is instead based on the provided [[Business_Calendar|business calendar]].
|-
||MedianDuration (Timespan)
||
Business calendar
||
Same as the MedianDuration property (documented in the above table), but the duration is instead based on the provided [[Business_Calendar|business calendar]].
|}
|}


Line 405: Line 614:


{| class="wikitable"
{| class="wikitable"
!'''FlowOccurrence properties'''
!'''FlowOccurrence&nbsp;properties'''
! '''Description'''
! '''Description'''
|-
|-
Line 411: Line 620:
||Case the FlowOccurrence belongs to.
||Case the FlowOccurrence belongs to.
|-
|-
||Duration (TimeSpan)
||Duration (Timespan)
||Returns the duration of the FlowOccurrence. ''null'' is returned if the FlowOccurrence represents Case start or end.
||Returns the duration of the FlowOccurrence. ''null'' is returned if the FlowOccurrence represents Case start or end.
|-
||EventLog (EventLog)
||EventLog where the FlowOccurrence belongs to.
|-
|-
||Flow (Flow)
||Flow (Flow)
Line 432: Line 644:
||Event to where the FlowOccurrence ends. Value is ''null'' for ending flow occurrences.
||Event to where the FlowOccurrence ends. Value is ''null'' for ending flow occurrences.
|}
|}
== Model==
Note for properties returning different object counts: For models downloaded from an [[QPR_ProcessAnalyzer_Model_JSON_Settings#Model_Datasources|ODBC datasource]], the numbers represent the situation in the previous load. ''Null'' is returned for models downloaded from an ODBC datasource, if the model has never been loaded into the memory. Note also that if [[QPR_ProcessAnalyzer_Model_JSON_Settings#Case_Permissions|Case permissions]] are used for the model, ''null'' is returned for data security reasons.


{| class="wikitable"
{| class="wikitable"
!'''Model properties'''
!'''FlowOccurrence&nbsp;functions'''
! '''Parameters'''
! '''Description'''
! '''Description'''
|-
|-
||CaseAttributes (AttributeType*)
||Duration (Timespan)
||[[#AttributeType|CaseAttributes]] in the model.
||
|-
Business calendar
||ConfigurationJson (String)
||Returns an model configuration in JSON format.
|-
||CreatedDate (DateTime)
||Timestamp when the model was created.
|-
||DefaultFilterId (Integer)
||Default filter id of the model.
|-
||EstimatedMemory (Integer)
||Estimation in bytes of how much memory the model needs when loaded into the in-memory core. The real memory consumption is not available using this property.
|-
||EventAttributes (AttributeType*)
||EventAttributes in the model.
|-
||EventLog (EventLog)
||EventLog for the model default filter. The model EventLog contains all events in 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.
|-
||LastImportDate (DateTime)
||Timestamp when data was the last time imported to the model.
|-
||LastModifiedDate (DateTime)
||Timestamp when the model was modified the last time.
|-
||Name (String)
||Model name.
|-
||NBookmarks (Integer)
||Number of bookmarks in the model.
|-
||NCache (Integer)
||Amount of objects related to the model when the model is loaded into the memory.
|-
||NCaseAttributes (Integer)
||Number of [[#AttributeType|CaseAttributes]] in model.
|-
||NCases (Integer)
||Number of [[#Case|Cases]] in the model.
|-
||NEventAttributes (Integer)
||Number of [[#AttributeType|EventAttributes]] in model.
|-
||NEvents (Integer)
||Number of [[#Event|Events]] in model.
|-
||NEventTypes (Integer)
||Number of [[#EventType|EventTypes]] in the model.
|-
||NFilters (Integer)
||Number of filters in the model.
|-
||NOpens (Integer)
||Number of times analysis has been requested from the model.
|-
||Project (Project)
||[[#Project|Project]] object the model belongs to.
|-
||ProjectId (String)
||[[#Project|Project]] id the model belongs to.
|-
||Status (String)
||
||
Memory availability status of the model. There are the following statuses:
Returns the FlowOccurrence duration based on the provided [[Business_Calendar|business calendar]].
* '''loading''': The model is currently loading into the memory. When the loading is ready, the status changes to ''online''. If the loading fails, the status changes to ''offline''.
* '''offline''': The model is currently not loaded into the memory. The model needs to be loaded into the memory, so that analyses can be calculated from the model (occurs automatically when an analysis is requested).
* '''online''': The model is in the memory and ready for analysis calculation. If the model is dropped from the memory, its status changes to ''offline''.
|}
 
== Project ==
{| class="wikitable"
!'''Project properties'''
! '''Description'''
|-
||Id (Integer)
||Id of the Project. It's generated by QPR ProcessAnalyzer when the model is loaded.
|-
||Name (String)
||Name of the Project.
|-
||Models (Model*)
||Models that are in the Project.
|}
 
== User/Group ==
User objects represents users and user groups. Note that some properties can only be used for users and some for groups.
 
{| class="wikitable"
!'''User properties'''
! '''Description'''
|-
||Description (String)
||Description of the user.
|-
||Email (String)
||Email address of the user.
|-
||FullName (String)
||Full name of the user.
|-
||GroupMemberNames (String*)
||Array of names of members of a user group. This property is available for groups.
|-
||GroupMembers (User*)
||Array of members of a user group. This property is available for groups.
|-
||GroupNames (String*)
||Array of names of user groups the user belongs to. This property is available for users.
|-
||Groups (User*)
||Array of user groups the user belongs to. This property is available for users.
|-
||Id (String)
||Id of the user, which is unique for every user.
|-
||IsActive (Boolean)
||Returns true only if the user is active (not disabled).
|-
||IsGroup (Boolean)
||Returns true if the user is a user group.
|-
||LogonMessage (String)
||Returns the logon message of the user.
|-
||Name (String)
||Login name of the user.
|-
||Roles (String Array*)
||Roles of user as string array.
|}
|}


Line 589: Line 669:
||Cases (Case*)
||Cases (Case*)
||Cases that belong to the Variation.
||Cases that belong to the Variation.
|-
||EventLog (EventLog)
||EventLog where the Variation belongs to.
|-
|-
||EventTypeCount (Integer)
||EventTypeCount (Integer)
Line 616: Line 699:
# Parameters
# Parameters
||
||
Same as the IsConformant function for [[Object_Properties_and_Functions_in_QPR_ProcessAnalyzer_Expressions#Case|Case]] objects, but the check is done for the Variation.
Same as the IsConformant function for [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Case|Case]] objects, but the check is done for the Variation.


Example:
Example:
<pre>
<pre>
Let("cm", ConformanceModelFromXml(xml));
let cm = DesignModelFromXml(xml);
Let("el", EventLogById(1));
let el = EventLogById(1);
Let("vars", OrderByDescending(EventLogById(1).Variations, CaseCount));
let vars = OrderByDescending(EventLogById(1).Variations, CaseCount);
vars.(
vars.(
   Let("analysis",AnalyzeConformance(cm)),
   Let("analysis",AnalyzeConformance(cm)),
Line 648: Line 731:
# Parameters
# Parameters
||
||
Same as the IsConformant function for [[Object_Properties_and_Functions_in_QPR_ProcessAnalyzer_Expressions#Case|Case]] objects, but the check is done for the Variation.
Same as the IsConformant function for [[QPR_ProcessAnalyzer_Objects_in_Expression_Language#Case|Case]] objects, but the check is done for the Variation.


Example:
Example:
Line 659: Line 742:
|}
|}


= Other objects =
[[Category: QPR ProcessAnalyzer]]
 
== DateTime ==
DateTime represents a timestamp.
 
{| class="wikitable"
!'''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. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second.
|-
||Year (Integer)
||The year component of the date represented by the DateTime. Number between 1 and 9999.
|}
 
{| class="wikitable"
!'''DateTime functions'''
! '''Parameters'''
! '''Description'''
|-
|| Round (DateTime)
||
* TimeSpan or Integer
||
Rounds given date time by given TimeSpan or given number of seconds.
 
Example:
<pre>
Round to the nearest hour:
Round(DateTime(2017, 1, 1, 14, 48), TimeSpan(0, 1))
 
DateTime(2017, 1, 2, 3, 4, 5).Round(10)
Returns: DateTime(2017, 1, 2, 3, 4, 10)
 
DateTime(2017, 1, 2, 3, 4, 5).Round(TimeSpan(1))
Returns: DateTime(2017, 1, 2)
</pre>
|-
||Truncate (DateTime)
||
* Period (String)
||
Truncates given DateTime value to given precision. Truncating means that the provided DateTime (i.e. timestamp) is converted into a timestamp representing the beginning of the period. For example, if period is ''year'', the Truncate function returns the first date of the year where the input DateTime is belonging. Truncate function is useful e.g. when dimensioning data into different periods.
 
Supported precision values are: '''year''', '''quarter''', '''month''', '''week''', '''day''', '''hour''', '''minute''' and '''second'''.
 
Examples:
<pre>
DateTime(2018, 5, 14, 3, 4, 5).Truncate("year")
Returns: DateTime(2018)
 
DateTime(2018, 5, 20, 3, 4, 5).Truncate("quarter")
Returns: DateTime(2018, 4, 1)
 
DateTime(2019, 8, 14, 3, 4, 5).Truncate("day")
Returns: DateTime(2019, 8, 14)
 
DateTime(2019, 8, 14, 3, 4, 5).Truncate("hour")
Returns: DateTime(2019, 8, 14, 3)
</pre>
|}
 
== 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 [[Generic Properties and Functions in QPR ProcessAnalyzer Expressions#Variable handling functions|Def]] function
* Whenever '''&''' prefix is used in Def function for an attribute
 
Examples:
<pre>
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]
</pre>
 
== String ==
 
{| class="wikitable"
!'''String properties'''
! '''Description'''
|-
||Length
||
Return the number of characters in the input string.
Example:
<pre>
"Test".Length
Returns: 4.
 
"".Length
Returns: 0.
</pre>
|}
 
{| class="wikitable"
!'''String functions'''
! '''Parameters'''
! '''Description'''
|-
||CharAt
||
* Index number (Integer)
||
Return a character (as a String) in the index number position in the input string. The indexing starts from zero. Negative index numbers are not allowed.
 
Examples:
<pre>
"test".CharAt(1)
Returns: "e"
 
"test".For("i", 0, i < Length, i + 1, CharAt(i))
Returns: ["t", "e", "s", "t"]
</pre>
|-
||Contains
||
* searched string
||
Returns ''true'' if the input string contains the searched string; otherwise ''false''. String comparison is case sensitive.
Example:
<pre>
"test".Contains("st")
Returns: ''true''
</pre>
|-
||EndsWith
||
* searched string
||
Return ''true'' if the input string ends with the searched string; otherwise ''false''. String comparison is case sensitive.
|-
||IndexOf
||
* searched string
* start index (Integer) (optional)
||
Return the index number of the first occurrence of the searched string in the input string. Indexing starts from zero. If the start index is provided, the search is started from that index. The function returns -1 if match is not found.
 
The start index is optional. Invalid start index is negative or more than input string length.
 
Examples:
<pre>
"test".IndexOf("t")
Returns: 0
 
"test".IndexOf("t", 1)
Returns: 3
</pre>
|-
||LastIndexOf
||
* searched string
* start index (Integer)
||
Return the index number of the last occurrence of the searched string in the input string. Indexing starts from zero. If the start index is provided, the search is started from that index (calculated from the start of the string) towards the beginning of the string. Return -1 if match not found. Invalid start index is negative or more than input string length.
|-
||Replace
||
* first string
* second string
||
Replaces all occurrences of the first string with the second string in the input string. String comparison is case sensitive.
 
Example:
<pre>
"abcd".Replace("b", "e")
Returns: "aecd"
</pre>
|-
||Split
||
* Split character (string or string array)
* Remove empties (Boolean) (optional)
||
Splits input string into array of substrings. The string is splitted based on a character or array of characters (that are provided as strings). String comparison is case sensitive.
 
When remove empties parameter is ''true'', empty strings are excluded (by default ''false'').
 
Examples:
<pre>
"1,2,3".Split([","]).ToInteger(_)
Returns: [1,2,3]
 
"a,b,,c".Split(",", true)
Returns: ["a","b","c"]
 
"a,b,,c".Split(",")
Returns: ["a","b","","c"]
</pre>
|-
||StartsWith
||
* searched string
||
Return ''true'' if the input string starts with the searched string; otherwise ''false''. String comparison is case sensitive.
|-
||Substring
||
* start index (Integer)
* length (Integer) (optional)
||
Returns a substring of the input string starting from the start index. If the length is provided, the returned string contains maximum of that number of characters. Invalid start index is negative or more than input string length. Invalid length is negative or start index plus length is more then input string length.
|-
||ToLower
||[none]
||Return a string where all the characters of the input string have been converted to lower case characters.
|-
||ToUpper
||[none]
||Return a string where all the characters of the input string have been converted to upper case characters.
|-
||Trim
||
* string or arrays of strings (optional)
||
Removes spaces from the start and end of the input string (if array of strings is not provided). If the array of strings is provided, all leading and trailing characters in the array of strings are removed from the input string. Accepts also a single string in which case it is treated as if an array containing only that string was given as parameter.
 
Examples:
<pre>
" Test".Trim()
Returns: "Test"
 
"Test".Trim(["T", "t"])
Returns: "es"
 
"Test".Trim("t")
Returns: "Tes"
</pre>
|}
 
== TimeSpan ==
 
TimeSpan represents a time interval (duration of time or elapsed time) that is measured as a positive or negative number of days, hours, minutes, seconds, and fractions of a second. The TimeSpan is not bound to calendar time, so a TimeSpan can be used to represent the time of day, but only if the time is unrelated to a particular date.
 
Difference between two TimeStamps is TimeSpan. TimeStamp added by TimeSpan is TimeStamp.
 
Minimum possible value of a TimeSpan is -10 675 199 days 2 hours 48 minutes 5.4775808 seconds and maximum possible value is 10 675 199 days 2 hour 48 minutes 5.4775807 seconds.
 
{| class="wikitable"
!'''TimeSpan properties'''
! '''Description'''
|-
||Ticks (Integer)
||Number of ticks represented by the TimeSpan. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second.
|-
||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).
|}
 
[[Category: QPR UI]]

Latest revision as of 20:09, 1 May 2023

QPR ProcessAnalyzer expression language is an object oriented language. This page lists all object types, and properties and functions that they have.

In the tables in this page, after the property or function name there is the type of the returned object in parenthesis. Asterisk (*) after the type means that the return value is an array of objects (multiple objects instead of one).

AttributeType

AttributeType properties Description
CalculationExpression (String) Expression used to calculate values for the calculated attribute. Value is null if the attribute is imported.
Datatype (String) Data type of the attribute. For imported attributes, the data type comes from the datasource (e.g. datatable column datatype). For calculated attributes, the data type is explicitly defined for the attribute (the actual data produced by the calculation expression must match with the attribute data type).
Id (Integer) AttributeType Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
EventLog (EventLog) EventLog where the attribute belongs to.
Name (String) Attribute name.
UniqueCount (Integer) Returns the number of unique (different) values that this AttributeType contains in this EventLog (with filters applied). The result is same as Count(Values) except performance is better and memory consumption is lower.
ValueOrigin (String) Describes where the attribute values are coming from as follows:
  • Calculated: Attribute values are calculated during the model loading using an expression.
  • Imported: Attribute values are imported to QPR ProcessAnalyzer, e.g. they are in a datatable or they are read from the ODBC data source.

An attribute may also be both, so the value is imported but there is also a calculation expression for the attribute. In that case, the attribute is considered calculated. In the calculation expression, the imported value can be used as an input.

Values (String Array) Returns an array of all unique values (duplicates removed) that this AttributeType contains in this EventLog (with filters applied).
AttributeType functions Parameters Description
EventsHavingValue (Event*)
  • Value to use for matching (Object)

Returns all Events that have the given value for this AttributeType. If the AttributeType 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 AttributeType 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 (Case*)
  • Value to use for matching (Object)

Returns all Cases that have given value for this attribute. If the AttributeType is a case attribute, then all the returned Cases have the specified value as the value of this case attribute. If the AttributeType 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

A case is a single execution instance of a process. A case consist of Events. Case can have CaseAttributes storing additional information of that case. A Case doesn't need to have Events in QPR ProcessAnalyzer.

Case properties Description
Duration (Timespan) Case duration, i.e. duration between Case start and Case end time. Case duration is zero for Cases having only one Event.
EndTime (DateTime) Case end time, i.e. timestamp of the last Event.
EventLog (EventLog) EventLog where the Case belongs to.
Events (Event*) All events in the Case in temporal order by event timestamp.
FirstEvent (Event) The first Event in the Case in temporal order. Better performing shortcut for Events[0].
FlowOccurrences (FlowOccurrence*) All FlowOccurrences in the Case.
Flows (Flow*) All Flows the Case goes through.
Id (Integer) Case Id. Case id is generated by QPR ProcessAnalyzer when the model is loaded.
LastEvent (Event) The last Event in the Case in temporal order. Better performing shortcut for Events[Count(_) - 1].
Name (String) Case name. The case name comes from 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
AnalyzeConformance
  1. ConformanceModel
  2. Parameters

Checks whether the Case conforms with given DesignModel and reports a list of violations if the case doesn't conform. The function returns an array where the first item is the nonconformance reason as an integer. Next items in the array depends on the reasons, and thus there may be none or several further items in the array.

The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: allowed settings).

Examples:

let myConformanceModel = DesignModelFromXml(xml);
let myEventLog = EventLogById(1);
let cases = OrderBy(EventLogById(1).Cases, Name);
cases.(
  Let("analysis",AnalyzeConformance(myConformanceModel)),
  ""
  +(CountTop(analysis)==0)
  +((CountTop(analysis)>0)
    ? " ("
      +StringJoin("",
        ReplaceLeafValues(
          analysis,
          "i",
          i[0]==3?i[2]+"->"+i[3]:(i[0]==2?"DNF":"")))
      +")"
    :"")
  +": "+StringJoin("->",Events.Type.Name))

Returns: A report containing a line for each case (in filter having id 1) showing whether the Case conforms with the model (in xml variable) or not and if not, gives some information on why the conformance check failed for that case.
Attribute (Object)

attribute name (string)

Returns case attribute value for a case attribute provided as a parameter. This function must be used when there are spaces in the case attribute name. If there are no spaces, syntax .attributeName can be used.

If the case attribute is not found, en error is given.

Duration (Timespan) Business calendar Case duration (i.e. duration between Case start and Case end time) taking into account the provided business calendar.
DurationBetweenEvents (Timespan)
  1. Starting event (String, String*, EventType or EventType*)
  2. Ending event (String, String*, EventType or EventType*)
  3. Starting event occurrence index (Integer)
  4. Ending event occurrence index (Integer)
  5. Business calendar

Returns duration between two specified events in the Case. Returns null, if the duration cannot be calculated in the following situations:

  • Specified starting or ending event doesn't occur in the Case
  • Ending event occurs before the starting event
  • Starting or ending event doesn't occur the defined occurrence index number of times

Several EventTypes for the starting and ending event can also be defined. Then the first occurred event is chosen if the occurrence index is positive, and the last occurred event is chosen, if the occurrence index is negative.

When the 3. and 4. parameters are not defined, the first occurrence of the starting event is chosen and the last occurrence of the ending event.

Parameters:

  1. Starting event: Starting event name to calculate the duration. This parameter can also be given as an EventType object, and both can also be given as an array to define several types of events.
  2. Ending event: Ending event name or EventType object to calculate the duration. This parameter can also be given as an EventType object, and both can also be given as an array to define several types of events. Default value is same as the starting event
  3. Starting event occurrence index (default 0): Specifies which event occurrence to choose if the Case has multiple occurrences of the specified event. First occurence is 0, the second is 1 and so on. The last occurence is -1 and the second from the end is -2. Default value is 0.
  4. Ending event occurrence index (default -1): Same logic as in the Starting event order number parameter. Default value is -1.
  5. Business calender: Optional business calendar. If provided, the duration is calculated based on the business calendar instead of 24 hours per day.
EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Product returned");
Returns: Duration between the first "Order confirmation" and last "Product returned".

EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Product returned", 0, 0);
Returns: Duration between the first "Order confirmation" and first "Product returned".

EventLogById(1).Cases[0].DurationBetweenEvents(["Order confirmation", "Order received"], "Product returned");
Returns: Duration between the first "Order confirmation" or "Order received" (which one occurs first) and last "Product returned".

EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Order confirmation", 0, 1);
Returns: Duration between the first and second "Order confirmation".

EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation", "Order confirmation", 0, 1, myBusinessCalendar1);
Returns: Duration between the first and second "Order confirmation".

EventLogById(1).Cases[0].DurationBetweenEvents("Order confirmation");
Returns: Duration between the first and last "Order confirmation".
EventCountByType (Integer)
  • EventType object(s) or EventType name(s) (string or array)

Returns the number of Events in the Case, that are of given type(s). Can be either EventType object, a string identifying the name of the event type, or an array of EventType objects and event type name strings.

Examples:

EventLogById(1).EventCountByType("Invoice")
Returns: Number of "Invoice" type of events in the event log with filter id = 1

EventLogById(1).EventCountByType(EventLog.EventTypes.Where(Name=="Invoice"))
Returns: Number of "Invoice" type of events in the event log with filter id = 1

EventLogById(1).EventCountByType(["Invoice", "Shipment"])
Returns: Number of "Invoice" and "Shipment" type of events in the event log with filter id = 1

EventLogById(1).EventCountByType(EventLog.EventTypes.Where(Name=="Invoice" || Name=="Shipment"))
Returns: Number of "Invoice" and "Shipment" type of events in the event log with filter id = 1
EventsByType (Event*)
  • EventType object(s) or EventType name(s) (string or array)

Returns all Events in the Case which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.

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".

case.EventsByType(["Invoice", "Shipment"])
Returns: Array of events having event type named "Invoice" or "Shipment".

case.EventsByType(EventLog.EventTypes.Where(Name=="Invoice" || Name=="Shipment"))
Returns: Array of events having event type named "Invoice" or "Shipment".
EventTimestampsByType (DateTime*)
  • EventType object(s) or EventType name(s) (string or array)

Returns timestamps of all Events of given type in the Case.

Example:

case.EventTimestampsByType("Invoice")

Note: The result is same than (except the first one is faster to calculate):

case.EventsByType("Invoice").Timestamps
FlowOccurrencesByType (FlowOccurrence*)
  • Flow object or id of FlowOccurrence (Integer)

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.
IsConformant (Boolean)
  1. ConformanceModel
  2. Parameters

Checks whether the Case conforms with given ConformanceModel. Returns true if the Case conforms with the given design model.

The parameters are an optional key-value pairs containing additional settings for the conformance checking (see: allowed settings).

Examples:

let myConformanceModel = DesignModelFromXml(xml);
let myEventlog = EventLogById(1);
Count(myEventlog.Cases.Where(IsConformant(myConformanceModel))) / Count(myEventlog.Cases)

Returns: Proportion of conforming cases in the EventLog created for filter having id 1.

Event

Event properties Description
Case (Case) Case the event belongs to.
EventLog (EventLog) EventLog where the Event belongs to.
Id (Integer) Event id. It's generated by QPR ProcessAnalyzer when the model is loaded.
IndexInCase (Integer) Index number of the Event in the case (in temporal order). The first event has index number 0, the second event has index number 1 and so on.
IncomingFlowOccurrence (FlowOccurrence) Preceding FlowOccurrence of the Event.
NextInCase (Event) Temporally next event in the case. For the last event, return EMPTY.
OutgoingFlowOccurrence (FlowOccurrence) The following FlowOccurrence of the Event.
PreviousInCase (Event) Temporally previous event in the case. For the first event, return EMPTY.
Timestamp (DateTime) Timestamp of the Event.
Type (EventType) EventType of the Event.
TypeName (String) Name of the EventType of the Event. Result is the same as with Type.Name, but the TypeName shortcut has better performance.
Event functions Parameters Description
Attribute (object)
  • attribute name (string)
Return event attribute value for an event attribute provided as a parameter. This function must be used when there are spaces in the event attribute name. If there are no spaces, syntax .attributeName can be used.

If the case attribute is not found, en error is given.

EventLog

EventLog is a list of events and information related to them, such as event and case attributes. Each Model consists of an EventLog, called model EventLog, containing all the events in the Model. In addition, there are filtered EventLogs which are subsets of a certain Model EventLog. The filter EventLog is created by applying a filter (set of filter rules) to model EventLog.

EventLog properties Description
CaseAttributes (AttributeType*) CaseAttributes in the EventLog returned in the alphabetical order. Note that filtering affects which attributes exist in the EventLog.
Cases (Case*) Cases in the EventLog.
CaseCount (Integer) Number of cases in the EventLog.
EventAttributes (AttributeType*) EventAttributes in the EventLog returned in the alphabetical order. Note that filtering affects which attributes exist in the EventLog.
EventCount (Integer) Number of events in the EventLog.
Events (Event*) Events in the EventLog.
EventTypeNames (String*)

Returns all event type names in the model EventLog in the alphabetical order. For filter EventLogs, the model EventLog information is returned (i.e. filter rules are not applied for the list of event types). When case level permissions are in use, all event type names in the model are still returned (i.e. allowing user to see event type names for which user cannot see events).

EventTypes (EventType*) EventTypes in the EventLog.
Flows (Flow*) Flows that the part of the EventLog.
Id (Integer) EventLog Id.
Model (Model) Model where the EventLog belongs.
ModelEventLog (EventLog) Returns an EventLog representing all the events in the QPR ProcessAnalyzer model (where the current EventLog resides).
Variations (Variation*) Variations that are in the EventLog
EventLog functions Parameters Description
CaseByName (Case) Case name (String) Gets the Case from the EventLog by the case id (case name). If the case is not found, null is returned. This function is a faster performing way to find a case by id than the Where function.
EventsByType (Event*)
  • EventType object or EventType name (string or array)

Returns all Events in the EventLog which are of given type(s). The parameter can be either an EventType object or EventType name as a string. The parameter can also be an array of multiple EventType objects or EventType names.

EventCountByType (Integer)
  • EventType object(s) or EventType name(s) (string or array)

Returns the number of Events belonging to the Case which are of given type(s). Can be either EventType object, a string identifying the name of the event type, or an array of EventType objects and event type name strings.

Examples:

case.EventCountByType("Invoice")
Returns: Number of "Invoice" type of events in the case.

case.EventCountByType(EventLog.EventTypes.Where(Name=="Invoice"))
Returns: Number of "Invoice" type of events in the case.

case.EventCountByType(["Invoice", "Shipment"])
Returns: Number of "Invoice" and "Shipment" type of events in the case.

case.EventCountByType(EventLog.EventTypes.Where(Name=="Invoice" || Name=="Shipment"))
Returns: Number of "Invoice" and "Shipment" type of events in the case.
EventsWindow (Event*)
  1. First index (Integer)
  2. Maximum count (Integer)

Returns a range of events in the EventLog between the provided first index and maximum count. Events are ordered primarily based on cases and secondarily based on event timestamps within the case. If the specified window is partly or completely outside of the actual events, the result will only include those events that fit into the specified window.

Parameters:

  1. First index: Index of the first event to return (indexing starts from 0). If negative, the first index is [total event count] + [first index].
  2. Maximum count: The maximum number of events to return.

Examples:

EventLogById(1).EventsWindow(0, 10)
Returns: 10 first events.

EventLogById(1).EventsWindow(10, 10)
Returns: 10 events starting from event at index 10.

EventLogById(1).EventsWindow(-10, 10)
Returns: 10 last events.
FindRootCauses (DataFrame)

Settings (Dictionary)

Eventlog related generic functions:

Function Parameters Description
EventLogById

FilterId (Integer)

Returns EventLog object corresponding to the provided filter Id.

Eventlog related generic properties:

Function Parameters Description
EventLog (EventLog)

Returns the EventLog in which context the expression is being evaluated.

ComparisonEventLog (EventLog)

Returns eventlog calculated by applying the Comparison property for the EventLog in the context. ComparisonEventLog is available only in the expression query when the ContextType is Eventlog. The ComparisonEventLog helps in implementing the root causes analysis.

EventType

EventTypes are individual activities in processes, i.e. EventTypes are the boxes in the process flowchart.

EventType properties Description
Cases (Case*) Cases that have events of this EventType.
Count (Integer) Number of Events that have this EventType.
EventLog (EventLog) EventLog where the EventType belongs to.
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.

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, there may be several FlowOccurrences of a single Flow.

Flow properties Description
AverageDuration (Timespan) Returns the average duration of Flow within the EventLog, i.e. average duration of the related FlowOccurrence durations.
Cases (Case*) Cases that contain the flow, i.e. there is a flow occurrence between Flow's starting and ending events.
DurationStandardDeviation (Timespan) Returns the standard deviation of the Flow duration within the EventLog, i.e. standard deviation of the related FlowOccurrence durations.
EventLog (EventLog) EventLog where the Flow belongs to.
FlowOccurrences (FlowOccurrence*) Flow occurrences the flow belongs to.
From (EventType) EventType from which this Flow starts. Value is null for starting flows.
Id (Integer) Flow Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
MedianDuration (Timespan) Returns the median duration of Flows within the EventLog, i.e. median duration of the related FlowOccurrence durations.
Name (String) Identifying name of the Flow.
To (EventType) EventType to which this Flow ends. Value is null for ending flows.
Flow functions Parameters Description
AverageDuration (Timespan)

Business calendar

Same as the AverageDuration property (documented in the above table), but the duration is instead based on the provided business calendar.

flow1.AverageDuration(businessCalendar1)
DurationStandardDeviation (Timespan)

Business calendar

Same as the DurationStandardDeviation property (documented in the above table), but the duration is instead based on the provided business calendar.

MedianDuration (Timespan)

Business calendar

Same as the MedianDuration property (documented in the above table), but the duration is instead based on the provided business calendar.

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 FlowOccurrence belongs to.
Duration (Timespan) Returns the duration of the FlowOccurrence. null is returned if the FlowOccurrence represents Case start or end.
EventLog (EventLog) EventLog where the FlowOccurrence belongs to.
Flow (Flow) Corresponding Flow of the FlowOccurrence.
From (Event) Event from where the FlowOccurrence begins. Value is null for starting flow occurrences.
Id (Integer) FlowOccurrence Id. It's generated by QPR ProcessAnalyzer when the model is loaded.
Name (String) Identifying name of the FlowOccurrence.
OccurrenceIndex (Integer) Occurrence index describes how many times the Flow of the FlowOccurrence has occurred in the case until that point. The first time has occurrence index 0. When a case goes through a certain flow the second time, the occurrence index is 1.
To (Event) Event to where the FlowOccurrence ends. Value is null for ending flow occurrences.
FlowOccurrence functions Parameters Description
Duration (Timespan)

Business calendar

Returns the FlowOccurrence duration based on the provided business calendar.

Variation

Variation is unique sequence of events in a case. A case belongs to a single variation.

Variation properties Description
CaseCount (Integer) Number of Cases belonging to the Variation.
Cases (Case*) Cases that belong to the Variation.
EventLog (EventLog) EventLog where the Variation belongs to.
EventTypeCount (Integer) Number of Events in the Variation.
EventTypes (EventType*) EventTypes belonging to the Variation.
Flows (Flow*) 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) EventTypes in the Variation.
Variation functions Parameters Description
AnalyzeConformance
  1. ConformanceModel
  2. Parameters

Same as the IsConformant function for Case objects, but the check is done for the Variation.

Example:

let cm = DesignModelFromXml(xml);
let el = EventLogById(1);
let vars = OrderByDescending(EventLogById(1).Variations, CaseCount);
vars.(
  Let("analysis",AnalyzeConformance(cm)),
  ""
  +CaseCount
  +" * "
  +(CountTop(analysis)==0)
  +((CountTop(analysis)>0)
    ? " ("
      +StringJoin("",
        ReplaceLeafValues(
          analysis,
          "i",
          i[0]==3?i[2]+"->"+i[3]:(i[0]==2?"DNF":"")))
      +")"
    :"")
  +": "+StringJoin("->",EventTypes.Name))

Returns: A simple report containing a line for each variation (in filter having id 1) showing also whether the variation conforms with the model (in xml variable) or not and if not, gives some information on why the conformance check failed for that variation.
IsConformant (Boolean)
  1. ConformanceModel
  2. Parameters

Same as the IsConformant function for Case objects, but the check is done for the Variation.

Example:

Let("el", EventLogById(1));
Count(el.Variations.Where(IsConformant(cm))) / Count(el.Variations)

Returns: Proportion of conforming variations in event log created for filter with id 1.