VariableId

When a VariableId attribute is defined for a <Step> element, the business object that is a result of the step’s action is stored to a variable with this ID. In this example, a variable called oInspection will represent the building inspection object.

<Step Id="3000" 
 TargetBusinessObject="Hansen.CDR.Building.Inspection" 
 VariableId="oInspection" Action="Select">

The <Step> element also has an optional VariableType attribute that specifies the data type of the variable. If the variable type is a collection that implements the IList interface, then the target object will be added to that collection. Otherwise it will overwrite the current value of the variable.

The variable ID represents a business object, so you can use it to set the target business object of a later step, as shown in this example:

<Step Id="3001" 
 TargetBusinessObject="${oInspection}" 
 Action="Create, Update" 
 UpdateCheck="InspectionKey">

Note that the variable ID here is enclosed in curly braces and preceded by a dollar sign. This syntax is required when you use a variable to set a step’s target business object, because the value of the TargetBusinessObject attribute is usually a moniker. The dollar sign and curly braces identify the value as the name of a variable rather than the moniker of a business object.