xfa
The xfa verb is used to specify exit fuseactions (XFAs). It operates in the same fashion as the set verb, except that it prepends xfa. to the value of the name attribute, effectively inserting it as a key in the xfa structure. That is, <xfa name="viewCart" value="cart.displayCartContents" /> will create a variable, xfa.viewCart, with the value cart.displayCartContents.
Having a special Fusebox verb for specifying XFAs can be quite handy. Not only does it provide an easier read when scanning the application's architecture (since it is distinguished from other sets) but it also allows for advanced Fusebox tools currently under development that can more readily identify exit fuseactions when reading the fusebox.xml and circuit.xml files. Some interesting uses of this might be an IDE or other programs that read the XML files for development time (rather than runtime) error checking, cross-reference and self-consistency checks.
The xfa verb also has available to it the attribute of overwrite that operates exactly as its set counterpart. One advantage of knowing that a xfa rather than an ordinary variable is being set is that the value of the value attribute must perforce be a fully-qualified fuseaction. This points out an interesting occurrence: that an XFA—which after all points to a fuseaction—would have to have a hard-coded value for its own circuit specified in itself. Yet, the alias name of a circuit is only meaningful to other circuits and to the application as a whole.
You can imagine the problem: in one application you have a circuit called cart. Fuseactions in cart sometimes refer to other fuseactions in cart. Should you specify cart.addToCart and cart.checkOut? What happens when you re-use this code six months later and this circuit is now to be aliased as shoppingcart? Will you have to search all through the circuit and change all hard-coded references of cart to shoppingcart? What if you miss a subtle one? Do you want to be the developer tasked with tracking down such a bug?
Fusebox nicely takes care of this problem for you. If you specify only a fuseaction as part of the value attribute of an xfa, Fusebox assumes you mean the same circuit as the current fuseaction and inserts this value for you. So a fuseaction of updateCart in circuit, cart, that might otherwise have resembled:
<xfa name="displayCart" value="cart.displayCart" />
<include template="actUpdateCart" />
</fuseaction>
can have the hard-coded circuit reference removed:
and Fusebox will dynamically insert the circuit alias, whether cart or shoppingcart, into the XFA structure. Those are the sort of "smarts" that gives the Fusebox framework such a high degree of maintainability.
Fusebox 5.1 allows <parameter> sub-tags to specify URL parameters for the XFA values.