Customizing sBOM XML Files > <sbom> Element > <instance> Element
  
<instance> Element
The <instance> element is a child of the <sbom> element. The <sbom> element can contain any number of <instance> elements, or it can be empty. An sBOM <instance> can reference a source item in the eBOM, or it can exist in the sBOM only.
Each node in the sBOM tree has an <instance> element. Each <instance> represents one or more parts in the sBOM in a particular service state. They can be hierarchically nested to create the sBOM tree structure.
The attributes and children of <instance> encode service information for parts in the sBOM. They can, for example, convey the following information about sBOM parts:
Part names
Part numbers
Whether or not sBOM parts are referenced in the eBOM
If parts are itemized and replaceable
If parts ship preassembled or in a kit
When service information changes for parts in the sBOM, you can the edit the sBOM’s <instance> elements. For example, you can add, remove (hide), or change attribute values in the <instance> element itself, or change the values of its child elements.
<instance> Syntax
<instance type="FOLDER" qty="1">
<name />
<ebom />
<attribute name="" />
<attribute name="" />
...
<attribute name="" />
<instance />
<instance />
...
<instance />
</instance>
<instance> Attributes
type
Specifies the type of instance:
FOLDER
Default instance type.
REPLACEABLE
The instance is a valid, usable, itemizable part.
COLLAPSED
The instance is combined with its parent node. It is not itemizable.
PREASSEMBLED
The instance is a set of parts that are serviced as single unit. The parent node of this instance is type="REPLACEABLE". All children of this instance are type="COLLAPSED" by default.
qty
Specifies the number (quantity) of instances to be created. The default value (if omitted) is 1.
<instance> Child Elements
<name>
Optional free form text name for this instance.
<ebom>
See <ebom> Element.
<attribute>
An <instance> can contain zero or more child attribute elements. The values of attributes in attribute elements override values in any referenced eBOM node. They can also add new attributes to the sBOM instance.
<instance>
An <instance> can contain zero or more child <instance> elements. For example, an <instance> element for an assembly node can contain a child <instance> element for each part in the assembly.
<instance> Example 1
This example shows how to use the <name> and attribute child elements to assign a display name to an instance, assign a new sBOM-only attribute, and to hide (delete) an attribute.
<sbom>
<instance>

<!-- assign a display name -->
<name>my sbom instance</name>

<!-- include a new attribute on the sBOM instance -->
<attribute name="PartNo" type="symbol" category=“custom”>123-4567</attribute>

<!-- hide (delete) an attribute from an instance -->
<attribute name="Designer" type="symbol" category="PROE Parameters" hidden="true"/>
<instance> Example 2
This example shows how to define instances hierarchically. An example of an assembly instance is shown below. If the instance references an eBOM item which is also an assembly, the entire contents of that assembly are brought across as child <instance> elements.
<instance qty="1" type="PREASSEMBLED">
<name>tree </name>

<!-- The copyasm=true flag specifies that the entire ebom instance
and all children should be copied across -->
<ebom copyasm="true">
<refpart name=“CustomId” category=" id-db " type="symbol">321-7654</refpart>
</ebom>

<!-- Any instances declared inside this assembly instance (above)
override the items that were copied over as part of the parent
operation. In this case, this specified reference instance has
been given a specific display name and assigned the
REPLACEABLE type.-->
<instance qty="1" type="REPLACEABLE">
<name>replacable child </name>
<ebom>
<refpart name=“CustomId” category=" id-db " type="symbol">432-8765</refpart>
</ebom>
</instance>
</instance>
As shown above, a type="PREASSEMBLED" item specifies an assembly which is copied from the eBOM with the structure intact. All of its children are marked as combined (i.e., type="COLLAPSED"). Any child definition in the XML will change the sBOM that was created in the parent action. In the example above we find one of the items by property matching. We change its <name> and also change its type to REPLACEABLE (i.e., not-COLLAPSED).
<instance> Example 3
This example shows the default instance type="FOLDER". A folder instance named “bolts” is created. It contains a child instance named BOLT representing 12 bolts (qty="12").
<instance type=”FOLDER”>
<name>bolts</name>
<instance qty="12" type="REPLACEABLE">
<name>BOLT</name>
<ebom>
<refpart name=“CustomId” category=" id-db " type="string">ab-3344</refpart>
</ebom>
<property name="PartNo" type="symbol" category=“custom”> 789-3344</property>
</instance>