November Happy Hour will be moved to Thursday December 5th.

Workflows not working after Commerce 9 upgrade

Vote:
 

Hi,

After upgrading from Commerce 8.16 to 9.4 we're not able to run the built-in worlflows anymore.

When we do:

CartHelper.Cart.RunWorkflow(OrderGroupWorkflowManager.CartValidateWorkflowName)

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?

Lars

#142502
Dec 11, 2015 15:01
Vote:
 

Hi,

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.

Regards,

/Q

#142506
Dec 11, 2015 15:42
Vote:
 

Ok, thanks!

So we have to register the ActivityFlows at startup event though we only use the built in ones? This doesn't happen automatically anymore?

Lars

#142535
Dec 14, 2015 9:09
Vote:
 

Yeah, the mechanism of new engine is a bit different. We'll discuss to see if the default behavior needs to be changed.

Regards,

/Q

#142538
Dec 14, 2015 10:53
Vote:
 

Do I have to register each ActivityFlow somehow?

I added the line

ServiceLocator.Current.GetInstance<ExecutionManager>();

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.

Lars

#142540
Dec 14, 2015 11:11
Vote:
 

Hi,

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?

/Q

#142541
Dec 14, 2015 11:20
Vote:
 

Hi,

It's finally working! Turns out I misunderstood something in the article Commerce 9 - upgrading and migration:

Migration of Workflow and Activity projects

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:

  • Remove Mediachase.Commerce.WorkflowSystem.Workflow.ActivitiesSystem.Workflow.ComponentModel andSystem.Workflow.Runtime referenced assemblies from the Workflow and Activity projects.
  • ...

I thougth I was supposed to remove the referenced assemblies mentioned from my Commerce project. Adding Mediachase.Commerce.Workflow back fixed it :)

Thanks Quan!

Lars

#142544
Dec 14, 2015 13:10
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.