
|
||||||||||||||||
![]() |
||||||||||||||||
Scripting language |
||||||||||||||||
In many situations you can use a scripting language to display information from the workflow case. This language allows for a set of formatting commands and allows access to the case through the standard XPath language. By right clicking in text boxes that require scripting language, you are given a menu which authors scripting commands. |
||||||||||||||||
![]() |
||||||||||||||||
ExamplesIn each of these examples I will use a case which has the following definition. Case is called "Example". Fields are, date field called "FromDate", date field called "ToDate", string field called "Reason", upload field called "DelegationPlans". It also has a group called "Comments", string field in group Comments called "ActualComment". This leads to an XML record of the form:<Example> <ToDate>2002-08-17T00:00:00</ToDate> <FromDate>2002-09-17T00:00:00<</FromDate> <Reason>I would like to take a long weekend</Reason> <DelegationPlans></DelegationPlans> <Comments> <Comment><ActualComment>Approved</ActualComment></Comment> </Comments> </Example> Example 1: Produce an email showing the from and to
dates.
Script: Can {$FullName(Owner)} take holiday between {$FormatDate(FromDate, "MMMM dd yyyy")} and {$FormatDate(ToDate, "MMMM dd yyyy")}. He/she wants to take it for the reason: {Reason} Output: Can Joe Bloggs take holiday between August 18 2002 and August 19 2002. He/she wants to take it for the reason: I would like to take a long weekend. Starting from the right hand side, in order to reproduce the reason from the case document you can merely open a curly bracket { and put the name of the field then close the curly bracket }. To produce a formatted date you need to use a command, FormatDate, which is used to specify how the date is to be displayed. See the from date and the to date formatting. Finally in order to show who asked for the holiday you can use the Owner responsible string which returns the owner of the workflow (see here for other examples of responsible strings). Then the FullName command is used on this user in order to get a display version of the user's name. |
||||||||||||||||
![]() |
||||||||||||||||
Command reference
|
||||||||||||||||
Did you find this article helpful? Comments on this page are welcome and can only help us improve the quality of our documentation.
© Ant Organisation Ltd, 2003
|