Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!

Customized workflows are not getting called. Episerver.Commerce 9.19

Vote:
 

We have "CartValidate" workflow customized. And that does not work. When I debuged seems like the workflow instance created is always this:

ActivityFlowModel workflow = ServiceLocator.Current.GetInstance().GetActivityFlowModel(OrderGroupWorkflowManager.CartValidateWorkflowName);

{Mediachase.Commerce.Engine.ActivityFlowModel}

ActivityFlowType: {Name = "CartValidateVNextActivityFlow" FullName = "Mediachase.Commerce.Workflow.CartValidateVNextActivityFlow"}
AvailableInBetaMode: true
Description: null
DisplayName: null
Name: "CartValidate"
Priority: 0

Is there any information out there on these "CartValidateVNextActivityFlow" Activity flow added in version 9 at some point? Is there a way I can specify priority in my workflow so it always gets called first?

#151567
Jul 28, 2016 23:19
Vote:
 

Hi,

How did you customize the workflow?

/Q

#151575
Jul 29, 2016 10:42
Vote:
 

Hi Quan!

I mean the activity flow. It was working till 9.6 version. Here is what I have for my "CartValidate" activity flow.

[ActivityFlowConfiguration(Name = OrderGroupWorkflowManager.CartValidateWorkflowName, Priority = 1)]
public class CartValidateActivityFlow : ActivityFlow
{
public override ActivityFlowRunner Configure(ActivityFlowRunner activityFlow)
{
return activityFlow.Do<WOWCommerce.Workflow.Activities.OrderGroupActivities.ValidateLineItemsActivity>()
.Do<GetFulfillmentWarehouseActivity>()
.If(() => ShouldCheckInstoreInventory())
.Do<CheckInstoreInventoryActivity>()
.Else()
.Do<WOWCommerce.Workflow.Activities.OrderGroupActivities.CheckInventoryActivity>()
.EndIf()
.Do<CalculateTotalsActivity>()
.Do<RemoveDiscountsActivity>()
.Do<CalculateTotalsActivity>()
.Do<CalculateDiscountsActivity>()
.Do<CalculateTotalsActivity>()
.Do<WOWCommerce.Workflow.Activities.OrderGroupActivities.CalculateTaxActivity>()
.Do<RecordPromotionUsageActivity>();
}
}

#151592
Jul 29, 2016 19:26
Vote:
 

Hi,

It looks like somehow your site has the VNextFeature flag activated - (it's default if you install a new site in Commerce 9.19). Therefore CartValidateVNextActivityFlow which has AvailableInBetaMode flag will be used.

You should change your registration to this 

[ActivityFlowConfiguration(Name = OrderGroupWorkflowManager.CartValidateWorkflowName, Priority = 1, AvailableInBetaMode = true)]



Regards,

/Q

#151594
Jul 29, 2016 20:10
Vote:
 

Awesome Awesome Awesome!!!!

That just worked. So do we need to remove that  AvailableInBetaMode = true, at some point in future versions?

#151596
Jul 29, 2016 20:36
Vote:
 

Hi,

No, if you still have VNextFeature enabled you'll still need that AvailableInBetaMode flag. If we ever change that, it'll be a breaking change and requires a major version - and the solution will not even compile (make it easier to fix)

/Q

#151600
Jul 30, 2016 14:06
Vote:
 

Hi Quan,

So, after we upgraded to EPiServer Commerce v9.24, it looks like AvailableInBetaMode has not effect and our custom workflow is not being called.

To fix this, we had to remove this property at all and disable VNextFeature from ecf.app.config.

The issue resulted in stop sending some tax information after orders were placed.

Do you have any idea what changed between v9.19 and 9.24 that lead to this behavior? As per above comment, it was mentioned that flag AvailableInBetaMode should be set to true all the time if VNextFeature is enabled which was the case.

We owe our client an explanation for that and appreciate your valuable inputs.

Thanks!

#172751
Dec 09, 2016 20:35
Vote:
 

Hi,

That's very strange. AvailableInBetaMode is still in effect. Note that if you want to override a default workflow (ActivityFlow), you'll have set the Priority value to be higher than the default one.

#172771
Dec 12, 2016 9:34
Vote:
 

We had the priority as "1" all the time:

[ActivityFlowConfiguration(Name = OrderGroupWorkflowManager.CartCheckOutWorkflowName, Priority = 1)]

#172783
Dec 12, 2016 15:39
Vote:
 

If you can turn on the Debug level for your log, and restart your site, you should be able to see the log entries like this:

Registering a activity flow model: Name={0}, AvailableInBetaMode={1}, ActivityFlowType.FullName={2}, Priority={3}

Overwriting {0} activity flow by {1} with priority {2}

Which might shed a light of which activityflows are registered and which overwrote which.

#172784
Dec 12, 2016 15:42
Vote:
 
#173140
Dec 15, 2016 4:31
* 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.