Class SplitProcessor
Handles the processing of complete request items.
Inherited Members
Namespace: Mediachase.Commerce.InventoryService.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 13.30.0Syntax
public class SplitProcessor : RequestItemProcessor
Constructors
SplitProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordStateSet)
Creates a new instance of SplitProcessor.
Declaration
public SplitProcessor(InventoryRequest request, InventoryRequestItem requestItem, OperationKeySerializer operationKeySerializer, RecordStateSet recordStateSet)
Parameters
Type | Name | Description |
---|---|---|
InventoryRequest | request | The request containing the item to process. |
InventoryRequestItem | requestItem | The request item to process. |
OperationKeySerializer | operationKeySerializer | The OperationKeySerializer for encoding and decoding operation keys. |
RecordStateSet | recordStateSet | The collection of RecordState values for the request. |
Methods
Apply()
Applies the request item to the appropriate RecordState.
Declaration
public override void Apply()
Overrides
Remarks
The split request item will be marked as a failure if operation key cannot be deserialized, if the inventory record for the original request can no longer be found, or if the requested quantity is less than zero or greater than or equal to the quantity of the original request being split.
Split will never change the quantities of any inventory records; it only breaks existing operations into two parts.
GetResponseItems(Boolean)
Creates the reponse items. Successful requests of type Split will return two response items, one for each half of the original request; and will have ResponseTypeInfo set to indicate which part of the split each item represents.
Declaration
public override InventoryResponseItem[] GetResponseItems(bool isOverallSuccess)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isOverallSuccess | True if all items in the request succeeded, otherwise false. |
Returns
Type | Description |
---|---|
InventoryResponseItem[] | If successful, two instances of InventoryResponseItem representing the result of this request item; otherwise, a single item representing failure. |
Overrides
Validate()
Validates that the request item is successful.
Declaration
public override bool Validate()
Returns
Type | Description |
---|---|
System.Boolean | True if the request item is successful; otherwise, false. |
Overrides
Remarks
The split request item will be successful if the conditions in Apply() are met.