All Superinterfaces:
EvaluationContext

public sealed interface ActionContext extends 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 Details

    • OUTPUT_NAME

      static final String 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 name ExpressionLanguage.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 returns ActionResult.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