ee.telekom.workflow.api.DslBlock 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 DslBlock extends DslExpression{
/**
* Set an environment variable with the given name. The value comes from the next immediate node (value, call, callAsync, humanTask, waitSignal).
*
* @param name name of the environment variable which is going to be set
*/
DslVariable variable( String name );
/**
* Set environment variable with the given names. The value comes from the next immediate node (value, call, callAsync, humanTask, waitSignal). Used
* when the value returning node return a Map
result and we want to store one or more key-value pairs from this Map
directly
* into the environment (instead of storing the whole Map
under a new variable name and then accessing the key-value pairs as subfields
* inside this Map
value).
*
* If the returned Map
contains 3 keys: x, y and z, then the call .variables( "a=x", "b=y" )
should be read as: take
* x
from method call result map and store it into environment as a
, and take y
from method call result map and
* store it into environment as b
, and ignore z
.
*
* @param nameMappings desired mappings of the environment variable: new_environment_variable_name=returned_map_key_name
*/
DslVariable variables( String... nameMappings );
/**
* Creates a new workflow instance based.
*
* @param id node id
* @param workflowName the workflow's name to be created ("STRING_WORKFLOW_NAME" or "${EL_EXPRESSION}")
* @param workflowVersion the workflow's version to be created or null
for the latest
* @param label1 first label ("STRING_LABEL" or "${EL_EXPRESSION}")
* @param label2 second label ("STRING_LABEL" or "${EL_EXPRESSION}")
*/
DslAttribute createInstance( int id, String workflowName, Integer workflowVersion, String label1, String label2 );
/**
* Wait until a defined time period has passed.
*
* ### WAIT STATE ###
*
* @param id node id
* @param due either a constant Long value of milliseconds or an EL expression which returns the milliseconds ("LONG_VALUE" or "${EL_EXPRESSION}")
*/
Level waitTimer( int id, String due );
/**
* Wait until a defined date has been reached
*
* ### WAIT STATE ###
*
* @param id node id
* @param due an EL expression which returns the date ("${EL_EXPRESSION}")
*/
Level waitUntilDate( int id, String due );
/**
* While the given condition is true, execute the block content and then check again.
*
* Block start tag.
*
* @param id node id
* @param condition expression language condition ("EL_EXPRESSION")
*/
DslWhileDoBlock whileDo( int id, String condition );
/**
* Start tag for a do-while block. Execution continues into the block content.
*/
DslDoWhileBlock doWhile();
/**
* Start tag for if-elseIf-else-endIf block. If the given condition evaluates to true, then executes the branch content and ignores the other elseIf
* and else branches, otherwise evaluates the following elseIf or else condition.
*
* The if-elseIf-else-endIf block executes only one of it's branches.
*
* @param id node id
* @param condition expression language condition ("EL_EXPRESSION")
*/
DslIfBlock if_( int id, String condition );
/**
* Start tag for splitting the execution into multiple parallel branches.
*
* @param id node id
*/
DslSplit split( int id );
}