Splitter
Use this component to divide an order into groups based on a list of item keys. For example, in the Accept stage, the Splitter component can be used to divide orders by catalog and vendor; in the Shipping stage it can be used to divide an order into shipments by shipping methods and addresses.
Intended use: Order Processing pipeline, any stage.
Configuration Values
You can determine how the Splitter component divides orders by setting component properties. Use the following boxes on the OrderSplitter tab of the Component Properties dialog box to determine this information.
Box | Description |
Output Structure | The name of the SimpleList object that points to the resulting dictionaries. The Splitter component creates one dictionary for each set of distinguisher values. |
Input Distinguishers | A space-separated list of line item attributes (keys) to use to split the order. The defaults are the shipping _method _id and shipping _address _id keys, the distinguishers for splitting orders into multiple shipments. |
Values Read
The Splitter component reads the following values from the indicated dictionaries.
Key | Dictionary | Description |
CacheManager |
Context | A reference to a CacheManager object. If supplied, this component will automatically look up the shipping method name and write it to the output structure if shipping_method_id is a distinguisher. |
ShipmentDistinguishers |
Context | Optional. An array of strings containing the line item attributes (keys) to use to split shipments. The defaults are the shipping _method _id and shipping _address _id keys. This key is used only if no values are specified in the InputDistinguishers box. For example, Dict("ShipmentDistinguishers") = "quantity shipping_address_id name shipping_method_id ..." . |
Values Written
The Splitter component writes the following values to the Order dictionary.
Key | Description |
dynamic (what the Output Structure is set to) |
(Optional) The name of the SimpleList object that points to the resulting dictionaries. The Splitter component creates one dictionary for each set of distinguisher values. The Shipments key is used only if no other key is specified in the OutputStructure box. |
Remarks
For information about setting up the Splitter component to divide orders into multiple shipments , see Using the Splitter to Create Multiple Shipments.
Example
With the Splitter component, you can split an order any way you want. For example, you have four line items, numbered zero (0) through three (3) with the following attributes:
shipping_method_id | shipping_address_id | shipping_date | catalog | vendor |
A | Home | ASAP | A | A |
A | Home | ASAP | A | A |
B | Work | ASAP | B | B |
A | Work | 3/1 | C | B |
If you split by shipping_method_id and shipping_address_id, to an output structure called _Shipments
, you will get a SimpleList object of dictionaries on your order form called "shipments" with the following entries:
shipping_method_id | shipping_address_id | ItemIndexes |
A | Home | 0,1 |
B | Work | 2 |
A | Work | 3 |
If you split by vendor, to an output structure called _Vendors
, you will get a SimpleList object of dictionaries on your order form called "_Vendors" with the following entries:
Vendor | ItemIndexes |
A | 0,1 |
B | 2,3 |