Conditional Behaviors

The ability to conditionally execute a Workflow Behavior was added in 10.4.0.

Overview

The ability to conditionally execute a Behavior allows administrators to simplify Workflow configuration in certain situations.

For instance, consider the scenario in which clicking a button on a Workflow should do three things:

  • Set a specific Attribute value

  • Send a notification

  • Execute a custom stored procedure, but only in certain circumstances

Prior to 10.4, this would need to be configured as two distinct Actions, each of which is conditionally visible or hidden based upon the “certain circumstances”. Each of the Actions would have identical configurations for the “Set an Attribute value” and “Send a notification” Behaviors, and one of the Actions would have an additional “Execute a custom procedure” Behavior.

In 10.4, this can be implemented as a single Action, where the “Execute a custom procedure” Behavior is conditionally executed. This results in less configuration duplication.

Conditional Behaviors in “Data Entry” Steps

As of 10.4, all Workflow types support Conditional Behaviors on “Data Entry” Steps.

When an Action is executed, all of the configured Behaviors are added to the “Behavior Queue”. The conditional rule is evaluated during queue processing and, if the configured rule is not met, the Behavior is skipped.

Skipped Behaviors are identified as such in the Behavior Log.

Conditional Behaviors in “Data Import” Steps

Data Import Steps are used by the Workflow Import Queue (a.k.a. "Enhanced Data Import").

There are two similar, but distinct, scenarios in which Conditional Behaviors are useful in a data import context. One scenario occurs when uploading Activity Instance data, such as exam scores, and the other occurs when uploading Member Role data representing credentials or demographic data.

Although these represent different business scenarios, they are supported by the same two features:

Conditional Behaviors during Activity Instance upload

The canonical example for Activity Instance upload is exam scores: some of the rows in the uploaded file will represent “passing” scores, and others will represent “failing” scores.

The system often needs to respond differently in each case. For example, a passing score might result in the creation of a new Activity Instance that remains Incomplete (so that some additional, in-app action can be performed against it) and a congratulatory email being sent to the Candidate. A failing score, however, might result in the Activity Instance being created in a Completed Unsuccessfully status, and a different email notification being sent.

To implement this scenario, use an “Update Workflow Instance” Behavior that is conditionally executed according to a Comparison Rule that targets an extrinsic Attribute representing the pass/fail status.

Conditional Behaviors during Member Role upload

Member Role upload has some unique use cases.

Consider the scenario in which demographic data is being uploaded as an “out of band” process, meaning that the demographic upload is completely unrelated to the Practitioner’s process of being granted the Role.

  • When the file represents a Member Role that does not exist, it should be created and its Grant Role Workflow moved into a “Completed Successfully” state. It’s important that it be moved into “Completed Successfully”, because leaving it in an “Incomplete” state would mean the Practitioner would see an orange “continue Grant Role” button on their My Account page, which wouldn’t make sense in this case.

  • When the file represents a Member Role that already exists, and the Grant Role Workflow is already “Completed Successfully”, then it should be updated and the Completion Status should remain unchanged.

  • When the file represents a Member Role that already exists, but the Grant Role Workflow is “Incomplete”, then the Member Role should be updated from the data in the file, but the Completion Status should remain “Incomplete”. Otherwise, the file upload would affect a process that the Practitioner is currently working through.

This is supported through the Conditional Behavior setting that executes the Behavior only if the Workflow Instance was newly created as part of the file import process. Using this feature, a “Make Completed Successfully” Behavior would be conditionally executed only if the Member Role was created by the upload file. If it already existed, the Completion Status would be left unchanged.