Defining Auto Rules for a Template

Auto Rules cause actions to happen based upon pre-defined conditions. For instance, a type of information appearing in one field can cause information in another field to change. Remaining in a certain step for more than a specified number of days can change the priority of a workflow. Reaching a particular date can trigger a field change or send an alert to specified users. IQ automatically creates a background job for each auto rule that is configured to send an alert. If the due date or remind date is changed in the workflow record, IQ deletes the existing background job and creates a new one for the changed date. This prevents multiple alerts from being sent to the recipient when the due dates or remind date are changed. Auto rules apply to workflow Steps so they can be defined for the specific conditions in each Step.  Note: If your office has purchased the IQ Archivist module, you can create Auto Rules and Data Fields to automatically set Retention Schedule and File Plan. Contact your IT Consultant for assistance in creating the Auto Rules and Data Fields for your Archivist module.

To define an auto rule:

  1. On the Workflow Template Record page, click the Steps tab.

  2. Click the Add link for the step that you want to define the auto rule for.

  3. Enter your auto rules on the Edit Auto Rule page.

  4. Click the Save button.

Edit Auto Rule Page

On the Edit Auto Rule page, you set the conditions and the actions that result when the conditions are met.

Repeat Interval in Hours

This field can be used to set the interval (in hours) for the Auto Rule to be repeated. A background job is scheduled to run at the interval specified in this field. So if, for example, you want the Auto Rule to be repeated every 2 hours, then enter 2 in this field and IQ will schedule a background job to run every 2 hours.

Rule Details

Rule details are the condition(s) that must be met in order for the action(s) to happen (the if this is true... part of the auto rule). There may be more than one rule providing an "and" capability (if this is true and if this is true&ldots;). Click the Add New Auto Rule Detail link to go to the Auto Rule Condition dialog page and add a rule. Click in the Rule Type field and select a type. You can base rules on one of four types: date and time, field (standard and data), queue A list of jobs that are waiting to be processed. When a job is sent to a queue, it is simply added to the list of jobs. A printer queue is a list of documents that are waiting to be printed. size, and stored procedures. When you select a type, several fields appear, depending on which type you've selected.

Complete fields as appropriate and click the Save button.

Examples of Rule Details would be:

DATETIME: If Current Date Time is 0 Days >= Workflow Step Due Date Time (to take an action when a due date is reached)

DATETIME: If Current Date Time is 30 Days >= Workflow Step Queue Step Time (to take an action based on the length of time a step has been open)

FIELD: If Workflow Priority = 1 (to taken an action for a Workflow that has a high priority)

FIELD: If Academy = AF (to take an action for a Workflow containing information in a data field)

Note: If you’re constructing a FIELD rule type, depending on what you select in the first field, the last field will contain a list of possible entries or will be a free-entry field. For example, if you select Workflow Step Status in the first field, click in the last field and select a valid status code from the list. If you select Workflow Comments in the first field, type the comments in the last field.

Rule Actions

Rule actions are what happens when the condition is met (the then do this part of the auto rule). There may be more than one action (then do this and do this). Actions that occur as a result of a rule include sending a message and changing a field. Click the Add New Auto Rule Action link to go to the Auto Rule Action dialog page. Click in the Action Type field to select an action from the list that appears. Available actions include SET_FIELD, SEND_MAIL, LAUNCH_PROCESS, and RUN_PROGRAM.  When you select a type, several fields appear, depending on which type you've selected. Complete the fields as appropriate and click the Save button.

The following actions are available:

SET_FIELD

Select a field and enter information to appear automatically when the Rule Details are met.

Examples:

Workflow Comments = This is a Priority 1 Workflow. (Enters "This is a Priority 1 Workflow" in the Comments field.)

Workflow Priority = 1 (Makes the Workflow a priority 1.)

Workflow Due Date Time = 04/01/2009 05:00PM (Replaces the current workflow due date with this date and time.) You may enter only a date&emdash;the time defaults to 12:00AM.

SEND_MAIL

Send an e-mail message when the Rule Details are met.

Example:

To: @Manager
Subject: Overdue Workflow
Text: Workflow ID: @CONTACT.CONTACT.ID@
The above-referenced workflow is due for action.

