Laserfiche Workflow Tokens

By in

A powerful add-on to Laserfiche’s document management software is  Laserfiche Workflow.  In it, you can drag-and-drop actions that will manipulate your documents and metadata under a specific condition.

Laserfiche has included an action composed entirely of .Net code (either C# or VB), which allows you to extend your Workflow to the limits of programming.  Unfortunately, passing values back and forth from your script to the other built-in Workflow modules can be less than intuitive.  This is accomplished using Laserfiche tokens (similar to variables).

From within a C# script you can get the value of a token created from a previous activity like this:

string InvoiceNumber = TokenReplace(“%(GetFieldValue_OrderNumber)”);

Where %(GetFieldValue_OrderNumber) is the token identifier, that you can find by using the token picker.
If you would like to pass a value out of your C# script into a future activity, you can create it like this:

LFDocument doc = (LFDocument)this.Entry;
this.SetToken(“GUID”, doc.EntryGUID);

Here we are finding the GUID of the active Laserfiche document and passing it into a Token we are naming “GUID.”

Finally, Laserfiche supports multi-value tokens that behave similar to an array in programming.  These will allow you to pass more than one value into a “For Each” activity in workflow.  These can be created like this:

string[] theArr = {“a”, “b”, “c”};
this.SetToken(“myToken_All”, theArr);

This technique will only work when the token has a name ending in “_All” to idenitify it to Workflow as multi-value.
Properly using Tokens will allow you to expand your utilization of Workflow’s features, and get the most out of your document repository.

Leave a reply