If you are developing a Front End Application using the IBM® Forms Server – API,
you can significantly improve performance by turning on the server
speed flag setting in the readForm method.
When a form is read into memory, it evaluates the form data. This
includes evaluating computes, detecting duplicate sids, formatting,
XForms processing, and so on. As a result, it takes longer to read
the form into memory. However, your application may not always need
these evaluations to take place when the form is read. In fact, if
you are using the Streaming API, form data evaluation is not permitted
when reading the form into memory. However, if you are using the Classic
API, the readform method can be configured to only
perform specified evaluation behaviors. This is done through the flags parameter.
The flags parameter has the following settings:
- 0
- No special behavior.
- XFDL.UFL_SERVER_SPEED_FLAGS
- Turns off the following features: computes, automatic formatting,
duplicate sid detection, XForms processing, write relevant, the event
model, and relative page and item tags (for example, itemprevious, itemnext,
and so on). It also ignores errors. As a result, this setting significantly
improves server processing times.
Note: This setting does not respect
XForms relevance.
- XFDL.UFL_AUTOCOMPUTE_OFF
- Reads the form into memory, but disables the compute system so
that no computes are evaluated.
- XFDL.UFL_AUTOCREATE_CONTROLLED_OFF
- Reads the form into memory, but disables the creation of all options
that are maintained only in memory (for example, itemnext, itemprevious, pagenext, pageprevious,
and so on).
- XFDL.UFL_AUTOCREATE_FORMATS_OFF
- Reads the form into memory, but disables the evaluation of all format options.
- XFDL.UFL_XFORMS_INITIALIZE_ONLY
- Turns off the following features: controlled item construction,
UI connection to the XForms model, action handling set up, and the
rebuild/recalculate/revalidate/refresh sequence after instance replacements.
This flag respects XForms relevance and validity settings.
- XFDL.UFL_XFORMS_OFF
- Turns off XForms processing, including UI connection to the XForms
model. The primary use of XFDL.UFL_XFORMS_OFF is to turn XForms processing on in
XFDL.UFL_SERVER_SPEED_FLAGS. This is done by negating XFDL.UFL_XFORMS_OFF
with a bitwise NOT and including it with the XFDL.UFL_SERVER_SPEED_FLAGS
setting with a bitwise AND. For example:
(XFDL.UFL_SERVER_SPEED_FLAGS &(~XFDL.UFL_XFORMS_OFF))
The fastest setting is XFDL.UFL_SERVER_SPEED_FLAGS, as it performs
the fewest evaluations. The slowest setting is 0, as it performs all
of the evaluations. If you need some behaviors and not others, you
can use multiple flags by combining them using a bitwise OR, AND,
or NOT. For example, the following sample disables the evaluation
of computes and
format options:
XFDL.UFL_AUTOCOMPUTE_OFF | XFDL.UFL_AUTOCREATE_FORMATS_OFF
For more information about the readform method
and how it is used, see the IBM Forms
Server API – Java™ API
User's Manual.
Example
The following example demonstrates
the use of readForm to load a form into memory
without performing any evaluations:
private static FormNodeP loadForm() throws Exception
{
XFDL theXFDL;
formNodeP theForm;
if ((theXFDL = IFSSingleton.getXFDL()) == null)
throw new Exception("Could not find interface");
if ((theForm = theXFDL.readForm("formSample.xfd", XFDL.UFL_SERVER_
SPEED_FLAGS)) == null)
throw new Exception("Could not load form.");
return(theForm);
}