In this example, a notification message would be sent to the workflow template manager that the workflow is past due. The manager sees a Workflow Alert link above the module tabs. By clicking that link, the manager can access, read, and print the notification message. Other values for the To: include Groups (which begin with @G@) and active String Data Fields (which being with @U@).

Note: The @CONTACT.CONTACT.ID@ field displays the workflow ID in the notification message, and can also provide a link to go from the message directly to the workflow. To create the link, you must type Workflow ID: @@@@ in the Text field and then click Workflow ID in the Fields field to replace @@@@ with @CONTACT.CONTACT.ID@. Workflow ID must be typed in the case shown, followed by a colon, with only one space between the colon and the @@@@. Do not enter any other text on this line.

LAUNCH_PROCESS

Run a .vbs script when the Rule Details are met. Click in the Process Name field to select a script. Once you've selected a script, click the Edit/Add Process link next to the Process Name field for information about what the script will do and what to enter in the Parameters field.

Example:

Process Name: send_alert_on_no_acvitity.vbs

Parameters:

AFTER_HOW_MANY_DAYS=30
REPORT_TO_TEMPLATE_MANAGERS=Y
REPORT_TO_WORKFLOW_OWNER=N
REPORT_TO_OTHERS=john.harmond@us.house.gov

 

In this example, a notification message would be sent to those identified by REPORT_TO that there has been no activity on the workflow for the number of days indicated by AFTER_HOW_MANY_DAYS. This is a .vbs script that is selected in the Process Name field. Once you've selected the script, you can click the ? button next to that field for a listing of available parameters. The Auto Rule Detail for this action should use a Rule Type of DATETIME and set the time, after the days of inactivity have passed, at which the notification message should be sent. For example, Current Date Time is 1 Hours >= Workflow Open Date Time would send the message 30 days plus one hour after the workflow open date and time, given the above AFTER_HOW_MANY_DAYS parameter.)

RUN_PROGRAM

Run a program when the Rule Details are met. Click in the Process Name field and select CreateandSendEmailMessage. Note: The only parameter for this program is the Form Letter ID.

Example:

Process Name: CreateandSendEmailMessage

Parameter: FORMLETTER=157134

This program can be called by an Auto Rule at any step in the workflow to create a Message record and then automatically Send a Form Letter to the email address of the Primary Person in the Workflow/Service record. All of the Form Letter "rules" (default email address, default email subject, outgoing attachments) followed in the Mail/Message record are respected by this process. Note: The Background Job that runs for this process will fail for the following reasons:

1) The Worklow/Service record does not have a primary person.

2) The Primary Person does not have an active primary email address.

3) The Form Letter ID does not exist or its status is not Approved.

 

Complete fields as appropriate and click the Save button. Click the Save button again on the Edit Auto Rule page. The entire rule (the rule detail and the resulting action) appears with below the associated step on the Steps panel of the Workflow Template record.

Multiple Rules and Actions

You can use "and" and "or" statements to combine multiple rules and actions. Once you've created a rule detail and action and they appear on the Edit Auto Rule page, click the Add New Auto Rule Detail link or the Add New Auto Rule Action link to create a second rule or action. Quorum links the second rule or action to the first with the word AND indicating that both rules must be met in order for the action to occur, or that both actions will occur as a result of the rule.

If Current Date Time is 0 Days >= Workflow Step Due Date Time AND If Workflow Priority = 1 (to take an action when a due date is reached for workflows with a priority of 1)

SET FIELD: WORKFLOW COMMENTS = This is a Priority 1 Workflow AND SEND_MAIL: Subject: Overdue Workflow Text: Workflow @CONTACT.CONTACT.ID@&ldots; To: @Manager (Enters "This is a Priority 1 Workflow" in the Comments field AND notifies the manager of the workflow that Workflow 152345 is past due.)

To combine multiple rules into an "or" statement, you must create two auto rules and enter the same action for different rule details. In the following example, a notification message is sent when the workflow priority is 1 or when the due date is reached.

IF Current Date Time is 0 Days >= Workflow Step Due Date Time THEN ===>SEND MAIL Priority Work&ldots; TO @Stepowner&ldots;
IF [CONTACT_priority]=’1’ THEN ===>SEND MAIL Priority Work... TO @Stepowner&ldots;