The Rule Interface
Topic
Author:
Fluent Commerce
Changed on:
13 Nov 2023
Overview
The Rule Interface defines a class as a Workflow Framework compatible executable Rule.
Author:
Fluent Commerce
Changed on:
13 Nov 2023
The Rule Interface defines a class as a Workflow Framework compatible executable 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:
`context.getEntity()`
`context.api()`
`context.getEvent()`
`context.getProp()`
The `Context`
also provides the ability to output an action from the Rule. This is done via `context.action().<ActionName>`
.
Copyright © 2024-2025 Fluent Retail Pty Ltd (trading as Fluent Commerce). Unless otherwise expressly stated in a current written agreement with Fluent Commerce or any of its affiliates or on any single page of the docs.fluentcommerce.com site, use of the materials on this site is strictly limited to viewing by individuals over 18 years old for legitimate commercially appropriate reasons; and any downloading, copying or other actions or uses of any kind or by any means of the materials on this site, including by artificial intelligence tools, is strictly prohibited. All other rights reserved.