TopicTopics usually cover more ground than other articles.
Author:
Fluent Commerce
Changed on:
13 Nov 2023
Overview
The Rule Interface defines a class as a Workflow Framework compatible executable Rule.
Fluent Commerce
The Rule
The Rule interface declares a `run` method that takes in single runtime parameter of type `Context`.The `Context` contains everything the Rule instance needs to execute its logic.Here are the main things you will find available on the `Context` parameter for use within the Rule:
The Orchestrateable Entity - e.g: `context.getEntity()`
The API Client - e.g: `context.api()`
The Source Event - e.g: `context.getEvent()`
The Rule Parameters - e.g: `context.getProp()`
The `Context` also provides the ability to output an action from the Rule. This is done via `context.action().<ActionName>`.