Workflow User Guide

From Pengower
Jump to: navigation, search

Introduction

The Pengower Workflow object allows creation of automated workflows which can be customized to produce Alerts, Tasks, or Approvals automatically based on a template.

Workflow Fields

Object Type

Defines the Type of the Object that is being processed. For example, if a Workflow needs to run when an Organisation is saved, then the Object Type should be “Organisation”.

Action Name

Defines a name for the Workflow that can be called from a script to run the said Workflow.

The Workflow’s Action Name is non-unique, which means the same Action Name can be used on multiple Workflow objects, however, calling an Action Name that is shared by multiple Workflow will result with all of the Workflows sharing that Action Name to run.

Type (Workflow Type)

Defines the kind of output the Workflow will generate - this could either be an Alert, a Task, or an Approval.

Alerts have three sub types which consist of the following: an Email Alert, an Email and SMS Alert, an SMS Alert, or an On-Screen Alert.

Applicable Level

Defines how the related Staff Record, to which the Workflow will flow to, will be retrieved.

Relationship – This should be selected if the Staff Records to which the Workflow should flow to are related to the Object that’s being processed. If Relationship is selected, then the “Relationship Element” should also be populated (see Relationship Element below).

Role – This should be selected if the Staff to which the Workflow should flow to are all Staff Records with a particular Role.

Personal – This is selected when the Workflow’s Object type is set to “Staff Record” which means that the Object that’s being processed is already a Staff Record.

Role

If “Role” is selected in the Applicable Type field, then this field defines the Role of the Staff Records to where the Workflow will flow to.

Relationship Element

If “Relationship” is selected in the Applicable Type field, then this field defines the name of the Relationship Element that is linked to the Staff Record(s) to which the Workflow will flow to.

Staff Records

Defines any specific Staff Records who need to be included in the Workflow.

Staff Level

Defines what to do with the Staff Records selected in the “Staff Records” field – the Staff Records will either be added to the Staff Records defined by the Role or it will Overwrite the Roles entirely.

Alert Details

Defines the details to be used for an Alert Workflow. This section can be skipped if the Workflow will not generate an Alert.

Subject

Defines the Subject of the generated Alert. This will function as the Subject for an Email alert and an On-Screen Alert.

Body

Defines the Body of the generated Alert. This will function as the Body for an Email Alert and On-Screen Alert.

Attachment Script

Defines the Name of the Action Script that will add an Attachment to the created Alert.

SMS Message

Defines the Message to be sent for an SMS Alert.

Delayed Alert?

Defines if the Alert will be sent immediately or at another time.

Delay From

Defines whether the delay will be at the time the Workflow is triggered or at a Specific Date. The Specific Date is passed to the Workflow upon triggering the Workflow.

Delayed By

Along with the Delay Period, this defines the delay for when the Alert will be sent out.

Delay Period

Along with the Delayed By, this defines the delay for when the Alert will be sent out.

Delay Direction

Defines if the Alert will be sent out before or after the Specific Date. If this is set as Forward then the Alert will be sent out after the Specific Date, otherwise, the Alert will be sent out prior to the Specific Date.

Alert Conditions

Defines the Condition fields for the created Alert. This section can be left blank if there are no Conditions for the Alert.

Alert Conditions

Defines the type of Alert Condition for the Alert.

No Condition – this is selected if the Alert will not have any condition.

Related Item – the condition for the generated Alert is dependent on an object that is related to the current Object that is being processed on the Workflow.

Current Item – the condition for the generated Alert is dependent on the current Object that is being processed on the Workflow.

Action – the condition for the generated Alert is dependent on an Action Script.

Related Item Element

Defines the name of the field holding the Related Object to the current Object that is being processed on the Workflow. See “Element Value” for example.

Element Name

Defines the name of the field on the Related Object that contains the value that will be used to check if the condition for the generated Alert is met. See “Element Value” for example.

Operator

Defines the logic operator for checking the value retrieved from the Related Object. See “Element Value” for example.

Element Value

Defines the value that will be checked against the value retrieved from the Related Object.

Example:

If the Current Object is a Contact object and the Related Object is an Organisation, and the Alert should only be sent if the Organisation’s name is set to “Hogwarts”. The following fields should have the following values:

Related Item Element: “Organisation”

Element Name: “Name”

Operator: “=”

Element Value: “Howarts”


Line Management Alerts

Defines if the Staff Record’s Line Manager should also receive an Alert.

Alert Line Management?

Defines if the Line Manager should receive an Alert.

Line Manager Of

Defines if the Line Manager that will receive the Alert will be that of the Current User or Related to the Current Object being processed on the Workflow.

LM AlerteeELement

Defines the Relationship Element that’s containing the Line Manager’s record on the Current Object being processed on the Workflow.

Level of Alert

Defines the number of levels of Line Managers that the Alert will be sent to.

Skip First Level Of Line Management?

Indicates whether the first level of Line Management should not be sent an Alert.

Delay Between Levels

Defines the number of days between sending alerts between Line Manager levels.


Approval Workflow

Defines the details to be used for an Approval Workflow. This section can be skipped if the Workflow will not generate an Approval.

Action to Display

Defines the name of the action script that will be set in the Approval object’s “Action to Display” field.

Action to Call

Defines the name of the action script that will be set in the Approval object’s “Action to Call” field.

Approval Summary

Defines the Summary for the Approval object.

Approval Description

Defines the Description for the Approval object.

Approval HTML Description

Defines the HTML Description for the Approval object.

Priority

Defines the Priority for the Approval object.

Approved Subject

Defines the Approved Subject for the Approval object.

Approved Body

Defines the Approved Body for the Approval object.

Declined Subject

Defines the Declined Subject for the Approval object.

Declined Body

Defines the Declined Body for the Approval object.

Approval Workflow

Defines the details to be used for a Task Workflow. This section can be skipped if the Workflow will not generate a Task.

Task Summary

Defines the Summary for the Task object.

Task Type

Defines the Task Type for the Task object.

Task Description

Defines the Description for the Task object.

Task Days From Today

Defines the number of days from today when the Task will be set to.

Element Names

Defines Element names of Relationship Fields on the Current Object where the Task will be mapped to.


Running a Workflow

A Workflow can only be triggered from an action script by calling the script “fnProcessWorkflow”. The script “fnProcessWorkflow” is expecting three mandatory variables, namely: “ActionName”, “ObjectType”, and “ObjectReferences”; and an optional variable: “SpecificDate”.

ActionName – The Action Name of the Workflow to be triggered.

ObjectTypes – The main object this Workflow is being run on (## separated).

ObjectReferences – The Reference of the object workflow is based around (## separated).

SpecificDate – A specific date/time value used for determining when an alert will be sent when a delay for the Alert is set.


Running a Workflow from an Action Script

Use the following Code Snippet to run a Workflow from an Action Script:

// Process Workflow

Set ActionName = "Workflow Action Name" // This can be retrieved from a variable

Set ObjectTypes = "Organisation" //This can be retrieved from a variable

Set ObjectReferences = “ORG-1” // This can be retrieved from a variable

Set SpecificDate = Do Create Date Params Day = 5, Month = 11, Year = 2017

// The SpecificDate value can also be retrieved from a variable.

Set args = {}

Add ActionNameToargs

Add ObjectTypesToargs

Add ObjectReferencesToargs

Add SpecificDateToargs

Set out = Do Run Script Params Script Name = "fnProcessWorkflow", Args = args