public class ValidateAttributeActivity extends AbstractNode
GraphInstance's Environment.
For a required attribute, it checks that the attribute's value is set in the environment (possibly also to null)
and that this value is assignable to the defined type.
For an optional attribute, it initialises the value to a default, if it is not yet set in the environment and ensures that
its value is assignable to the defined type.| Constructor and Description |
|---|
ValidateAttributeActivity(int id,
String attribute,
Class<?> type) |
ValidateAttributeActivity(int id,
String attribute,
Class<?> type,
boolean isRequired) |
ValidateAttributeActivity(int id,
String attribute,
Class<?> type,
boolean isRequired,
Object defaultValue) |
ValidateAttributeActivity(int id,
String name,
String attribute,
Class<?> type,
boolean isRequired,
Object defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(GraphEngine engine,
Token token)
Called when the
GraphEngine cancels the execution of a
Token, that is currently pointing to this node and is in a wait
state. |
void |
execute(GraphEngine engine,
Token token)
Performs node specific logic.
|
String |
getAttribute() |
Object |
getDefaultValue() |
Class<?> |
getType() |
boolean |
isRequired() |
void |
store(Environment environment,
Object result)
When a token execution on a node completes and returns control back to
the engine, then the engine mandates the node to store the node execution
result into the graph instance's environment.
|
getId, getName, toStringpublic ValidateAttributeActivity(int id,
String attribute,
Class<?> type,
boolean isRequired)
public ValidateAttributeActivity(int id,
String attribute,
Class<?> type,
boolean isRequired,
Object defaultValue)
public String getAttribute()
public boolean isRequired()
public Class<?> getType()
public Object getDefaultValue()
public void execute(GraphEngine engine, Token token)
NodeGraphEngineFacade#complete(WorkItem) method
must be called to continue executing the GraphInstance.engine - the GraphEngine which is performing the executiontoken - the Token which is currently executing in this nodepublic void cancel(GraphEngine engine, Token token)
NodeGraphEngine cancels the execution of a
Token, that is currently pointing to this node and is in a wait
state.engine - the GraphEngine which is performing the executiontoken - the Token pointing to this nodepublic void store(Environment environment, Object result)
Nodeenvironment - the environment to store the result inresult - the result to be storedCopyright © 2018. All rights reserved.