<instance> 元素
<instance> 元素是 <sbom> 元素的子项。<sbom> 元素可以包含任何数量的 <instance> 元素,也可以为空。sBOM <instance> 能参考 eBOM 中的源项,或只存在于 sBOM 中。
sBOM 树中的每个节点都有 <instance> 元素。每个 <instance> 代表一个或多个特殊服务状态的 sBom 中的零件。它们按层次结构嵌套来创建 sBOM 树结构。
<instance> 的属性和子项为 sBom 中的零件编码服务信息。例如,它们能传递关于 sBOM 零件的下列信息:
零件名
零件号
sBOM 零件在 eBOM 中是否被参考
零件是否分项列举并且可替换
零件是否预装配运送或散装在工具包中运送
当服务信息改变为 sBom 中的零件时,您可以编辑 sBOM 的 <instance> 元素。例如,您可以添加、移除 (隐藏) 或更改 <instance> 元素中的属性值,或更改其子元素的值。
<instance> 语法
<instance type="FOLDER" qty="1">
<name />
<ebom />
<attribute name="" />
<attribute name="" />
...
<attribute name="" />
<instance />
<instance />
...
<instance />
</instance>
<instance> 属性
类型
指定实例类型:
文件夹
默认实例类型。
可更换
实例是有效、可用和可分项列举的零件。
已折叠
实例与其父节点组合。它不可分项列举。
预装配
实例是一组作为一个单位发挥作用的零件。此实例的父项节点是 type="REPLACEABLE"。默认情况下,此实例的所有子项都是 type="COLLAPSED"
数量
指定要创建实例的编号 (数量)。默认值 (如果省略) 是 1。
<instance> 子元素
<name>
此实例的可选自由格式文本名称。
<ebom>
请参阅<ebom> 元素
<attribute>
<instance> 可以包含零个或多个子 attribute 元素。attribute 元素中的属性值覆盖在任何已参考的 eBOM 节点中的值。它们也能向 sBOM 实例添加新属性。
<instance>
<instance> 可以包含零个或多个子 <instance> 元素。例如,用于装配节点的 <instance> 元素能包含用于装配中每个零件的子 <instance> 元素。
<instance> 示例 1
此示例展示如何使用 <name>attribute 子元素来分配显示名称到实例中, 分配新仅限 sBOM 属性和隐藏 (删除) 属性。
<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> 示例 2
此示例展示如何按层次结构定义实例。装配实例的示例显示在下面。如果实例参考也是装配的 eBOM 项,装配的全部内容会被拿来做子 <instance> 元素。
<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>
如上所示,type="PREASSEMBLED" 项指定从带有完整结构的 eBOM 复制的装配。其子项全部标记为组合 (例如,type="COLLAPSED")。XML 中的任何子项定义都将更改在父项操作中创建的 sBOM。在上面的示例中,我们通过属性匹配找到其中一个项。我们更改其 <name> 并且也将其 type 更改为 REPLACEABLE (例如,非 -COLLAPSED)。
<instance> 示例 3
此示例展示默认实例 type="FOLDER"。命名为 "bolts" 的文件夹实例创建完成。它包含命名为 BOLT 的子实例,代表 12 个螺栓 (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>
这对您有帮助吗?