Workflow Rule Configuration

To build a workflow process for a form, you must start by creating its workflow rules.  A workflow rule defines the conditions under which one or more actions are supposed to happen when the rule is invoked.

 

E-Forms Manager allows you to define two different types of rules: Submission Rules and Callable Rules.  All of a form's submission rules are invoked automatically by the server when the form is submitted.  Callable rules are defined separately from submission rules. Instead of being called automatically upon submission, a callable rule may only be called explicitly from an action associated with another rule.

 

When creating a rule, you may specify whether or not it is conditional.  If conditional, the workflow engine evaluates the conditional expression associated with the rule against the contents of the form to determine whether or not to execute the Rule's actions.  You can then set up different sets of actions to execute depending on whether your condition evaluates to true or false.  If the rule is not conditional, then its actions are always executed upon submission of the form.

 

Most workflow processes depend on email to route forms from one user to another as they are submitted for completion, or to send notifications based on the status of the workflow process.  So most workflow processes will involve the creation of Email Templates, which allow you to route forms or send notifications using customized messages that may contain text dynamically supplied from form data or submission information.

 

To navigate to the workflow rules and email templates that are configured for a form version:

 

  1. Select a form version from the Form Catalog.

  2. View or edit the Form Version Details for the selected form version.

  3. Click the Workflow tab for the form version.

 

Once on the Workflow tab, you will see four sub-tabs labeled Submission, Callable, Email Templates, and Autowrite Handlers.

 

Submission Rules

The process of configuring a workflow rule, whether it is defined as a Submission or Callable rule, is largely the same.  These types of rules are differentiated from each other only by how they are invoked.

 

Every Submission rule associated with a form version is invoked whenever a copy of that form is submitted to the server.  A form version's workflow process may involve one or multiple rules.  When the form is submitted, each of its Submission rules are evaluated in order.  Upon evaluation of each submission rule, if its condition evaluates to true (or if it is not conditional) then its "true" actions are executed.  Or, if the rule is conditional, has "false" actions associated with it and it evaluates to false, then its "false" actions will be executed.  Once the execution of a rule's actions is completed, the workflow engine evaluates the next rule in the list.  This process continues until all of the Submission rules for a form have been evaluated.

 

Callable Rules

Unlike a Submission rule, a callable rule is not evaluated automatically by the server upon submission of a form.  Instead, it must be called explicitly from a workflow action that is associated either with one of the form version's Submission rules, or even another Callable rule.

 

The purpose of Callable rules is to allow the definition and grouping together of a set of actions that might be used in multiple steps of a workflow process.  Since a callable rule may be invoked from any other rule, this allows you to reuse a set of actions without having to define them multiple times within the context of the rules to which they apply.  For example: Imagine that you have an "Employee Action Form" that is used for three different business processes - a new hire, termination, or payroll change.  The start of these three processes would be defined by three different Submission rules, each containing a different condition.  If each business process requires that a generic notification be sent to HR upon every submission of the form, regardless of the type of transaction, you could set up a Callable rule with a Send Email action that could then be invoked from each of the three rules.  By associating this action with a Callable rule, you need only define the email template and recipients once, instead of once for each type of submission.

 

Like Submission rules, Callable rules may be conditional or non-conditional.  Actions associated with a non-conditional Callable rule are executed every time this type of rule is invoked from another rule.  When a Conditional rule is called, its conditions are evaluated first, and the execution of its actions is dependent on the outcome of this evaluation.

 

Viewing Workflow Rules

When you are on a form version's workflow tab, and are on either the Submission or Callable sub-tab, you will see a list of any rules that have been defined.  For each rule that is listed, the following information is displayed:

 

 

If you navigated to this list of workflow rules through the Edit Form Version link, then two additional items will be displayed:

 

 

If the form's workflow is enabled, then the Edit and Delete links will be disabled.  You must first disable workflow for the form in order to edit or delete any of its rules.

 

Creating a Workflow Rule

 

