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(..) != ""
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 returnsfalse
.
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.:
See Also:diagram.checkStockSectionOutput ("Diagram Doc", Array("Use-Case Diagram", true));
callStockSection(), Array(), 'stockSection'
generator variable.