-
Notifications
You must be signed in to change notification settings - Fork 9
Data Objects Definition
Conventions used for the definition of Data Objects, useful to simulate additional log perspectives.
Every time a data object is exiting from a task, an additional attribute will be added to that activity simulation. Attributes with no connection, will be added as trace attribute.
All attributes incoming into a task are considered as sequence attributes. Specifically, the given attribute is associated to all the sequences that enters the task. At simulation time, a data object incoming an activity A, will be associated to the events of all the activities preceding A, when A will actually be generated. For example, if A is a branch of a XOR split, the sequence attribute will be associated only when A is actually observed. Another example is:
in this case, the attribute test
is associated to the activity A and, when the flow moves to B it has value 0
, when the flow moves to C it has value 1
.
Currently, PLG supports two main data object types:
- static data objects;
- script data objects.
A static data object generates an attribute that has always the same value. This means that all the executions of the associated activity will generate the same attribute value.
In order to generate a static attribute, add an exiting data object and assign its name to a "composed" value:
attributeName = attributeValue
A valid example of this data object is:
A script data object generates an attribute that has a Python script associated. Therefore, every time the specific activity is simulated, the script is executed an the resulting value is assigned as the attribute value. Currently, PLG supports two types of scripts: scripts that generates integer values and scripts generating strings.
In order to define a script attribute, it is necessary to ass a data object and assign, as data object name, a name composed as:
attributeName(type)
where type
can be one of Integer
or String
.
A valid example of this data object is:
All script data objects must provide, as documentation, a Python script. This script is requires to contain a function called generate
that must accept a string as only parameter. This function will be called, with the case id as parameter, every time the given activity has to be simulated. According to the data object name, the function must return a string or an integer value. An example of valid script is:
from random import randrange;
def generate(caseId):
return 50 + randrange(50);