The process of creating a workflow rule is basically the same whether you are creating a Submission or a Callable rule, so the instructions below can be used for both types.  A new workflow rule can be added to a form version by completing the following steps:

 

  1. View the Form Management Properties for the version of the form to which you want to add the new workflow rule.

  2. Select the Edit Version link to edit the Form Management Properties.

  3. Click the Workflow tab.

  4. Choose the Submission or Callable sub-tab, depending on which type of rule you want to create.

  5. Click the New Rule link. A new window will open that will guide you through several screens in order to add a new workflow rule to a form version.  The first screen will vary slightly depending on whether you are creating a Submission or Callable rule.  The Rule Type field will indicate which type of rule you are creating.

  6. In the Rule Name field, enter a unique name that will identify the workflow rule.  This name should be descriptive of the condition associated with the rule, or of the actions associated with the rule.  For example, "Request Submitted by Employee."

  7. If you are creating a Submission rule, select the order in which you want the rule to be evaluated and processed from the Rule Order field. (Callable rules do not have an order component, since they are invoked explicitly).

  8. If the new rule should evaluate a conditional expression to determine whether or not its actions should be executed, then check the Conditional check box.

  9. If you indicated that the workflow rule is conditional, then continue on to the next step. Otherwise, skip to the last step.

  10. Click the Next button.

  11. Enter the conditional expression that will be evaluated to determine whether or not the workflow rule's actions will be executed. Refer to the Conditional Expressions section below for more information about conditional expressions.

  12. Click the Finish button to add the new workflow rule to the form version.

 

Once you have finished defining a workflow rule, you will need to create one or more actions that will be executed when the rule is run by the workflow engine.  See the section on Rule Action Configuration for help in creating Workflow Actions.

 

Conditional Expressions

A conditional expression for a workflow rule is an expression that either evaluates to true or false.  If the expression evaluates to true, then the workflow rule's actions are executed.  If the expression evaluates to false, then the actions are not executed.  Several items can be used to define a workflow rule's conditional expression.  These items are explained below:

Form Fields

All of the fields from the form version that the workflow rule is associated with are available to be used in a conditional expression.  To add a form field to a conditional expression, select the form field from the Form Fields drop down list and click the + button next to it.

Operators

Operators can be used in a conditional expression to compare values or perform mathematical operations.  The following operators are available to be used in conditional expressions:

 

Operator

Usage

Example

=

Evaluates two numeric or text values and determines if they are equal.

$PFF.employee_id = 4

 

$PFF.last_name = "Smith"

 

!=

Evaluates two numeric or text values and determines if they are not equal.

$PFF.employee_id != 4

 

$PFF.last_name != "Smith"

 

>

Evaluates two numeric values and determines if the value on the left is greater than the value on the right.

$PFF.child_age > 18

 

 

<

Evaluates two numeric values and determines if the value on the left is less than the value on the right.

$PFF.child_age < 18

 

 

>=

Evaluates two numeric values and determines if the value on the left is greater than or equal to the numeric value on the right.

$PFF.child_age >= 18

 

 

<=

Evaluates two numeric values and determines if the value on the left is less than or equal to the value on the right.

$PFF.child_age <=18

 

 

+

Adds two numeric values or concatenates text values together.

$PFF.total + $PFF.shipping > 100

 

$PFF.fname + " " + $PFF.lname

 

-

Subtracts a numeric value on the right from the numeric value on the left..

$PFF.total - $PFF.discount > 100

 

*

Multiplies two numeric values.

$PFF.total * $PFF.tax > 50

 

/

Divides the numeric value on the left by the numeric value on the right.

$PFF.yearly_payment / 12 > 200

 

AND

Evaluates two or more expressions and returns true if all expressions are true.

$PFF.total + $PFF.shipping > 100 AND $PFF.ship_state = "VA"

 

OR

Evaluates two or more expressions and returns true if any of the expressions are true.

$PFF.ship_state = "VA" OR $PFF.ship_state = "MD" OR $PFF.ship_state = "DC"

 

 

