The <inlineSubplan> step executes a sequential series of steps. This step can only appear as the child of the <compositeSteps> element.
An <inlineSubplan> step is similar to an <execSubplan> step. However, while the <execSubplan> steps names an external plan to execute, the <inlineSubplan> step directly contains the plan to execute as a child element.
The primary difference between an inline subplan and a top-level plan is that inline subplans are not saved as distinctly named entities. Thus, inline subplans cannot be externally referenced by <execSubplan> steps. Top-level plans are distinctly named entities and can be referenced from <execSubplan> steps.
Inline subplans are useful when the content is concise, directly tied to the context and logic of the calling plan, and does not otherwise make sense as a stand-alone plan. In these cases, having all steps in one self-contained unit can facilitate plan maintenance and readability.
Unlike top-level plans, inline subplans cannot declare parameters. They implicitly inherit the parameters and variables of all enclosing plans. They can declare additional variables that are local to the inline subplan, which can hide variables and parameters of the enclosing plans. A subplan variable hides the variable of an enclosing plan if both have the same name. In this case, only the value of the variable that is declared by the innermost subplan is available for use by its steps.
The <inlineSubplan> step consists of an optional <varList> followed by one additional child element, either <simpleSteps> or <compositeSteps> depending on the type of inline subplan: simple or composite.
The <inlineSubplan> step has the following child elements:
<varList> – An optional element that is a list of plan variables for use within the inline subplan. If specified, this element can only appear one time.
<simpleSteps> – An optional element that contains a list of simple steps. Only one <simpleSteps> or <compositeSteps> element can be present. If specified, this element can only appear one time.
<compositeSteps> – An optional element that contains a list of composite steps. Only one <compositeSteps> or <simpleSteps> element can be present. If specified, this element can only appear one time.
The <inlineSubplan> step has the following attributes:
planName – A required attribute of type entityName, which is a name used to identify the inline subplan. This name is used primarily for display purposes, and need not be distinct from names of other plans (inline or top-level).
description – An optional attribute that is a string description of the inline subplan. This attribute is useful for documentation purposes.