This function allows you to test whether a particular Stock-Section would have a non-empty output if it were executed in the current generator context with the specified context element passed to it along with the specified Stock-Section parameters.

Note: When the Stock-Section is called by this function, the generator output status property (see GOMOutputInfo.status) will be "checking" within both the Stock-Section itself and any template components called from it (including any subtemplates). This will be independent of what the main (context) generation phase currently is.

In many cases, a call of the CheckStockSectionOutput() function will return the same result as the following expression:

callStockSection(..) != ""
However, this is not always the same, because some template components may signal non-empty output even when the pure text output produced by them is an empty string. (For instance, an element attribute with an empty string value is quite different than that element without such an attribute at all, although a Data Control printing the attribute value would produce an empty string in both cases.).

In addition, checkStockSectionOutput() will work much faster than callStockSection(), since no actual output is generated.

You may find it helpful to use the checkStockSectionOutput() function within Enabling Conditions of some template components to program switching them on/off depending on whether certain pieces of output may or will be produced by this template in somewhere else.

Parameters:

element

Specifies the context element passes to the Stock-Section (see 'stockSection.contextElement' generator variable).

If this parameter is not specified, the current generator context element will be used by default (see GOMContext.contextElement).

When the parameter is specified and its value is null, the function returns false.

stockSectionName
The Stock-Section name. (This should be the name under which the Stock-Section is defined in the template.)
param
params
If specified, provides one or several (in the form of Array) objects passed as parameters to the Stock-Section.

The Stock-Section parameters can be accessed within the Stock-Section using the 'stockSection.params' generator variable.

Tip:

You may call this function in a method-like style, e.g.:


diagram.checkStockSectionOutput ("Diagram Doc",
    Array("Use-Case Diagram", true));
See Also:
callStockSection(), Array(), 'stockSection' generator variable.