其他 Windchill 功能 > 制造过程管理 > 自定义产品结构浏览器 (PSE) > 创建“需求”选项卡
  
创建“需求”选项卡
本部分包含在 PSE 中显示“需求”选项卡的相关说明。按照这些说明可以创建将显示在 PSE 中的“需求”选项卡,仅当用户在结构树中选择指定类型的部件时,才会启用此选项卡。此选项卡将显示与选定对象相关联的“需求”对象,并提供一些处理“需求”的操作。
本文档介绍现有文件的更改。建议您创建单独的客户文件,以包含所有新建的元素。
提供的说明如下:
更新 <TabSet> 元素,以包括“需求”选项卡
定义“需求”选项卡的 <Tab> 元素
定义“需求”选项卡的 <AssociationTable> 元素
定义关联表格的 <StructureAuthorDefinition> 元素
定义部件与需求关联的 <StructureDefinitionSimple> 元素
定义“需求”类型的 <Table> 元素
定义“需求”选项卡的菜单
定义“需求”选项卡的标签、工具提示和助记符
定义 <MenuItem> 元素中所参考的 <ActionDefinition> 元素
实现 'enabled decider' 类,以控制何时启用此选项卡
更新 <TabSet> 元素,以包括“需求”选项卡
这会将“需求”选项卡的参考添加到定义的 TabSet。
1. 从以下位置打开 PDMLinkExplorerMain.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/product
structure
2. 找到 <TabSet> 元素并为新“需求”选项卡添加导入项,然后将其放置在所需位置:
<TabSet id="ptc.pdm.pse.ExplorerTaskTabSet" tabPlacement="top"
tabIdWithFocus="ptc.wnc.exp.PropertiesTab">
<Import id="ptc.wnc.exp.PropertiesTab"/>
<Import id="ptc.wnc.exp.StructureChildrenTab"/>
<Import id="mycom.wnc.exp.RequirementsTab"/>
<Import id="ptc.wnc.exp.GpsParamTab"/>
<Import id="ptc.wnc.exp.GpsConstraintsTab"/>
<Import id="ptc.wnc.exp.ViewTab"/>
<Import id="ptc.wnc.exp.DocTab"/>
<Import id="ptc.wnc.exp.ReplacementsTab"/>
<Import id="ptc.wnc.exp.UsedByTab"/>
</TabSet>
定义“需求”选项卡的 <Tab> 元素
这将定义“需求”选项卡元素。
1. 从以下位置打开 PDMLinkExplorerMain.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/product
structure
2. <TabSet> 元素之后,定义“需求”选项卡的 <Tab> 元素:
<TabSet id="ptc.pdm.pse.ExplorerTaskTabSet" ... >
...
</TabSet>
<Tab id="mycom.wnc.exp.RequirementsTab"
tabClass="com.ptc.windchill.explorer.structureexplorer.explorer
.tabs.ShowTablesTab"
enabledDeciderClass="com.mycom.windchill.explorer.structureexpl
orer.deciders.RequirementsEnabledDecider">
<Label imageName="wtcore/images/change_action.gif">
<Resource key="requirementsTabLabel"/>
</Label>
<Panel>
<Import id="mycom.pdm.pse.RequirementAssocTable"/>
</Panel>
</Tab>
* 
Tab 元素的 id 属性必须与上面定义的 <TabSet> 元素的导入子元素中所指定的 id 相匹配。
针对 Tab 元素 enabledDeciderClass 属性定义的类可控制用户在结构树中选择部件时,将启用的此选项卡的类型。这必须由客户实现。
<Label> 子元素的 imageName 属性可定义将显示在选项卡上的图标。
<Label> 的 <Resource> 子元素指选项卡的已定义文本标签。
<Panel> 元素包含待显示的已定义表格的导入项。
定义“需求”选项卡的 <AssociationTable> 元素
这将定义“需求”选项卡所用的 AssociationTable 元素。
1. 从以下位置打开 PDMLinkExplorerMain.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/product
structure
2. 定义“需求”选项卡的 <Tab> 元素之后,定义 <AssociationTable> 元素。
<Tab id="mycom.wnc.exp.RequirementsTab" ... >
...
</Tab>
<AssociationTable
id="mycom.pdm.pse.mycom.pdm.pse.RequirementAssocTable">
<Label>
<Resource key="requirementsLabel"/>
</Label>
<Import id="mycom.wnc.exp.RequirementSAD"/>
<Import id="mycom.wnc.exp.ChangeActionTabTable"/>
<Import id="mycom.wnc.exp.ChangeActionAssocTableAA"/>
</AssociationTable>
* 
<AssociationTable> 的 id 属性必须与上面定义的 <Tab> 元素的导入子元素中所指定的 id 相匹配。
<Label> 元素的 <Resource> 子元素指在将用于表格的资源文件中所定义的文本标签。
定义关联表格的 <StructureAuthorDefinition> 元素
这将定义 AssociationTable 所用的 StructureAuthorDefinition 元素。
1. 从以下位置打开 ExplorerStructures.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/struct
ureexplorer
2. 在文件中找到定义结构作者定义的部分。在最后一个 <StructureAuthorDefinition> 元素之后,添加下列“需求”定义:
<StructureAuthorDefinition id="mycom.wnc.exp.RequirementSAD">
<Import id="mycom.wnc.exp.PartToRequirementSD"/>
</StructureAuthorDefinition>
* 
<StructureAuthorDefinition> 的 id 属性必须与上面定义的 <AssociationTable> 元素的导入子元素中所指定的 id 相匹配。
定义部件与需求关联的 <StructureDefinitionSimple> 元素
这将定义 StructureAuthorDefinition 元素所用的 StructureDefinitionSimple 元素。
1. 从以下位置打开 ExplorerStructures.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/struct
ureexplorer
2. 在文件中找到定义结构定义的部分。在最后一个 <StructureDefinition> 元素之后,添加下列定义:
<StructureDefinitionSimple
id="mycom.wnc.exp.PartToRequirementSD"
parentToChild="addressedPartMasterReference"
childDisplayId="number">
<Import id="ptc.wnc.exp.WTPartTD"/>
</StructureDefinitionSimple>
* 
<StructureDefinitionSimple> 的 id 属性必须与上面定义的 <StructureAuthorDefinition> 元素的导入子元素中所指定的 id 相匹配。
定义“需求”类型的 <Table> 元素
这将定义一个表格,以在结构树中显示与选定部件相关联的需求 (“更改操作”)。下列数据将会显示在列中:
“需求”的数量
“需求”的有效性范围
“需求”的状况
此需求所属的 ChangeDirective 的数量
完成此“需求”的部件的标识符
此“需求”的前置任务“需求”的数量
要定义“需求”类型的 <Table> 元素
1. 从以下位置打开 PDMLinkExplorerForTablesAndPanels.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. 在此文件末尾:
a. 将下列 <ExplorerElementGroup> 创建为 <LogicRepository> 元素的子元素。
b. 以“需求”的数据类型定义 <ExplorerElementGroup> 的 <LogicContext> 子元素。
c. 定义将显示在表格中的 <Table> 元素和列以及 <CellDefinition> 元素。
<LogicRepository>
...
<ExplorerElementGroup>
<LogicContext
application="ptc.pdm.ProductStructureExplorer"
dataType="wt.change2.ChangeAction"/>

