Interface ActionContext
- All Superinterfaces:
EvaluationContext
What an action runs against: the run's facts and the output object.
Implemented by the engine, which passes it to a language. It's sealed, so a language can't implement it; a
language's unit tests create one with io.github.brantunger.unruly.test.LanguageTestContexts, from the
unruly-engine-test artifact. Because only the engine implements it, a later release can add methods to it
without breaking languages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name an action uses for the output object, in a language that binds it to a name, such as MVEL. -
Method Summary
Methods inherited from interface io.github.brantunger.unruly.api.language.EvaluationContext
deadline, facts, isCancelled, onCancel, runScoped, runScopedClosing, startedAt, tags, timeLeft
-
Field Details
-
OUTPUT_NAME
The name an action uses for the output object, in a language that binds it to a name, such as MVEL. It's the fact nameExpressionLanguage.reservedFactNames()reserves by default, so no fact can have it in an engine with a language that doesn't say otherwise.- See Also:
-
-
Method Details
-
output
Object output()Returns the output object. The action changes it in place, or returnsActionResult.set(java.util.Map)with the properties for the engine to set on it. An action can't replace it.- Returns:
- The output object, never
null
-