ee.telekom.workflow.api.DslVariable Maven / Gradle / Ivy
Show all versions of workflow-api Show documentation
package ee.telekom.workflow.api;
/**
* DSL for workflow definitions.
*
* @author Erko Hansar
* @author Christian Klock
*
* @see WorkflowDefinition
*/
public interface DslVariable extends DslExpression{
/**
* 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" )
*
* 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.
*
* @param id node id
* @param value variable value (any java object (only suitable for constants, see NB!) or "${EL_EXPRESSION}")
*/
Level value( int id, Object value );
}