QPR ProcessAnalyzer Expression Examples: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
List of all EventTypes from an EventLog: | |||
<pre> | |||
EventLogById(1).EventTypes | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes.Events | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes:Events.Type | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes:Events.Type.Name | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes:Events.TimeStamp | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes:Events.Where(Timestamp > DateTime(2012,1,1)) | |||
</pre> | |||
<pre> | |||
Count(EventLogById(1).EventTypes:Events.Where(Timestamp > DateTime(2012,1,1))) | |||
</pre> | |||
<pre> | |||
EventLogById(1).EventTypes.OrderByDescending(Events, Timestamp) | |||
</pre> | |||
List of all the Starter flows in a model from filterId=1: | List of all the Starter flows in a model from filterId=1: | ||
<pre> | <pre> | ||
RemoveLeaves(EventLogById(1).Flows:From.Where(IsNull(_))) | RemoveLeaves(EventLogById(1).Flows:From.Where(IsNull(_))) | ||
</pre> | </pre> | ||
Go through the model recursively using the flows: | Go through the model recursively using the flows: |
Revision as of 08:27, 30 November 2017
List of all EventTypes from an EventLog:
EventLogById(1).EventTypes
EventLogById(1).EventTypes.Events
EventLogById(1).EventTypes:Events.Type
EventLogById(1).EventTypes:Events.Type.Name
EventLogById(1).EventTypes:Events.TimeStamp
EventLogById(1).EventTypes:Events.Where(Timestamp > DateTime(2012,1,1))
Count(EventLogById(1).EventTypes:Events.Where(Timestamp > DateTime(2012,1,1)))
EventLogById(1).EventTypes.OrderByDescending(Events, Timestamp)
List of all the Starter flows in a model from filterId=1:
RemoveLeaves(EventLogById(1).Flows:From.Where(IsNull(_)))
Go through the model recursively using the flows:
RemoveLeaves(EventLogById(1).Flows:From.Where(IsNull(_))).To.OutgoingFlows.To.OutgoingFlows.To
Traverse the model using events:
RemoveLeaves(EventLogById(1).Flows:From.Where(IsNull(_))).FlowOccurrences.To.NextInCase.NextInCase.NextInCase
All case attribute values within the model grouped by case attribute types:
Let("cases", EventLogById(1).Cases, EventLogById(1).CaseAttributes:(Let("attribute", _, cases.Attribute(attribute))))
All event attribute values within the model grouped by event attribute types:
Let("events", EventLogById(1).Events, EventLogById(1).EventAttributes:(Let("attribute", _, events.Attribute(attribute))))
Define new user defined functions:
Def("First", "a", GetAt(0, a)); Def("Second", "a", GetAt(1, a)); Array(First(a), Second(a))
Def("x", "a", Distinct(RecurseLeaves(OrderBy(EventLogById(a).Cases.Events, Type.Name), Type.Name)))
Function definition that uses itself, i.e. recursive functions:
Def("Fib", "a", If(a < 2, 1, Fib(a - 1) + Fib(a - 2))); For("i", 0, i < 10, i + 1, Fib(i));
Models.StringJoin(":", [Id, Name])
Models.[Id, Name]