Use the following syntax to invoke the FormUtil methods from within a form:
<invoke class = ’com.waveset.ui.FormUtil’
name = ’method_name’>
<ref>:display.session</ref>
<s>arg2</s>
</invoke>
where the name field identifies the name of the method.
You can use select without understanding which variable specifies the Lighthouse Context. This approach facilitates re-use of the method invocation.
<select> <ref>:display.session</ref> <ref>context</ref> </select>
In a form, you would specify the context with <ref>:display.session</ref>. However, the same FormUtil call in a workflow would instead use <ref>context</ref>.
A third method for fetching context involves invoking a getLighthouseContext method using WF_CONTEXT object. Below we wrap all three techniques in a rule, which can be used later.
<rule name=’Get Context’>
<select>
<ref>:display.session</ref>
<ref>context</ref>
<invoke name=’getLighthouseContext’>
<ref>WF_CONTEXT</ref>
</invoke>
</select>
</rule>
|
You can create a rule with a name such as Get Context that contains a simple <select> statement. You can then call that rule from any form or any workflow during an invocation of the desired FormUtil method, as shown in the following example:
<invoke name=’getObject’>
<!-- typically, something like :display.session would go here.
But instead, call the handy rule -->
<rule name=’Get Context’/>
<s>User</s
<s>SamUser</s>
</invoke>
|
That invocation could then be part of a greater utility rule that you can use in both forms and workflows.