DOMS toolkit
Introduction
The DOMS toolkit helps users define factors which should be considered when making the decision for the best fulfillment location.
The system allows to define fences and ratings:
Fences: Exclude facilities from order routing according to the fences selected
Ratings: Weigh facilities against each other according to the ratings selected
Toolkit fences
ToolkitFence fields in detail
Rules for toolkit fences
There are two rule types which can be defined:
Conditional rule
Use "rule" to set up a conditional rule. Can be used for comparing each side against a fixed value (e.g., order line item quantity > 3). Incompatible with using the comparisonRule field. Conditional rules test a certain property of an entity (Order
, Facility
, Listing
) against a pre-defined static value.
Comparison rule
Use "comparisonRule" to set up a comparison rule. Comparison rules compare a certain property of the left-hand side (Order
) to a certain property of the right-hand side (Order
, Facility
, Listing
). Incompatible with using the rule field.
An example of this could be an order with products of a certain brand demanding a facility tagged with the same brand.
Toolkit ratings
Toolkit ratings follow nearly exact same syntax as toolkit fences with a few key differences:
order
: since all ratings get evaluated either way the order field does not exist for ratingsmaxPenalty
: the penalty which determines the weight of the rating in comparison to other ratings
Introduction to JSONPath
It always begins with $
referring to the entity, followed by a path to the nested property. (e.g. $.orderLineItems[*].quantity
) Used in:
The JSONPath documentation can be found here
A helpful tool for testing JSONPath expressions can be found here
Introduction to transformers
Transformers allow to modify the input of a ToolkitPredicate
before it gets evaluated. This can serve multiple purposes, maybe you only want to look at the number of elements, get the total price of all OrderLineItem
s or just want to consider the beginning of the tenantOrderId
.
These are the transformations currently available in the platform.
SUM
: sums the number values of each element - requires an array of elementsCOUNT
: counts the number of elements - requires an array of elementsSUBSTRING
: gets a substring of a value, requiresstart
andend
parametersLAST
: gets the lastn
chars of a string - requiredlength
parameter
Count transformation
{
"propertyPath": "$.orderLineItems[*]",
"transformation": "COUNT",
"entityOperator": "GREATER_THAN",
"expectedValue": 10
}
Applies to orders with 10 OrderLineItems
or more.
Sum transformation
{
"propertyPath": "$.orderLineItems[*].quantity",
"transformation": "SUM",
"entityOperator": "GREATER_THAN",
"expectedValue": 100
}
Applies to orders where all OrderLineItems
in sum have a total quantity of 100.
Substring transformation
{
"propertyPath": "$.orderLineItems[*].article.tenantArticleId",
"transformation": "SUBSTRING",
"entityOperator": "ANY_VALUE_EQUALS",
"expectedValue": "Coca",
"transformationArgs": [0, 4]
}
Applies to orders where any OrderLineItem
has a tenantArticleId
that begins with "Coca".
Last chars transformation
{
"propertyPath": "$.orderLineItems[*].article.tenantArticleId",
"transformation": "LAST",
"entityOperator": "ANY_VALUE_EQUALS",
"expectedValue": "Christmas Special"
}
Applies to orders where any OrderLineItem
has a tenantArticleId
that ends with "Christmas Special"
Last updated