<Table id="airbus.wnc.exp.ChangeActionTabTable"
selectionMode="multi-non-contiguous" displayMode="view">
<CellDefinition id="number" mandatory="true" \
pinned="true">
<Label>
<Resource key="reqNumberLabel"/>
</Label>
<AttributeDefinition attributeId="number"/>
</CellDefinition>
<CellDefinition id="effVector" mandatory="true">
<Label>
<Resource key="reqValidityLabel"/>
</Label>
<AttributeDefinition attributeId="displayEffectivity"/>
</CellDefinition>
<CellDefinition id="theActionState"
mandatory="true">
<Label>
<Resource key="reqStatusLabel"/>
</Label>
<AttributeDefinition attributeId="theActionState"/>
</CellDefinition>
<CellDefinition id="owningChangeDirective"
mandatory="true">
<Label>
<Resource key="relatedCINLabel"/>
</Label>
<AttributeDefinition attributeId="MBA|
owningChangeDirectiveReference^WCTYPE|
wt.change2.WTChangeDirective~MBA|number"
rendererClass="com.ptc.windchill.explorer.structureexplorer.ren
derer.component.TypeIconifiedStringComponent"/>
</CellDefinition>
<CellDefinition id="satisfyPartMaster"
mandatory="true">
<Label>
<Resource key="fulfillingDSLabel"/>
</Label>
<AttributeDefinition attributeId="MBA|
satisfyPartMasterReference^WCTYPE|wt.part.WTPartMaster~MBA|
masterReference@WCTYPE|wt.part.WTPart~SCA|displayIdentifier"
rendererClass="com.ptc.windchill.explorer.structureexplorer.ren
derer.component.TypeIconifiedStringComponent"/>
</CellDefinition>
<CellDefinition id="oldActionReference"
displayWhenNoPreferenceSet="false">
<Label>
<Resource key="reqPredecessorLabel"/>
</Label>
<AttributeDefinition attributeId="MBA|
oldActionReference^WCTYPE|wt.change2.ChangeAction~MBA|number"
rendererClass="com.ptc.windchill.explorer.structureexplorer.ren
derer.component.TypeIconifiedStringComponent"/>
</CellDefinition>
</Table>
</ExplorerElementGroup>
</LogicRepository>
* 
<LogicContext> 元素的 dataType 属性可定义将显示在已定义表格中的部件类型。
<Table> 的 id 属性必须与上面定义的 <AssociationTable> 元素的导入子元素中所指定的 id 相匹配。
<CellDefinition> 元素的 attributeId 属性可定义将显示在此单元格中的合格属性数据。
<CellDefinition> 元素的 rendererClass 属性是可选的,可覆盖此单元格的默认呈现器。
<Label> 元素的 <Resource> 子元素指在将用于列标题的资源文件中定义的文本标签。
定义“需求”选项卡的菜单
这将定义“需求”选项卡的菜单和工具栏。工具栏将采用下列结构进行定义:
标准“信息”按钮
“生成需求”按钮。此按钮将触发某操作,以便为结构中当前所选的部件生成需求。
“完成需求”按钮。此按钮将向用户显示候选部件列表,您可以从此列表中选择需求并将其指定为完成的需求。
“查看有效性日志”按钮。此按钮将打开浏览器窗口并显示当前选定“需求”的有效性日志。
标准还原按钮
标准注释按钮
标准还原按钮
标准注释按钮
还为包含三个新操作的菜单项的表格定义了弹出式菜单:
生成需求
完成需求
查看有效性日志
要定义“需求”选项卡的菜单
1. 从以下位置打开 PDMLinkExplorerMenusForRequirementsTab.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. 将下列内容添加到文件中:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE LogicRepository SYSTEM
"/config/logicrepository/dtd/LogicRepository.dtd">
<LogicRepository>
<ExplorerElementGroup>
<LogicContext
application="ptc.pdm.ProductStructureExplorer"/>
<ActionAccess id="mycom.wnc.exp.ChangeActionAssocTableAA">
<MenuBar id="MenuBar">
<Menu id="Menu">
<Import id="ptc.wnc.exp.InfoPageAssocMI"/>
<Separator/>
<MenuItem id="GenerateReqsMI">
<Label
imageName="com/ptc/windchill/explorer/config/images/child_creat
e.gif">
<Resource key="generateReqsLabel"/>
</Label>
<ToolTip>
<Resource key="generateReqsToolTip"/>
</ToolTip>
<Import
id="mycom.wnc.exp.GenerateRequirementsAction"/>
</MenuItem>
<MenuItem id="FulfillReqMI">
<Label
imageName="com/ptc/windchill/explorer/config/images/child_add.g
if">
<Resource key="fulfillReqLabel"/>
</Label>
<ToolTip>
<Resource key="fulfillReqToolTip"/>
</ToolTip>
<Import
id="mycom.wnc.exp.FulfillRequirementAction"/>
</MenuItem>
<MenuItem id="ViewEffLogMI">
<Label
imageName="com/ptc/windchill/explorer/config/images/child_repor
t.gif">
<Resource key="viewEffLogLabel"/>
</Label>
<ToolTip>
<Resource key="viewEffLogToolTip"/>
</ToolTip>
<Import
id="mycom.wnc.exp.ViewEffectivityLogAction"/>
</MenuItem>
<Separator/>
<MenuItem id="RevertMI">
<Label
imageName="com/ptc/windchill/explorer/config/images/revert.gif"
>
<Resource key="revertLabel"/>
</Label>
<ToolTip>
<Resource key="revertToolTip"/>
</ToolTip>
<Import
id="ptc.wnc.exp.RevertForAltAssocAction"/>
</MenuItem>
<Import id="ptc.wnc.exp.CommentAssocMI"/>
</Menu>
</MenuBar>
<ModeToolBar id="ToolBarA">
<Import id="ptc.wnc.exp.EditAppMode"/>
<MenuItemIdentifier
id="ptc.wnc.exp.InfoPageAssocMI"/>
<Separator/>
<MenuItemIdentifier id="GenerateReqsMI"/>
<MenuItemIdentifier id="FulfillReqMI"/>
<MenuItemIdentifier id="ViewEffLogMI"/>
</ModeToolBar>
<ModeToolBar id="ToolBarB">
<Import id="ptc.wnc.exp.DraftAppMode"/>
<Import id="ptc.wnc.exp.AnnotateAppMode"/>
<Import id="ptc.wnc.exp.ReadOnlyAppMode"/>
<MenuItemIdentifier
id="ptc.wnc.exp.InfoPageAssocMI"/>
<Separator/>
<MenuItemIdentifier id="GenerateReqsMI"/>
<MenuItemIdentifier id="FulfillReqMI"/>
<MenuItemIdentifier id="ViewEffLogMI"/>
<Separator/>
<MenuItemIdentifier id="RevertMI"/>
<MenuItemIdentifier
id="ptc.wnc.exp.CommentAssocMI"/>
</ModeToolBar>
<ModePopupMenu id="PopupMenuA">
<Import id="ptc.wnc.exp.EditAppMode"/>
<MenuItemIdentifier id="GenerateReqsMI"/>
<MenuItemIdentifier id="FulfillReqMI"/>
<MenuItemIdentifier id="ViewEffLogMI"/>
</ModePopupMenu>
<ModePopupMenu id="PopupMenuB">
<Import id="ptc.wnc.exp.DraftAppMode"/>
<Import id="ptc.wnc.exp.AnnotateAppMode"/>
<MenuItemIdentifier id="GenerateReqsMI"/>
<MenuItemIdentifier id="FulfillReqMI"/>
<MenuItemIdentifier id="ViewEffLogMI"/>
<Separator/>
<MenuItemIdentifier id="RevertMI"/>
<MenuItemIdentifier
id="ptc.wnc.exp.CommentAssocMI"/>
</ModePopupMenu>
</ActionAccess>
</ExplorerElementGroup>
</LogicRepository>
* 
<ActionAccess> 元素的 id 属性必须与上面定义的 <AssociationTable> 元素的导入子元素中所指定的 id 相匹配。
<Label> 和 <Tooltip> 元素的 <Resource> 子元素指在将用于列标题的资源文件中定义的文本标签。
定义“需求”选项卡的标签、工具提示和助记符
定义“需求”选项卡中所用的标签、工具提示和助记符的文本。
1. 从以下位置打开 ConfigurationResource.rbInfo 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. 向文件末尾添加以下内容:
#
# Tabbed Pane - Requirements
#
requirementsTabLabel.value=Requirements
# Change Item to Requirements table
requirementsLabel.value=Requirements
reqNumberLabel.value=Number
reqValidityLabel.value=Effectivity
reqStatusLabel.value=Status
relatedCINLabel.value=Originating From
fulfillingDSLabel.value=Fulfilled By
reqPredecessorLabel.value=Predecessor
generateReqsLabel.value=Generate Requirements
generateReqsToolTip.value=Generate Requirements
fulfillReqLabel.value=Fulfill Requirement
fulfillReqToolTip.value=Fulfill Requirement
viewEffLogLabel.value=View Effectivity Calculation Log
viewEffLogToolTip.value=View Effectivity Calculation Log
* 
在文件中定义的特性名称 (例如 <特性名称>.value) 必须与 XML 配置文件中的 <Resource> 元素的键属性相匹配。
定义 <MenuItem> 元素中所参考的 <ActionDefinition> 元素
这些是在 PSE 中的“需求”选项卡上显示操作的相关说明。这些说明将针对设置“需求”选项卡的自定义说明中所定义的“完成需求”操作,提供与此操作的菜单和工具栏条目相对应的操作。
1. 从以下位置打开 PDMLinkExplorerActions.xml 文件:
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. 以 'ptc.pdm.ProductStructureExplorer' 的应用程序属性值找到子元素为 <LogicContext> 的 <ExplorerElementGroup> 元素。ActionDefinition 元素将被添加到 LogicContext 元素之后。
3. 使用以下各部分所述的步骤定义相应的元素。
定义“完成需求”操作的 ActionDefinition 元素
这将定义“完成需求”操作的 ActionDefinition 元素。
按照上面的详述,以 'ptc.pdm.ProductStructureExplorer' 的应用程序属性值找到子元素为 <LogicContext> 的 <ExplorerElementGroup> 元素。在 LogicContext 元素之后添加如下所示的 ActionDefinition 元素:
<ActionDefinition id="mycom.wnc.exp.FulfillRequirementAction"
actionClass="com.ptc.windchill.explorer.structureexplorer.panel
.actions.FulfillChangeActionForStructureWithIntermediateNodeAct
ion">
<StructureAuthorAction>
<Import id="mycom.wnc.exp.PartToRequirementSD"/>
</StructureAuthorAction>
<Import id="ptc.wnc.exp.IsValidInAllWithReadVAL"/>
</ActionDefinition>
* 
在 <ActionDefinition> 中定义的 id 属性必须与 PDMLinkExplorerMenusForRequirementsTab.xml 中所定义的 FulfillReqMI 菜单项的已定义导入 id 相匹配。
actionClass 属性将会根据“更改项”和“设计解决方案”节点结构进行定义。如果“设计解决方案”设置在“更改项”节点正下方,则应指定下列类:com.ptc.windchill.explorer.structureexplorer.panel.actions.FulfillChangeActionAction。如果设计解决方案设置其“更改项”节点下方的两个级别,则应指定下列类:com.ptc.windchill.explorer.structureexplorer.panel.actions.FulfillChangeActionForStruc tureWithIntermediateNodeAction。
<StructureAuthorAction> 元素中的导入 id 必须与 ExplorerStructures.xml 文件中定义的结构定义 id 相匹配。
位于 actionClass 所定义级别的所有部件均会被视为完成需求的可能设计解决方案,并显示在选择列表中供用户查看。
定义“生成更改操作”的 ActionDefinition 元素
这将定义“生成更改操作”操作的 ActionDefinition 元素。
按照上面的详述,以 'ptc.pdm.ProductStructureExplorer' 的应用程序属性值找到子元素为 <LogicContext> 的 <ExplorerElementGroup> 元素。在 LogicContext 元素之后添加如下所示的 ActionDefinition 元素:
<ActionDefinition id="mycom.wnc.exp.GenerateRequirementsAction"
actionClass="com.ptc.windchill.explorer.structureexplorer.panel
.actions.GenerateChangeActionsAction">
<Action/>
<Import id="ptc.wnc.exp.IsValidInAllVAL"/>
</ActionDefinition>
* 
在 <ActionDefinition> 中定义的 id 属性必须与 PDMLinkExplorerMenusForRequirementsTab.xml 中定义的 GenerateReqsMI 菜单项的已定义导入 id 相匹配。
定义“查看有效性日志”操作的 ActionDefinition 元素
这将定义“查看有效性日志”操作的 ActionDefinition 元素。
按照上面的详述,以 'ptc.pdm.ProductStructureExplorer' 的应用程序属性值找到子元素为 <LogicContext> 的 <ExplorerElementGroup> 元素。在 LogicContext 元素之后添加如下所示的 ActionDefinition 元素:
<ActionDefinition id="mycom.wnc.exp.ViewEffectivityLogAction"
actionClass="com.ptc.windchill.explorer.structureexplorer.panel
.actions.AssociationUrlAction">
<UrlAction selectionMode="single"
urlBaseName="servlet/TypeBasedIncludeServlet?">
<UrlParameter value="oid={selected_oid}"/>
</UrlAction>
<Import id="ptc.wnc.exp.IsValidForHTMLLaunchMasterOkVAL"/>
</ActionDefinition>
在 <ActionDefinition> 中定义的 id 属性必须与 PDMLinkExplorerMenusForRequirementsTab.xml 中所定义的 ViewEffLogMI 菜单项的已定义导入 id 相匹配。
实现 'enabled decider' 类,以控制何时启用此选项卡
这将创建一个可控制何时启用和禁用“需求”选项卡的新类。仅当在结构树中选择一个与 enabled decider 类中所指定的其中一个类型匹配的部件时,才会启用“需求”选项卡并加以操作。
1. 从以下位置创建 RequirementsEnabledDecider.java 文件:
<Windchill>/codebase/com/mycom/windchill/explorer/structureexpl
orer/deciders
2. 必要时,修改以下实现内容:
修改 common_ancestry 字符串,使其与要查看“需求”的部件的父项类型层次结构相匹配。
在静态代码块中,将条目添加至要查看“需求”的每种部件类型的 type_id_list 中
package
com.mycom.windchill.explorer.structureexplorer.deciders;
import java.util.ArrayList;
import java.util.List;
import
wt.services.applicationcontext.implementation.DefaultServicePro
vider;
import
com.ptc.core.foundation.struct.common.StructureConstants;
import com.ptc.core.meta.common.AssociationIdentifier;
import com.ptc.core.meta.common.AssociationTypeIdentifier;
import com.ptc.core.meta.common.AttributeTypeIdentifier;
import com.ptc.core.meta.common.IdentifierFactory;
import com.ptc.core.meta.common.TypeIdentifier;
import com.ptc.core.meta.common.TypeInstanceIdentifier;
import com.ptc.core.meta.type.common.TypeInstance;
import
com.ptc.windchill.explorer.structureexplorer.config.AbstractCon
fig;
import
com.ptc.windchill.explorer.structureexplorer.deciders.EnabledDe
cider;
import
com.ptc.windchill.explorer.structureexplorer.utility.CommonData
;
public class RequirementsEnabledDecider implements
EnabledDecider
{
private static IdentifierFactory identifierFactory =
(IdentifierFactory)
DefaultServiceProvider.getService(IdentifierFactory.class,
"logical"); //$NON-NLS-1$
private static List<TypeIdentifier> type_id_list = new
ArrayList<TypeIdentifier>();
private static String common_ancestry = "WCTYPE|
wt.part.WTPart|com.mycom.MyPart|"; //$NON-NLS-1$
static {
try
{
type_id_list.add(
(TypeIdentifier)identifierFactory.get(common_ancestry +
"com.mycom.CustomPartA")); //$NON-NLS-1$
type_id_list.add(
(TypeIdentifier)identifierFactory.get(common_ancestry +
"com.mycom.CustomPartB")); //$NON-NLS-1$
type_id_list.add(
(TypeIdentifier)identifierFactory.get(common_ancestry +
"com.mycom.CustomPartC")); //$NON-NLS-1$
type_id_list.add(
(TypeIdentifier)identifierFactory.get(common_ancestry +
"com.mycom.CustomPartD")); //$NON-NLS-1$
}
catch(Exception e)
{
e.printStackTrace();
}
}

public boolean isItemEnabled(TypeInstance node_ti,
TypeInstance parent_node_ti, AbstractConfig item_config,
CommonData common_data)
{
boolean enabled = true
if (node_ti !=null)
{
enabled = isValidPart(node_ti);
}
return enabled;
}
/**
* is this node a generice part or a configurable generic
part?
**/
public static boolean isValidPart(TypeInstance node_ti)
{
if (node_ti ==null)
{
return false;
}
TypeInstanceIdentifier node_tii = (TypeInstanceIdentifier)
node_ti.getIdentifier();
if (node_tii ==null)
{
return false;
}
try
{
if (IsMasterd(node_ti))
{
return false;
}
TypeIdentifier type_id = trimTypeId((TypeIdentifier)
node_tii.getDefinitionIdentifier());
for(TypeIdentifier spec_type_id : type_id_list)
{
if(type_id.isDescendedFrom(spec_type_id))
(
return true;
}
}
return false;
}
catch (Exception e)
{
return false;
}
}

/**
* Assumes an iteration...
*
* isMastered is an unpersisted Iteration and a persisted
Master.
*@param ti
*@return
*
*/
private static boolean IsMastered(TypeInstance ti)
{
try
{
TypeInstanceIdentifier tii = (TypeInstanceIdentifier)
ti.getIdentifier();
if (tii instanceod AssociationIdentifier)
{
tii = ((AssociationIdentifier) tii).getTail();
}
if (!tii.isInitialized())
{
AttributeTypeIdentifier master_ati =
(AttributeTypeIdentifier)
identifierFactory.get(StructureConstants.MASTER_REFERENCE_ID_ST
R, tii.getDefinitionIdentifier());
Object object = ti.getSingle(master_ati);
TypeInstanceIdentifier master_tii = null;
if (object instanceof TypeInstanceIdentifier)
{
master_tii = (TypeInstanceIdentifier) object;
}
if (master_tii.isIntialized())
{
return true;
}
}
}
catch (Exception ex)
{
return false;
}

return false;
)
private static TypeIdentifier trimTypeId(TypeIdentifier
type_id)
{
if (type_id instanceof AssociationTypeIdentifier)
{
return ((AssociationTypeIdentifier) type_id).getTail();
}
return teyp_id;
}
}