Setting a User Task Deadline – Based on Form Data: LiveCycle Tips and Tricks

LiveCycle User Assign Tasks have a neat User Interface for settings deadlines.   Setting it up with a timeout and a route to follow after the deadline has elapsed is all done graphically.  It is well documented and pretty easy to follow.

Setting an Assign Task deadline during process design.

Recently a customer came to me, asking to deadline a User Assign Task – based on a date in the form.  I said yes I can do it.  I knew that LiveCycle supports Literal (read Graphical) and Variable (read code) configuration for every  component and there were over 80 data types in LCES 8.2.

Setting a deadline for an Assign Task during process runtime is not obvious. The Deadline section can take an XPath expression (see below) to something but the magic question is what XPath expression?

Setting a process deadline using runtime data.

It’s not well documented but there is a built-in LiveCycle type made exactly for this purpose – called TaskDeadline.

The Task Deadline is a built-in LiveCycle Process Management datadata.

Once you declare a variable of that type you can basically set it to do anything you want.   Here are the XPath settings I used in a Set Value task for configuring the Task Deadline dynamically.

/process_data/deadlineVar/object/@selectedRoute ‘Deadlined’
/process_data/@deadlineDate /process_data/xfaForm/object/data/xdp/datasets/data/myform/deadlinedate
/process_data/@iDays get-days-from-date-difference( /process_data/@deadlineDate , format-dateTime-withFormat( current-date() , ‘yyyy-MM-dd’ ) )
/process_data/deadlineVar/object/dateObj/@days /process_data/@iDays + 1
/process_data/deadlineVar/object/@omitDeadlineRouteFromUser 1

Note that the Selected Route is configurable, and a button showing that route can be omitted from the Workspace chrome with the expression in the last assignment.

Filed under Designing Forms, Designing Processes · Tagged with

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!