R-IO KPIL : The DSL for the indicators in R-IO Suite

R-IO KPIL is a domain specific language allowing to define indicators and their calculus while running a R-IO Suite process. The users of R-IOSUITE can define indicators in the project (usecase) edition module of the R-IOGA application.

Specification

Requirements

Ideas reported here come from anterior specification meetings. They are consolidated here to lead to a specification.

  • An indicator is primitive or aggregated. 
  • A primitive indicator is defined by its name, a precision (PRECISE or RANGE) and a unit (string)
  • An aggregated indicator is defined by its name, a precision, a unit and a formula. 
  • A formula combines the value of primitive and aggregated indicators (float), conditions, operators ("+", "-", "x", ":" ) and real numbers (float).
  • The indicators are defined by use case. The user must use the KPIL DSL (Domain Specific Language) to define the indicators. The DevOps team made the KPIL DSL from scratch. It is dedicated to the definition of indicators in R-IOSUITE.
  • A constraint can compare (==, =>, =<, <, >, !=) the value of an attribute of a model instance (i.e. function type invoked) or the value of another indicator to a real number.
  • The value of an indicator can only be quantitative; the value of an indicator is a real number (float). There is no management of qualitative indicators.
  • An indicator has three values: a theoretical value, a real value, a simulated value.
  • theoretical values.
  • R-IOWA uses and displays the real values during the orchestration of the process. When they finish a task, the users enter the value of all primitive indicators. R-IOSUITE automatically calculates the value of the aggregated ones.

  • R-IOSEPE uses and displays the simulated values. When they launch an experimental plan, the users choose the strategy of simulation (Min, Max, Random) and R-IOSUITE automatically assign a simulated value to the primitive indicators and automatically calculates the value of the aggregated ones.
  • R-IOSUITE will be able to automatically calculate the value of the indicators per scope and per process, if the scope or process do not have any loop, gateway OR or gateway XOR.

Formalisation

R-IO PKIL is a DSL allowing to define the indicators of a R-IO Suite process.
An indicator is a numeric property that represents a value evolving while the process is running.
It can be built from a combination of numeric properties of tasks and arithmetic formula.

Indicator

Definition

An indicator has got at least  a name, a type of aggregation, a type of precision (can be modified at any time) and a mesure unit (can not be modified once defined). 
In this case it is called "primitive indicator" and the syntax is the following:

Primitive indicator definition
INDICATOR = NAME[AGG_TYPE, PRECISION_TYPE, UNIT]

where NAME is the name of the indicator,
AGG_TYPE is the type of aggregation to be taken into consideration for this indicator. Possible values are

  • "min_max": the aggregation consists in process shortest path computation(i.e. duration indicator)
  • "cumulative": the aggregation consists in the sum of numeric values (i.e. cost indicator)

PRECISION_TYPE is the type of precision of the indicator. Possible values are:

  • "precise": a single value is computed,
  • "ranges": pairs of values are computed (inclusive ranges),

UNIT is the mesure unit in which the indicator is represented. Possible values are anything the user wants (euros, seconds, shmilblik, etc.).

Aggregated indicator

An indicator can be composed of other indicators combined with arithmetic operations. In this case, it is called "aggregated indicator".

Aggregated indicator definition
NAME[AGG_TYPE, PRECISION_TYPE, UNIT]: <ARITHMETIC OPERATION(#INDICATOR.NAME(FILTER))>+;
  • <...>+ represents a set of 1 to n combination(s) of indicators and arithmetic operations
  • FILTER is a predicate to restricts indicator calculus on specific function, property, etc.
  • ARITHMETIC OPERATION adds, substracts, multiplies or divides indicator value with numeric value (i.e. "* 0.6", "+3")

Implementation


R-IO KPIL has been implemented to be used in R-IOGA when editing a project. A text area form allows the user to type his script.

The following code shows the definition of 2 primitive indicators (duration and cost) and 4 aggregated indicators (CD, SST, SST_IT and SST_FOR_SCOPE).

For instance CD indicator will take the value of cost indicator on each task and will divide it by its corresponding duration, times 2.

Let us note there are some utility functions that have been added in order to help the user to define his indicators:

  • functionType() : retrieves the kind of function that has been invoked to create the task (note that a function type is a QName where the namespace defines the domain of the function, and the local part is the name)
  • propertietype() ????TODO retrieves properties of the task...
  • lp(): retrieves the local part of a QName


Example of usage of R-IO KPIL
// primitive indicators
duration[min_max, precise, "second"];
cost[cumulative,  ranges, "euros"];

// aggregated indicators
CD[cumulative, ranges, "euros/second"]: (#cost()/#duration())*2;
SST[cumulative,   ranges, ""]: #duration(lp(functionType()) == "HumanFunction" )*0.6 + #cost(lp(functionType()) == "HumanFunction")*0.3;
SST_IT[min_max,   ranges, ""]: #CD() - #SST();
SST_FOR_SCOPE[cumulative, ranges, ""]: #duration(lp(functionType()) == "WaitFunction")*2 + #cost(lp(functionType()) == "WaitFunction")-0.5;

The following figures shows this script integrated in R-IO Suite.