Generating Unique IDs to use in Workflow

Added by Lachlan Aldred, last edited by Howard Treisman on Jun 18, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Please click here for full reference on Unique ID Generator DSC.

Using the Avoka Unique ID Generator DSC

Scenario

We have to archive a LiveCycle PDF form once the case is complete. The name of the file must be unique on the file system, and it should be easily found again. A constantly incrementing sequence number makes a lot of sense for this purpose:

e.g. HR-Expenses-0001234-Rupert-Brown.pdf

Let's break it down: "HR-Expenses-" is just a human resources string pre-pended to the name to identify the department and the process name; "0001234" is a unique number that identifies the case. The next HR-Expenses case will have the number "0001235". "Rupert-Brown" identifies the client about this case is concerned.

How do we produce such a string?

The obvious solution is to do some string scripting to conjoin different variables but how do we obtain the incrementing number? And how do we make it a unique sequence that only belongs to cases for "HR Expenses"? To the scripting we could add some database code that looks up a database field but it is getting pretty messy by now.

Enter the Unique ID generator. It can facilitate the process of generating unique ID sequences in a conceptually clean manner.

The Unique ID Generator DSC

The Generate Unique ID DSC, by Avoka Technologies, is designed to allow processes to easily generate human readable unique names. We will use it to create a unique name for a PDF form archive.

To obtain an evaluation copy of the Unique ID Generator DSC, go to the Avoka Website: http://www.avoka.com and follow the links.

The Unique ID Generator DSC, once installed, will appear as a new service in your LiveCycle WorkBench.

The Process

As shown in the above Figure, the task "generateId" can be added to our process as one process step...

Setting Properties on the Unique ID DSC

To configure the properties we first click on the DSC and view the properties tab (Left).

To create a sequence we click the "New" button. This loads the dialog box shown below.

Set enter the literal "HR-Expenses-" into the field Unique String Prefix.

Use the XPath editor to enter "concat(/process_data/@customerNme, '.pdf')" into Unique String Suffix. This assumes that a variable holds the customer's name (we could use the Avoka Lookup DSC to do this).

To obtain leading 0's in the number sequence (e.g. 0001234) we enter "0000000" into the String pattern.

We leave the default Numeric Increment of "1".

Then we pump the resulting string into the process variable "fileName".