AI OnAI Off
How does your CartValidateActivityFlow look like? It should have this attribute decorated:
[ActivityFlowConfiguration(Name = OrderGroupWorkflowManager.CartValidateWorkflowName)]
Here's CartValidate.cs. It seems to be decorated as you described.
namespace Mediachase.Commerce.Workflow
{
using Mediachase.Commerce.Orders;
using System.Collections.Specialized;
using System.Collections.Generic;
using Mediachase.Commerce.Inventory;
using System.Linq;
using Mediachase.Commerce.Engine;
using Mediachase.Commerce.Orders.Managers;
[ActivityFlowConfiguration(Name = OrderGroupWorkflowManager.CartValidateWorkflowName)]
public class CartValidate : Mediachase.Commerce.Engine.ActivityFlow
{
[Mediachase.Commerce.Engine.ActivityFlowContextPropertyAttribute()]
public OrderGroup OrderGroup { get; set; }//;
[Mediachase.Commerce.Engine.ActivityFlowContextPropertyAttribute()]
public StringDictionary Warnings { get; set; }//;
[Mediachase.Commerce.Engine.ActivityFlowContextPropertyAttribute()]
public Dictionary<int, IWarehouse> PickupWarehouseInShipment { get; set; }//;
public override Mediachase.Commerce.Engine.ActivityFlowRunner Configure(Mediachase.Commerce.Engine.ActivityFlowRunner activityFlow)
{
return activityFlow
.Do<Mediachase.Commerce.Workflow.Activities.ValidateLineItemsActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.Cart.GetFulfillmentWarehouseActivity>()
.If(() => CheckInstoreInventory())
.Do<Mediachase.Commerce.Workflow.Activities.PurchaseOrderActivities.CheckInstoreInventoryActivity>()
.Else()
.Do<Mediachase.Commerce.Workflow.Activities.CheckInventoryActivity>()
.EndIf()
.Do<Mediachase.Commerce.Workflow.Activities.CalculateTotalsActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.RemoveDiscountsActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.CalculateDiscountsActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.CalculateTotalsActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.Cart.RecordPromotionUsageActivity>()
.Do<Mediachase.Commerce.Workflow.Activities.CalculateTaxActivity>();
}
private bool CheckInstoreInventory()
{
Mediachase.Commerce.WorkflowCompatibility.ConditionalEventArgs e = new Mediachase.Commerce.WorkflowCompatibility.ConditionalEventArgs();
e.Result = PickupWarehouseInShipment != null && PickupWarehouseInShipment.Any();
return e.Result;
}
}
}
Try with this way:
Remove Mediachase.Commerce.Workflow, System.Workflow.Activities, System.Workflow.ComponentModel andSystem.Workflow.Runtime referenced assemblies from the Workflow and Activity projects and add them back with new version.
Hi everyone,
I'm having some issues with upgrading our episerver installation from 8 to 9.24.1.
When trying to run the CartValidate workflow, I get this error:
I have looked into this thread and did the following steps to try to solve this:
1. Added
to the initialization module. (I'm not sure how to verify that this runs.)
2. Used ILSpy to look into the Mediachase.Commerce.Workflow to verify that it includes the class 'CartValidateActivityFlow':
It does not seem that the class exists. The workflows are split into two different projects, Mediachase.Commerce.Workflow and Mediachase.Commerce.Workflow.Activities. I used the Workflow migration tool downloaded here to migrate the old workflows to use the new engine.