After upgrading from Commerce 8.16 to 9.4 we're not able to run the built-in worlflows anymore.
When we do:
we get an error telling us that No activity flow model named CartValidate has been registered.
We do not have any custom worflows in our project. Is there something I've missed regarding breaking changes in Commerce 9? I didn't think we had to register any workflows if we only use the built-in ones?
In Commerce 9.0 we switch to non Workflow Foundation solution. The registration of "workflows" (now ActivityFlow) is done in the constructor of ExecutionManager. So you can either call ServiceLocator.Current.GetInstance<ExecutionManager>(); or OrderContext.Current.<Something> during the site initialization to get the workflows registered.
So we have to register the ActivityFlows at startup event though we only use the built in ones? This doesn't happen automatically anymore?
Yeah, the mechanism of new engine is a bit different. We'll discuss to see if the default behavior needs to be changed.
Do I have to register each ActivityFlow somehow?
I added the line
to our initialization module to make sure the ExecutionManager is newed up, but I still get the exception No activity flow model named CartValidate has been registered when I run the CartValidate ActivityFlow. When I inspect the ExectionManager object I see that it has a property called BetaMode which throws an ArgumentNullException.
The betamode is a flag to use the Flows which work with new promotion system.
Just to make sure, can you use some reflectors (ILSpy, dotPeek) to see if the CartValidateActivityFlow class is in your Mediachase.Commerce.Workflow.dll?
It's finally working! Turns out I misunderstood something in the article Commerce 9 - upgrading and migration:
After upgrading to version 9, you need to update and migrate existing workflows and activity projects to remove obsolete workflows and use the new engine.
Do the following:
I thougth I was supposed to remove the referenced assemblies mentioned from my Commerce project. Adding Mediachase.Commerce.Workflow back fixed it :)