Calculated metrics allow you to create calculations based on the attributes of process steps or custom attributes. Various operators and expressions are available to create a calculation rule for a metric.

  • You can calculate the duration between two steps.
  • You can calculate with custom attributes (addition, subtraction).

Currently it is only possible to offset numbers against each other.

If you need further help with the implementation of your calculations, do not hesitate to contact your Scheer PAS consultant.

Available Operators

The following table of operators can be searched. To do this, enter your search phrase in the search field:

Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.

The table is being loaded. Please wait for a bit ...

OperatorDescriptionStructure
OperatorAddition
  • Allows the addition of expression2 and expression1.
"type": "OperatorAddition",
"expression1": {},
"expression2": {}
OperatorAttribute
  • Allows to extract an attribute (second operand) from the first node of a set of process nodes. This set of process nodes is itself the result of an expression (first operand).
  • Possible values for expression2: start, end, name (of a process step).
"type": "OperatorAttribute",
"expression1": {},
"expression2": {}
OperatorDivision
  • Allows to divide expression1 by expression2.
"type": "OperatorDivision",
"expression1": {},
"expression2": {}
OperatorEquals
  • Allows the comparison of expression1 and expression2.
"type": "OperatorEquals",
"expression1": {},
"expression2": {}
OperatorIndex
  • Allows to extract the process node at a given index (second operand) from a set of process nodes. This set of process nodes is itself the result of an expression (first operand).
"type": "OperatorIndex",
"expression1": {},
"expression2": {}
OperatorMultiplication
  • Allows to multiplicate expression1 and expression2.
"type": "OperatorMultiplication",
"expression1": {},
"expression2": {}
OperatorProcessAttribute
  • Allows to extract custom attributes from the given process.
"type": "OperatorProcessAttribute",
"expression": {}
OperatorSubtraction
  • Allows to subtract expression2 from expression1.
"type": "OperatorSubtraction",
"expression1": {},
"expression2": {}

Available Expressions

The following table of expressions can be searched. To do this, enter your search phrase in the search field:

Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro.

The table is being loaded. Please wait for a bit ...

ExpressionDescriptionStructure
FilterAttribute
  • Allows to extract an attribute from a process node. Only the first process node in the evaluation context is considered.
  • This filter can be used in a  LocationStep.
"type": "FilterAttribute",
"expression": {}
FilterIndex
  • Allows to extract the process node at the given index from the evaluation context.
  • This filter can be used in a LocationStep.
"type": "FilterIndex",
"expression": {}
FilterType
  • Allows to extract the type from a process node. Only the first process node in the evaluation context is considered.
  • This filter can be used in a LocationStep.
"type": "FilterType"
LocationPath
  • A LocationPath is a set of LocationSteps to be applied on the evaluation context.
"type": "LocationPath",
"steps": []
LocationStep
  • Represents a single step in a LocationPath.
    • axis: The given axis defines how to traverse the evaluation context. It indicates the direction of travel (possible values: descendant, ancestor).
    • nodeTest: Defines the name of the nodes to select on the given axis.
    • filters (optional): Allows to filter the selected process nodes.
"type": "LocationStep",
"axis": <>,
"nodeTest": <>,
"filters": <>
ValueBoolean
  • Represents a boolean value or operand for operating expressions.
"type": "ValueBoolean",
"value": <>
ValueNumber
  • Represents a number value or operand for operating expressions.
"type": "ValueNumber",
"value": <>
ValueString
  • Represents a string value or operand for operating expressions.
"type": "ValueString",
"value": <>

Calculation Rule Examples

Currently it is only possible to offset numbers against each other.

Calculating the Duration Between two Steps

Use CaseYou want to calculate the duration between step1 and step2. Each step is passed only once.
Description
  • To subtract two values, you need the OperatorSubtraction. The operator needs expression1 and expression2.
  • For each expression you have to extract the correct attribute/value from a process node. To do so, you need the OperatorAttribute. expression1 extracts the correct step and expression2 gets the correct value from this step. 
  • Then you need the LocationPath expression. Fill the steps array with the process step you need. Add this step to the property nodeTest . You also have to indicate the direction, descendant would be the default.
Example Calculation Rule
{
  "type": "OperatorSubtraction",
  "expression1": {
    "type": "OperatorAttribute",
    "expression1": {
      "type": "LocationPath",
      "steps": [{
        "type": "LocationStep",
        "axis": "descendant",
        "nodeTest": "step2"
      }]
    },
    "expression2": {
      "type": "ValueString",
      "value": "start"
    }
  },
  "expression2": {
    "type": "OperatorAttribute",
    "expression1": {
      "type": "LocationPath",
      "steps": [{
        "type": "LocationStep",
        "axis": "descendant",
        "nodeTest": "step1"
      }]
    },
    "expression2": {
      "type": "ValueString",
      "value": "end"
    }
  }
}

Adding two Values

Use CaseYou want to add CustomAttribute1 and CustomAttribute2.
Description
  • To add two attributes, you need the OperatorAddition. This operator needs two expressions.
  • Each expression should contain the value of one custom attribute. To get the values, you need the OperatorProcessAttribute. Apply this for expression1 and expression2.
  • In our example, the custom attributes are strings - which must be indicated. Therefore, we need to use expression ValueString (even if the actual value used for the calculation is a number).
Example Calculation Rule
{
    "type": "OperatorAddition",
    "expression1": {
        "type": "OperatorProcessAttribute",
        "expression": {
            "type": "ValueString",
            "value": "CustomAttribute1"
        }
},
    "expression2": {
        "type": "OperatorProcessAttribute",
        "expression": {
            "type": "ValueString",
            "value": "CustomAttribute2"
}
    }
}

Subtracting two Values

Use CaseYou want to subtract CustomAttribute2 from CustomAttribute1.
Description
  • To subtract two attributes, you need the OperatorSubtraction. This operator needs two expressions.
  • Each expression should contain the value of one custom attribute. To get the values, you need the OperatorProcessAttribute. Apply this for expression1 and expression2.
  • In our example, the custom values are strings - which must be indicated. Therefore, we need to use expression ValueString (even if the actual value used for the calculation is a number).
Example Calculation Rule
{
    "type": "OperatorSubtraction",
    "expression1": {
        "type": "OperatorProcessAttribute",
        "expression": {
            "type": "ValueString",
            "value": "CustomValue1"
        }
},
    "expression2": {
        "type": "OperatorProcessAttribute",
        "expression": {
            "type": "ValueString",
            "value": "CustomValue2"
}
    }
}
  • No labels