Skip to content
neoneo edited this page Jun 9, 2012 · 2 revisions

Some tasks can have dynamic attributes. This means that the actual value of the attribute is determined at runtime, based on the variables present on the event object.

An attribute becomes dynamic if you prefix it with a percentage sign (%):

<dispatch target="%dynamicTarget" event="%dynamicEvent" />

The variables dynamicTarget and dynamicEvent are expected to exist on the event object, otherwise an exception is thrown.

Following the percentage sign, any ColdFusion expression may follow, for instance:

<set nextEvent="%loggedin ? 'home' : 'login'" />
<redirect event="%nextEvent" />

Just make sure that the expression doesn't invalidate the XML document.

You can escape the percentage sign by adding another.

Clone this wiki locally