Try Now
More in this section
Blogs RSS feed

Using and Customizing Sitefinity Workflow with Guard Activities

by Peter Marinov

The Sitefinity workflows are built on Windows Workflow Foundation 4.0 (WWF). By utilizing our implementation on WWF, you can leverage that technology and completely customize the logic executed within the process flow in the system to meet the needs of virtually any business scenario.

The workflow does so much more than define publication for approval status (i.e. published or draft). The workflow allows you to interact with the flow of the executed logic in any decision point and alter it in a customized way. In the following image, you can see the different options available at one location (switch). On each path/action, you can step in to add your own custom logic, or remove the built-in Sitefinity logic to meet your exact needs.

Workflow Sample Image

The workflow foundation reduces each business process to individual activities. These are the building blocks of every business process. Using Activities, you can create an abstract representation of any logical flow. Sitefinity uses three major types of Activities to facilitate the workflow. Let’s briefly go through each.

Code Activities

This is the most essential type of activity. It encapsulates any task that has to be done, any code that has to be executed at certain activity point. E-mail notification and scheduling are just two examples of Code Activities, and you can introduce your own Code Activities to accomplish any task.

Decision Activities

Decision Activities specify what next action options you have at any given status designation. For example, on "Draft" status, you can choose between "Send for Approval" or "Delete" action; on "Awaiting Approval" status, you can choose between "Reject" and "Publish." Available actions are specified by using a DecisionActivity in the FlowCharts.

Decision Activity Image

Guard Activities

Guard Activities control which roles and users are authorized to pass a certain point of the workflow. In Sitefinity, we use the Approvers and Publishers roles to map any of the more powerful group of users.

With Sitefinity 5.2, we have introduced the notion of negative guard activity so now you can use the Guard Activities, not only to say which user can pass it, but also to say which are not able to move forward in the workflow:

Guard Activity Image
Also, the way we build our Workflow UI (the actions buttons on the menu) is related to parsing the workflow tree and finding the decision activities in a specific workflow. For instance, with native Guard Activities you can control which users see which buttons, which creates a powerful way to control the user experience.

Here is a short video to demonstrate the process:

Sitefinity Guard Activities give you a wizard’s magical powers without the need for a white beard! Use them wisely!

Gandalf Road Sign

Leave a comment