Notify Project Team Template

This workflow emails users when a document has changed. In order to be emailed, the users must add their email addresses to the Workflow Templates: Team Email Address field.

When a document changes, each person listed in the field named, “Workflow Templates: Team Email Addresses” is emailed, and the field is cleared. The document is moved to the Proposed Plans folder, and the workflow waits until the document has the same number of email addresses as it did before it was changed. Then, the document is moved to the Approved Plans folder.

Many advanced workflow features are included in this workflow, such as assigning token values, editing tokens, iterating through each value in a multi-value field, and using the iteration count feature of the Repeat activity.

Learn more about workflow templates.

How it works

  1. A Find Entry activity generates a URL for the document the workflow is running on.
  2. A Move Entry activity moves the document to the \Workflow Templates - Test Entries\Research and Development\Proposed Plans folder.
  3. A Retrieve Field Values activity retrieves all the values from the field named “Workflow Templates: Team Email Addresses.” Besides needing the field values to send emails, the workflow also needs to know how many values are in the field.
  4. The Assign Token Values activity creates a token, named Original Email Account, from the “Workflow Templates: Team Email Address” token by applying a series of functions to the token to get the number of email addresses. (Functions can be accessed by clicking a token and selecting Apply Function.) First, duplicate and empty fields are removed from the token. Then, the Count function replaces the token with the number of values in the token instead of the values themselves.
  5. After this initial information about the “Workflow Templates: Team Email Addresses” field is retrieved, a For Each Value activity goes through each value in the original token (not the edited token), sends them an email to each email address, alerting the recipient that the document has changed. The email includes a list of all the email addresses in the “Workflow Templates: Team Email Addresses” field. Notice how the “Workflow Templates: Team Email Addresses” token has a different syntax in the email as compared to in the For Each Value activity properties box. The syntax indicates that the token is edited so it returns each value on a separate line. You can edit a token by clicking it and selecting Apply Index.)
  6. An Assign Field Values activity clears the values in the Workflow Templates: Team Email Addresses field.
  7. A Repeat activity ensures that the document gets the same number of email addresses as it had before. Inside the Repeat activity:
    1. A Wait for Entry Change activity waits until the “Workflow Templates: Team Email Addresses” field changes.
    2. Then a Retrieve Field Values activity retrieves the new values in the “Workflow Templates: Team Email Addresses” field.
    3. Using the same editing functions as used to get the initial number of signatures in the field, an Assign Token Values activity creates a token that has the current number of email addresses in the field.
  8. The Repeat activity then checks to see if the current number of email addresses %(Current Email Count) equals the original number of email addresses %(Original Email Count). If it does, a Move Entry activity moves it to the\Workflow Templates - Test Entries\Research and Development\Archive\Approved Plans folder. If it does not, the activities inside the Repeat activity run again.

To run this workflow template in the provided test environment

  1. Ensure the WT- Notify Project Team starting event is enabled.
    1. Navigate to the Condition page in Starting Events.
    2. Select the starting event, and click Enable in the top right.
  2. In your Laserfiche repository, create an annotation on the Plan_D document in the Workflow Templates - Test Entries\Research and Development\Archive\Approved Plans folder. Ensure the document has at least one value in its “Workflow Templates: Team Email Addresses” field.
  3. Find the document in the \Workflow Templates - Test Entries\Research and Development\Proposed Plans folder, add values to the “Workflow Templates: Team Email Addresses” field and save the document. Once the document has the same number of email addresses as it did originally, it will be moved to the Workflow Templates - Test Entries\Research and Development\Archive\Approved Plan folder.

Alternatively, you can test the workflow (bypassing the starting event) with the Run Workflow button in the Workflow Designer. You can test this document on the Plan_D or Plan_E documents the Workflow Templates - Test Entries\Research and Development\Archive\Approved Plan folder. Ensure the document has at least one value in its “Workflow Templates: Team Email Addresses” field.

Ideas to expand this workflow

Change the Team Email Addresses field to a "Signature" field and have users type their names in that field (instead of their email addresses). Create a lookup table that links names and email addresses, and use a Run Rule activity to configure a lookup table query that retrieves email addresses based on the names in the Signature field.

Remember to republish the workflow once you made all desired changes.