Overview
As of version 4.6.4.25, SalesPad Desktop's workflow has undergone significant changes. Users can still add rules, conditions, and actions that govern how business objects are handled in a workflow, however, the interface that you will use to configure these things will look/feel very different. This document will go over general workflow configuration and functionality.
Security Editor
To access the Security Editor, go to Modules -> System -> Security Editor, filter to "Workflow" and make sure all of the following security options are enabled for the group(s) responsible for configuring/maintaining workflow.
Note: Securities with an asterisk (such as Workflow Monitor) have sub-securities that are listed in the middle section of the Security field. Sub-security descriptions appear in the bottom section of the field
Log off and log back on to SalesPad. Workflow Setup and Workflow Monitor options should now be available on the ribbon.
Workflow Configuration
In this section, we'll go over the setup and configuration of your workflows, as well as give a brief overview of each of the screens that you'll find while going through this process.
Workflow Setup
The Workflow Setup screen is where you will manage all aspects of your workflow, from creating, configuring, deleting, and everything in between. This screen displays all of your workflows at a glance under the 'All' tab, or you can group them under individual business object tabs (ie; selecting the 'CaseTrackerCase' tab will filter your list to only display Case Tracker workflows).
Add a New Workflow
To create a new workflow, select the tab corresponding with the business object that you'd like to create a workflow for, then click the 'New' button. The Workflow Card will open, allowing you to set workflow batches, rules, conditions, and actions. If a specific business object tab was selected prior to clicking the New button, that business object will be pre-selected on the Workflow Card.
Note: If a particular business object is not available for selection, it will have to be added by SalesPad
Edit an Existing Workflow
To modify an existing workflow, highlight the workflow you'd like to edit, click the 'Edit' button. The corresponding Workflow Card will open, allowing you to modify any queues, rules, conditions, or actions, associated with the selected workflow.
Delete an Existing Workflow
To delete an existing workflow, highlight the workflow that you'd like to delete, then click the 'Delete' button.
Note: Workflows cannot be deleted if the corresponding Workflow Card is currently open in SalesPad
Workflow Card
The Workflow Card is where you will actually configure your workflow. Here, you can enable or disable a workflow, edit the queues and rules, and set conditions and actions.
As you'll notice, this screen is broken up into multiple separate windows. This section will go over each of the windows you'll find in the Workflow Card.
Workflow Properties
The Workflow Properties window is where you will set/edit all of the "header" information for your workflow (the business object associated with the workflow, the name of the workflow, etc.).
Workflow Key
You can also set specific criteria to determine whether a document will use one workflow over another. You do this by creating workflows with customized fields known as Workflow Keys. A workflow can have multiple keys, and each key can have multiple fields.
For a business object to match a key, all of the conditions of the key must be met. For a business object to match a workflow, any of the keys can be matched, meaning the business object can match Condition_1 AND Condition 2 of Key_1, OR just match Condition_1 (the only condition) of Key_2.
A workflow can also be made without keys, in which case every business object will match that workflow. If a business object matches multiple workflows based on the keys, the sequence of the workflow will determine which workflow the business object will go in.
For example; if you have a workflow for your standard purchases, but you'd like a separate workflow for all of your dropship purchases, you would create two workflows under the 'PurchaseOrder' business object, but they wouldn't be tied to a particular purchase order type. This is where the workflow key comes in. You would open the workflow that you'd like to handle Dropship Purchase Orders in the Workflow Setup screen, then select the 'Keys' tab. Create a key by pressing 'New Key' (you can give the Key a description here if you'd like, but it is not required), then add a new field by pressing the 'New Field' button. Within the new field, set the 'Evaluation Type' to "Value_Comparison", then set the 'Field' it is comparing to "PO_Type'". Once that is set, you can enter "Dropship" as the 'Value', and then save your changes. Doing this will cause any new dropship order to be sent into the corresponding workflow.
Queues Tab
At the bottom of the workflow card, you'll notice that there are two tabs: 'Queues' and 'Rules'. In the 'Queues' tab, users can add, edit, and resequence the queues.
Sequence |
Assigned automatically and determines queue order (clicking the Resequence button will auto-assign a sequence number to each queue) |
Queue Name |
The name of the queue (must be unique and is required) |
Forward Label |
The text of the button used to forward business objects through workflow |
Next Queue(s) |
Designate which queue(s) documents can be forwarded to (if more than one queue is selected here, SalesPad will prompt the user to manually select the desired queue before forwarding) |
Note: If more than one queue is selected under Next Queue(s) and a business object is being forwarded from the Workflow Monitor screen, SalesPad will not prompt for the next queue, and instead forward to the first available queue
Rules Tab
The 'Rules' tab is where you will configure the details of your workflow by creating rules. Workflow rules determine how business objects are forwarded through workflow. The Rules tab is split into three separate sections: Rules, Conditions, and, Actions.
Rules
Within this section, you can create/configure rules for your workflow. To add a new rule, click the 'New' button in the upper-left corner of the Rules section.
Sequence |
Assigned automatically and determines the order in which the rules will be evaluated (clicking the Resequence button will auto-assign a sequence number to each queue) |
Name |
The name of the rule (this is a required field) |
Description |
A description of the rule (optional) |
Evaluate |
Determines when the rule will be evaluated ('On Enter Queue' or 'On Exit Queue') |
Applies To Queue(s) |
Determine which queue(s) this rule will apply to |
Enabled |
Enable or disable a rule |
Prevents Movement |
Allow a rule to prevent a business object from continuing through the workflow if it does not evaluate as 'True' |
Conditions
Conditions are conditional statements used to determine if a rule has been satisfied. A rule can have more than one condition, but all conditions must evaluate as 'True' in order for the rule to be satisfied. There are four available condition types:
Value Comparison
Field Comparison
SQL Procedure
C# Script
Value Comparison
The value comparison condition compares a business object field (including user fields) to a static value.
If the field value matches the value entered, the condition will evaluate to 'True'.
Note: Field data type must match the value data type (ie; if the field type is 'string', then the value must also be 'string')
Field Comparison
The field comparison condition compares a business object field (including user fields) to another business object field.
If the field value matches the second field value, the condition will evaluate to 'True'.
SQL Procedure
The SQL procedure condition uses a SQL stored procedure to compare values.
SQL procedure does not exist in the database by default, but clicking the Generate button will create it. For example, SQL procedure for CaseTrackerCase business object will be generated as spcpCaseTrackerCaseWorkflowEvalRuleCondition.
Generated SQL procedure is empty by default and will need to be edited in Microsoft SQL Server Management Studio by adding desired conditions. Once the conditions are added, the user can then specify them in the Condition ID field.
C# Script
The C# script condition uses a C# script to compare values.
C# script is the most powerful condition type. It allows the user to write complex conditions in the form of an executable script. The available script parameters are:
Apollo.Data.BusinessObjectWithWorkflow businessObject
Apollo.Data.ValueWrapper conditionMatched
The businessObject parameter is the generic business object that is being forwarded through workflow and will need to be cast to the appropriate business object.
For example; if the business object that is being forwarded is CaseTrackerCase, then the cast would look like this:
SalesPad.Bus.CaseTrackerCase ctc = (SalesPad.Bus.CaseTrackerCase)businessObject;
The conditionMatched parameter is a Boolean value wrapper that determines if the condition is true. To make the condition true in the script, set:
conditionMatched.Value = true
To make the condition false, set:
conditionMatched.Value = false
Actions
Actions are operational statements that are executed when the rule is evaluated. A rule can have more than one action. If the rule does not have any conditions, all actions are executed. If the rule has any number of conditions, all conditions must be 'True' before any actions will be executed. There are five available actions:
Email
Print
Run Script
Move To Batch
Run Plugin
Email action is used to send email messages. Email settings will need to be configured in SalesPad before this action can be used. Please see the Settings section of the Emailing in SalesPad Desktop documentation for more information.
- Report Name – Name of the printed report that will be sent as an attachment in the email message. If the business object does not support printing, this field will be blank.
- Subject – The subject of the email
- Send To – The recipient of the email (semicolon-delimited list)
- CC – Carbon copy email address (semicolon-delimited list)
- BCC – Blind carbon copy email address (semicolon-delimited list)
- From – The 'From' email address
- Display Name – Display name that will be shown in the email message
- Reply To – The 'Reply To' email address
- Body – Body of the email message, click the ellipsis button to open the Email Body Editor (if email template is being used, this field will be inaccessible)
- Template – Email template (if email body is being used, this field will be inaccessible)
Note: Email templates are not available for all business objects. If email template is not available for a selected business object, the Template field will not be available
Using the Email Body Editor, you can edit the body of the email that will be sent.
The Email Body Editor is similar to the Email Template Editor in terms of functionality. You can type the email body text and even insert merge fields by clicking the Insert Merge Field button.
Print action is used to print reports.
- Report Name – Name of the report to be printed
- Printer Name – Name of the printer that will print the report
- Copies – Number of copies to be printed
Note: SalesPad will let the user know if the business object does not support printing in workflow
Run Script
Run script action is used to execute a C# script.
Run script is the most powerful action type. It allows the user to write complex actions in the form of an executable script.
The businessObject parameter is the business object that is being forwarded through workflow. Just like the condition script, it will need to be cast to the appropriate business object before it can be used (refer to the Conditions section above for more information).
Move To Batch
Move to batch action is used to send the business object to a specific workflow batch.
Run Plugin
Run plugin action is used to execute a business object-specific plugin.
Note: SalesPad will let the user know if the business object does not support plugins in workflow
Workflow Monitor
Workflow Monitor is used to view business object workflows and batches at a glance. It also allows users to forward business objects through workflow or send them to a specific batch.
The Workflow Monitor screen has a tab for each business object, such as PurchaseOrder and CaseTrackerCase. Every business object tab has a sub tab for each workflow. If business object does not support multiple workflows, sub tabs will not be shown. For example, CaseTrackerCase business object does not support multiple workflows.
Forwarding
To forward business objects through workflow, select one or more from the grid on the right and click the Forward button. SalesPad will ask the user to confirm the forward action. Clicking Yes will forward the selected business objects through workflow.
After forward action is complete, the Summary window is displayed.
Send To Batch
Send to batch is used to send business objects to a batch without actually forwarding them through workflow. Sending business objects directly to a batch will not trigger workflow rules, conditions, and actions.
To send business objects to a batch, select one or more from the grid on the right and click the Send To Batch button. SalesPad will ask the user to select the desired batch. Clicking OK will send the selected business objects to the selected batch.
Note: If multiple business objects are selected from two or more workflows, SalesPad will not be able to send to batch and will inform the user accordingly