Specifications

10.2 Putting a script in a flow
Script expressions
A script expression is a JavaScript program that gets evaluated in the context of a job (file or job
folder) to determine the value of a particular property of a flow element or connection. This
allows the property value to depend on the job or its associated metadata.
Associating a script expression with a property
Many flow element and connection properties in PowerSwitch offer an extra property editor that
allows entering a script expression.
String value example
For example, the "Subject" property of the Mail send flow element allows a script expression in
addition to a regular explicit value:
Select "Inline value" (the default) to enter an explicit string value in the text field next to the
"Subject" label. Select "Define Script Expression" to enter a script expression in the property
editor, which looks as follows:
In this case, when it is evaluated in the context of the job being processed, the script expression
should return a string value (or a value that can be meaningfully converted to a string under the
JavaScript rules). The resulting value is used as the subject line of the email sent out for the job.
132
Enfocus Switch 10