Expression Evaluator Loop

Might be useful to someone: it asks for an expression like execution.getActivityId() and evaluates it dynamically.

Results are logged to Engine console.

start:Dummy: execution.getActivityId()
start:Expression: execution.getActivityId()
start:Eval Result: evalExpression
{
dummy => Value ‘execution.getActivityId()’ of type ‘PrimitiveValueType[string]’, isTransient=false
expression => Value ‘execution.getActivityId()’ of type ‘PrimitiveValueType[string]’, isTransient=false
Input_30ffcpk => Value ‘x= 123,450’ of type ‘PrimitiveValueType[string]’, isTransient=false
}

pc-expression.bpmn (8.4 KB)
Other examples:

  • execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation(“cancelDoSomething”).setVariable(“var”,“value”).correlate()
  • Math.sqrt(4)
  • java.lang.String.format(java.util.Locale.GERMAN,‘x=%8.3f’,123.45)