To add an operator to a conditional expression, select the operator from the Operators drop down list and click the + button next to it.

Functions

The following functions can be used in conditional expressions:

 

Function

Usage

Example

IsBlank

Evaluates the value of a field in the submitted form to determine if it is empty.

 

Syntax: IsBlank(FormFieldName)

 

FormFieldName is a form field reference in the form of $PFF.fieldName

IsBlank($PFF.comments)

This evaluates to TRUE if the comments field of the submitted form is empty.

 

IsBlank($PFF.signature_2_signature)

This evaluates to TRUE if the signature_2_signature field is empty. This type of expression is one way to determine if a certain level of approval has been obtained in a form with a signature-based approval process.

 

IsNotBlank

Evaluates the value of a field in the submitted form to determine if it is NOT empty.

 

Syntax: IsNotBlank(FormFieldName)

 

FormFieldName is a form field reference in the form of $PFF.fieldName

IsNotBlank($PFF.comments)

This evaluates to TRUE if the comments field of the submitted form contains a value.

 

IsNotBlank($PFF.signature_2_signature)

This evaluates to TRUE if the signature_2_signature field contains a value. This type of expression is one way to determine if a certain level of approval has been obtained in a form with a signature-based approval process.

 

To use a function in a conditional expression, select the function from the Functions drop down list and click the + button next to it.

Constants

If you have defined constants in the Administration section of E-Forms Manager, any of these will be available in this dropdown list for use in a conditional expression.  When the expression is evaluated by the workflow engine, the value of the constant is used.  For more information on defining constants, see Constants.

 

To add a constant to a conditional expression, select the name of the constant from the Constants drop down list and click the + button next to it.

Building Nested and Complex Conditional Expressions

If you want to evaluate multiple fields or perform a complex evaluation based on groups of fields and/or combining field evaluations with constants, you may group and nest conditional expressions using parentheses.

 

For example, the expression $PFF.student_age > $CONST.minimum_applicant_age AND ($PFF.student_state = "TX" OR $PFF.student_state = "FL") will evaluate to true if the value in the student_age field of the submitted form is greater than the minimum applicant age supplied by the minimum_applicant_age constant AND the student either lives in Texas or Florida.

Commenting Conditional Expressions

Starting with the 7.5.0 version of TransForm E-Forms Manager, comments can be specified in a conditional expression. To specify a comment, start the comment with /* and end it with */. For example,

 

/* Make sure applicant is old enough and lives in Texas or Florida */

$PFF.student_age > $CONST.minimum_applicant_age AND ($PFF.student_state = "TX" OR $PFF.student_state = "FL")

 

Editing an Existing Workflow Rule

 

An existing workflow rule can be edited by following these steps:

 

  1. In the form catalog, find the form version whose workflow rules you want to edit.

  2. Select the Edit Version link to edit the Form Management Properties.

  3. Click the Workflow tab, then choose the Submission or Callable sub-tab, depending on which type of rule you want to edit.

  4. Click the Edit icon for the rule you want to edit.  A new window will appear that will be populated with the values from the selected rule.   (Note that you may need to disable workflow for the form version before the edit link can be used.)  

  5. Edit the properties of the workflow rule that you want to change.

  6. Click the Finish button.

 

Deleting a Workflow Rule

An existing workflow rule can be deleted by following these steps:

  1. In the form catalog, find the form version whose workflow rule or rules you want to delete.

  2. Select the Edit Version link to edit the Form Management Properties.

  3. Click the Workflow tab.

  4. Click the Delete icon of the rule that you wish to delete. A dialog box will appear to confirm the deletion. (Note that you may need to disable workflow for the form version before the edit link can be used.)

  5. Click the OK button to delete the rule.

 

Note: Some rules in the Callable Rule list may show "In Use" where you would normally see the Delete icon.  This indicates that the rule is configured to be called from another workflow rule.  Before you can delete it then, you must first remove any references to the rule by editing the calling rule.