Fluent Commerce Logo
Docs
Sign In

Understanding Event Execution

Essential knowledge

Author:

Lesley Dean

Changed on:

30 Apr 2024

Overview

This page describes how Event Execution works.

Key points

  • When an Orchestration Event is received by the Rubix Orchestration Engine, it initiates the Execution Context. The Execution Context includes the event and the entity specified by the event.
  • Rubix will locate the Ruleset within the workflow that matches the signature of the event.

Execution Context

When an Orchestration Event is received by the Rubix Orchestration Engine, it initiates the Execution Context. The Execution Context includes the event and the entity specified by the event.

Workflow Framework - Event Execution

A quick explainer video on Event Execution.

Rubix loads and locates the appropriate workflow for the given event context, based on the entity type and version. Following this, Rubix will locate the Ruleset within the workflow that matches the signature of the event. The primary Ruleset matching criteria are as follows:

  • Event Name = Ruleset Name
  • Entity Type - e.g: Type = ORDER
  • Entity Subtype - e.g: Order.type = HD
  • Entity Status - e.g: Order.status = BOOKED

Once all matching Rulesets are matched, Rubix will execute each one in sequence.

If any Rule within the Rulesets produces a flow control event which is intended to trigger a new Ruleset, this will be matched and queued for execution within the same execution thread.

Any events produced from Rules that are not for the current workflow, including for a different root entity, will not be executed within the same execution context, but be processed separately by Rubix in a different thread.


No alt provided


What's Next?

We highly recommend reading Designing Rules next, which provides some additional guidelines on how to break down your requirements into compose-able reusable rules.