Master To Web
Sitecore, Workflows

Sitecore WorkflowCounters namespace change

Recently, I was reading a post on how to change the workflow state of Sitecore items programmetically and noticed that I could not compile the example code in later versions of Sitecore.

Specifically, the following line in the example code was failing:

if (pipeline != null)
{
    WorkflowCounters.ActionsExecuted.IncrementBy(pipeline.Processors.Count);
}

To fix the problem, simply replace the problematic line with the new namespace for the same action:

if (pipeline != null)
{
    Sitecore.Diagnostics.PerformanceCounters.DataCount.WorkflowActionsExecuted.IncrementBy((long)pipeline.Processors.Count);
}

Related posts

Create a Global Header and Footer for your Sitecore website

Amir Setoudeh
7 years ago

Create a Help Dialog for your Sitecore components

Amir Setoudeh
6 years ago

Winning a Sitecore Ultimate Experience Award

Amir Setoudeh
8 years ago
Exit mobile version