Author:
Randy Chan
Changed on:
3 Nov 2023
Understand what are some general Rule principles.
`items.0.currency`
`items.edges.0.node.currency`
Many of the rules in the core module accept a prop typed as a jsonPath, which is a period-separated string that describes a "path" between the entity being processed and a field on it or a related entity.
In essence, this category of rules understands how to generate dynamic queries to maximize flexibility across domains and use cases. In most cases, the value/s loaded via this dynamic query will be compared against another rule prop as described by the rule name and description.
For example, fields on or related to the Order entity could be accessed with the following paths:
Path | Description |
| Use the state field of the Order. |
| Use the delivery type field of the Fulfillment Choice related to the Order. |
| Use the currency value of the first item of the Order. |
| Use the value of a custom attribute of the Order. |
Additionally, properties of the event can be referenced with the
`event.`
Path | Description |
| Use the entity subtype from the event. |
| Use the value of a custom event attribute. |
| As above, as long as the attribute name doesn't clash with a standard attribute field. |
Finally, there are some helpers to simplify specific use cases: - when traversing connection types, edges, and node fields will be automatically skipped over even if they're not added to the path, e.g., the
`items.0.currency`
`items.edges.0.node.currency`
`items.first.currency`
`items.last.currency`
`byName`
`attributes.byName.promoCode`
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.