Class VariableMappingTransformer
java.lang.Object
io.camunda.zeebe.engine.processing.deployment.model.transformer.VariableMappingTransformer
Transform variable mappings into an expression.
The resulting expression is a FEEL context that has a similar structure as a JSON document. Each target of a mapping is a key in the context and the source of this mapping is the context value. The source expression can be any FEEL expression. A nested target expression is transformed into a nested context.
Variable mappings:
source | target
=======|=======
x | a
y | b.c
z | b.d
FEEL context expression:
{
a: x,
b: {
c: y,
d: z
}
}
Output variable mappings differ from input mappings that the result variables needs to be merged with the existing variables if the variable is a JSON object. The merging is done by calling the FEEL function 'context merge()' and referencing the variable.
{
a: x,
b: if (b = null)
then {
c: y,
d: z
}
else context merge(b, {
c: y,
d: z
})
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontransformInputMappings(Collection<? extends ZeebeMapping> inputMappings, ExpressionLanguage expressionLanguage) transformOutputMappings(Collection<? extends ZeebeMapping> outputMappings, ExpressionLanguage expressionLanguage)
-
Constructor Details
-
VariableMappingTransformer
public VariableMappingTransformer()
-
-
Method Details
-
transformInputMappings
public Expression transformInputMappings(Collection<? extends ZeebeMapping> inputMappings, ExpressionLanguage expressionLanguage) -
transformOutputMappings
public Expression transformOutputMappings(Collection<? extends ZeebeMapping> outputMappings, ExpressionLanguage expressionLanguage)
-