Fluent Commerce Logo
Docs

Rule Structure

Topic

Author:

Fluent Commerce

Changed on:

6 Nov 2023

Overview

Rules are written using Java, and contain a specific structure and metadata for describing and validating the Rule. Rules are designed to be building blocks for workflow logic, and typically produce a single outcome or action. The Rules SDK also provides a number of built-in dependencies for implementing Rules, including working with GraphQL and other Utilities.

Rule Definition

Author:

Fluent Commerce

Changed on:

6 Nov 2023

Overview

Basic structure of a Workflow Framework Rule

Key points

  • A Workflow framework rule includes a Java class, and additional event and parameters. 
  • The rule's annotation needs to follow best practises. More details here.
The basic structure of a Workflow Framework Rule includes:
  • A Java Class implementing the `com.fluentretail.rubix.v2.rule.Rule` interface
  • `@RuleInfo` Annotation describing the metadata for the Rule
  • Additional Event and Parameter Annotations defining the inputs of the Rule
Here's an example of a simple Rule:See the following references for more on Rule Structure:
Fluent Commerce

Fluent Commerce