public interface DslVariable<Level> extends DslExpression<Level>
WorkflowDefinition| Modifier and Type | Method and Description |
|---|---|
Level |
value(int id,
Object value)
Store the given constant value or expression result into the environment under the variable name from the previous node:
.variable( "name" ).value( 1, "Heli Kopter" ) |
call, callAsync, humanTask, waitSignalLevel value(int id, Object value)
.variable( "name" ).value( 1, "Heli Kopter" )
NB! There is a Gotcha here: DSL parse time vs. workflow instance run time. All the java objects (for example new Date()) are created
at the DSL parse time (server startup) vs. all the EL expressions (for example "${NOW}") are evaluated at the runtime when
this workflow node is processed. So when you are doing .variable( "name" ).value( 1, new Date() ) then you are
actually getting the server startup date value there, not the runtime moment, when this instance node 1 was processed. So you
should use only constant values (like strings, numbers, enums etc.) as java objects, and EL expressions for creating runtime
dynamic objects.
id - node idvalue - variable value (any java object (only suitable for constants, see NB!) or "${EL_EXPRESSION}")Copyright © 2017. All rights reserved.