Author:
Fluent Commerce
Changed on:
6 Nov 2023
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.
Author:
Fluent Commerce
Changed on:
6 Nov 2023
Basic structure of a Workflow Framework Rule
The basic structure of a Workflow Framework Rule includes:
`com.fluentretail.rubix.v2.rule.Rule`
`@RuleInfo`
Here's an example of a simple Rule:
1package com.example.rule;
2
3import com.fluentretail.rubix.rule.meta.RuleInfo;
4import com.fluentretail.rubix.v2.context.Context;
5import com.fluentretail.rubix.v2.rule.Rule;
6
7@RuleInfo(
8 name = "ExampleRule"
9 , description = "This is the description of the Example Rule, which should include all parameters declared below like this: {ParamString1}"
10)
11@ParamString(name = "ParamString1", description = "Parameter String 1", defaultValue = "PS1")
12@EventAttribute(name = "EventAttribute1", type = "STRING")
13public class ExampleRule implements Rule {
14
15 @Override
16 public <C extends Context> void run(C context) {
17 // ...
18 }
19}
Language: java
Name: Example Rule
Description:
[Warning: empty required content area]See the following references for more on Rule Structure:
Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.