Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Workflows and activities

Describes how you can work with validation services and processors, in replacement of workflows and activities that were made obsolete by Optimizely Commerce Connect version 14.

In Optimizely Commerce Connect, activity flows were used to validate and calculate checkout totals. An activity flow is a container of steps or activities that can be executed. When executing an activity flow, a list of configured activities and if or else conditions are executed.

Replace activities with the following validation services and processors:

  • OrderValidationService
  • IPurchaseOrderProcessor
  • IPaymentPlanProcessor
  • IShipmentProcessor
  • IPlacedPriceProcessor
  • IInventoryProcessor
  • IPaymentProcessor
  • Order total calculators

These components are available in the EPiServer.Commerce.Order and EPiServer.Commerce.Order.Calculator namespaces.

Activity workflows

Replace each activity flow with the following services:

  • CartValidateActivityFlow – Use OrderValidationService.ValidateOrder() instead.
  • CartPrepareActivityFlow – Use OrderValidationService.ValidateOrder() and OrderGroupExtensions.CalculateTotals() instead.
  • CartCheckoutActivityFlow – Use OrderValidationService.ValidateOrder() and OrderGroupExtensions.CalculateTotals() instead.

Example for Commerce Connect 14 and 15

CartBuilder ch = new CartBuilder();
    foreach (VariationContent entry in entries)
    {
       ch.AddEntry(entry, quantity, false);
    }
    ch.Cart.ProviderId = "FrontEnd";
    OrderValidationService.ValidateOrder(ch.Cart);
    ch.Cart.AcceptChanges();

Activities

Replace each activity with the following extensions or processors:

  • AdjustInventoryActivity – Use IOrderGroupExtensions.AdjustInventoryOrRemoveLineItems() instead.
  • CalculateDiscountsActivity – Use IOrderGroupExtensions.ApplyDiscounts() and IOrderGroupExtensions.UpdateInventoryOrRemoveLineItems() instead.
  • CalculateTotalsActivity – Use IOrderGroupExtensions.CalculateTotals() instead.
  • CheckInventoryActivity – Use IOrderGroupExtensions.UpdateInventoryOrRemoveLineItems() instead.
  • ProcessPaymentActivity – Use IPaymentProcessor.ProcessPayment() instead.
  • RemoveDiscountsActivity – Use IOrderGroupExtensions.ApplyDiscounts() instead.
  • ShipmentSplitActivity – Use IOrderGroupExtensions.CalculateTotals() instead.
  • ValidateLineItemsActivity – Use IPlacedPriceProcessor.UpdatePlacedPrice() instead.

Did this page help you?