ConfigureLineItem

Whenever the user triggers the creation of a new line item by tapping a sales item on the register grid/list, it should be possible to invoke a custom workflow instead of using the default enfore functionality. The workflow will be triggered if the activated sales item has a custom workflow configured for the ConfigureLineItem extension point.

The workflow receives information about the selected sales item and is expected to return one or more fully configured line items. The returned items may all be “root level” items but may also include “sub/depending” items to allow for configuration of BTO products within the CUWO.

Additionally, the returned items may include discounts that will be respected by the enfore pricing engine. Note that the pricing engine may add additional discounts based on the configured promotions/price lists.

If the workflow completes successfully, the line items will be added to the basket/order. If the workflow fails, an error is shown and the basket/order is not modified.

Workflow parameters

The ConfigureLineItem-CUWO does not yet receive a dedicated WorkflowParameters structure.

Success result

On success, the ConfigureLineItem-CUWO is expected to pass a ConfigureLineItemWorkflowResult structure to terminateSuccess.

Attention/Note:

As of CUWO-API v6.0, the expected result structure of EP1 is an instance of n4.cuwo.workflows.configurelineitem.ConfigureLineItemWorkflowResult. For the time being, the enfore runtime will also accept instances of the old n4.cuwo.ConfigureLineItemWorkflowResult type. This support will be removed in a future version of the CUWO-API.

The n4.cuwo.workflows.configurelineitem.ConfigureLineItemWorkflowResult structure is defined as:

/**
 * The result value for a "configure line item" workflow.
 */
class ConfigureLineItemWorkflowResult extends WorkflowResult {
    readonly "@type" : string = "n4.cuwo.workflows.configurelineitem.ConfigureLineItemWorkflowResult";

    /**
     * The line items that have been configured and are to be
     * added to the basket.
     */
    public lineItems : DataList<LineItem>;
}

The n4.cuwo.ConfigureLineItemWorkflowResult structure is defined as:

/**
 * The result value for a "configure line item" workflow.
 */
@Deprecated
class ConfigureLineItemWorkflowResult extends WorkflowResult {
    readonly "@type" : string = "n4.cuwo.ConfigureLineItemWorkflowResult";

    /**
     * The line items that have been configured and are to be
     * added to the basket.
     */
    public lineItems : DataList<LineItemInfo>;
}

Failure result

The ConfigureLineItem-CUWO does not yet have a dedicated WorkflowFailure structure to pass into terminateFailure.

Cancelation result

The ConfigureLineItem workflow does not support cancelation.