Attachment of properties via javascript
Via Javascript it is possible to attach properties to a todo. These properties allow a deeper control of the workflow.
In the following example we want to retrieve the sender of an incoming e-mail and check whether it is a possible VIP-customer. For such a VIP-customer an appropriate message box will be displayed during the execution of a todo.
In the first step we will add the following Javascript code to the Receive-Action of the corresponding mailbox:
task.addProperty("VIP-Kunde", "Ja");
} else {task.addProperty("VIP-Kunde", "Nein");}
The object addProperty attaches an additional property "VIP-Kunde" to the todo. The senders "bluma" and "bergener" get the status "Ja", for all other senders "Nein".
In the second step we add the following javascript code to the Close-Action for the group:
if (isvip != null && isvip.equals("Ja"))
{
helper.infoMessage("Achtung: VIP-Kunde!");
}
In this script a variable "isvip" is defined which reflects the content of the attached property "VIP-Kunde".
If "VIP-Kunde" has the content "Ja", then a message box appears during the closing of a todo which refers to VIP status: