Activities & Workflow

Orchard contains a mature workflow engine with some useful default activities which are the building blocks of the workflows. You can get more information about Orchard workflow here.

OrchardCollaboration defines a bunch of new activities which give you the flexibility to create customized workflows. A simple usage can be creating a review ticket for any new content created by your editors. Or creating a new ticket for any form that the visitors or users submit. Here is the list of activities defined by the module.

Create Ticket (Orchard.CRM.Core.Activities.CreateTicketActivity)

This activity creates a new ticket. In its Edit Page, you can set the Title, Description, Priority… properties of the ticket.

For title or description fields, you can use any token defined by Orchard such as {ContentItem.Id}, etc. If the Content of the workflow is a ticket, then the created ticket will be the child of that ticket, otherwise the Content of the workflow will be attached to the ticket as the RelatedContentItem.

Edit Activity (Orchard.CRM.Core.Activities.UpdateActivity)

This activity allows you to edit the Ticket in the Workflow Context. This activity checks the ContentType of the Content of the workflow. If it is Ticket, then the activity updates that ticket. If it is CRMComment, then the activity updates the associated ticket of the CRMComment. Otherwise, the activity does nothing.

Create Permission

Create Permission is an event that will be raised in case of creating a new Permission in the system. The event will not be fired for permissions that will be created by adding a new Ticket. The event can be used as a start point of a workflow. In the workflow, the permission can be accessed via the TokenContext under the name  “Permission”. The related ticket of the permission will be set as the Content property of the Workflow.

Send Ticket Email Activity

This activity sends email to the selected people who are related to the Ticket. Compare to the Send Email Activity of the Orchard, this Activity gives you the options to select an Email Template and select which persons in the ticket will receive the email.

Send Permission Email Activity

It is similar to the Send Ticket Email Activity, except it sends email to the user or members of the business unit of the ContentItemPermissionDetailRecord instance that exists in the TokenContext of the workflow under the name “Permission”. This activity can be used with the Create Permission activity.

Send Email To Followers

This one can be used to send email to users who follow the Content related to the workflow.

Branch Activities

Branch activities of the Orchard Collaboration give you the option to do different actions based on the properties of the ticket existed in the Content of the workflow. For example, Ticket Type Branch activity has several Outcomes correspond to the different TicketType records. In runtime, the activity checks the Content type of the Workflow Context. In case the Content is not a Ticket or not a CRMComment, the Outcome of the activity is “Failed”. In case the TicketType of the ticket is null, the Outcome is unknown, otherwise Outcome is the same as the TicketType value of the ticket. In case of having a CRMComment in the Content of the workflow, it checks the corresponding ticket of the CRMComment item. The other branch activities of the module  have the similar behavior. The module has the following branch activities.

  • Ticket Type Branch
  • Priority Branch
  • Service Branch

Workflows

Orchard Collaboration by default, creates the following workflows. These workflows are default ones and you can change them, or delete them and create your own workflows that match your business requirements.

These workflows depend on "Workflow Timers" which by default is disabled in Orchard 1.9. So, in Orchard 1.9, you need to enable the "Workflow Timers" feature.

Send Email Create Ticket

After creation of any ticket, this workflow runs and it sends email to the people associated with the ticket to notify them that a ticket has been created.

Send Email Add Comment

After adding a comment to a Ticket, this workflow runs and it sends email to the people associated with the ticket to notify them that a comment has been added to the ticket.

Create Ticket For received Emails

This workflow is used to create tickets for received emails.

Send Email to followers

This workflow sends notification emails to anyone who follows an item after any change happened related to that item.