Tech Tip: New Workflow Activity: For Each Value

Workflow 8.0.1 includes a number of new and updated activities that extend the software’s functionality, including For Each Value.

March 2nd, 2010 Comment on this article

The recently released Laserfiche Workflow 8.0.1 includes a number of new and updated activities that extend the software’s functionality, making it even more powerful and flexible. One of the new activities is For Each Value, which creates a workflow loop that is performed once for each value in a multi-value token, or once for each separate token passed to the activity.

Real-world Scenario: The Problem

The Big Money Corporation uses Laserfiche to process and archive claim documents. When a claim is scanned into the repository, Workflow should route it to multiple people. Due to the nature of the approval process, however, the list and number of approvers are different for each claim. How can For Each Value solve this problem?

The Solution

After evaluating different options, the company built the following workflow: 1

  1. When someone scans or imports a claim into the repository, he/she populates a multi-value field named Route To. The names added to this field represent who Workflow should route the document to.
  2. Using a Retrieve Field Value activity, Workflow retrieves the list of names from the Route To field as a multi-value token. Note: Since this is a multi-value field, the company configures Retrieve Field Value to retrieve ALL field values (this is not the default option).
  3. The multi-value field is passed to For Each Value, which creates a loop that is performed once for each value in the token.
  4. A Route Entry to User activity, which is inside of For Each Value, routes a shortcut to each person in the list, one at a time. In this scenario, Route Entry to User is configured to route based on the value of the %(ForEachValue_Current Value) token. Note: In order for all users to receive the shortcut at virtually the same time, no wait condition is set on Route Entry to User.
  5. Each approver uses the shortcut to access the claim and make their decision. In this scenario, a separate workflow handles the steps involved after approval/rejection decisions are submitted.

Using For Each Value with a Custom Script

If you place a scripting activity inside of For Each Value, your custom script will be performed once for each value in multi-value token, or once for each separate token passed to the activity. For example, this workflow retrieves a list of stamp names from a multi-value field, and then adds each stamp to the document, one at a time.

2

Tags:

Comment on this article