Windchill のその他の機能 > 製造プロセス管理 > 製品エクスプローラ (PSE) のカスタマイズ > 「要件」タブの作成
  
「要件」タブの作成
このセクションでは、PSE の「要件」タブの表示方法について説明します。この手順に従うと、PSE に表示される「要件」タブが作成され、構造ツリーで指定したタイプの部品が選択された場合にのみ有効になります。タブには、選択したオブジェクトに関連付けられた要件オブジェクトが表示され、要件に関するいくつかの操作を実行できます。
このドキュメンテーションでは、既存のファイルの変更について説明します。作成した新しいエレメントをすべて含む個別の顧客用ファイルを作成してください。
以下の操作手順について説明します。
「要件」タブを追加するための <TabSet> エレメントの更新
「要件」タブの <Tab> エレメントの定義
「要件」タブの <AssociationTable> エレメントの定義
関連付けテーブルの <StructureAuthorDefinition> エレメントの定義
要件に関連付ける部品の <StructureDefinitionSimple> エレメントの定義
要件タイプの <Table> エレメントの定義
「要件」タブのメニューの定義
「要件」タブのラベル、ツールチップ、およびニーモニックの定義
<MenuItem> エレメントで参照される <ActionDefinition> エレメントの定義
タブを有効にするタイミングを制御する '有効決定' クラスの実装
「要件」タブを追加するための <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
<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>
「要件」タブの <Tab> エレメント定義の後に、<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> サブエレメントは、列ヘッダで使用されるリソースファイルで定義されたテキストラベルを参照します。
「要件」タブのメニューの定義
「要件」タブで使用されるメニューとツールバーを定義します。ツールバーは次の構造で定義されます。
標準「情報」ボタン
「要件を生成」ボタン。このボタンは、構造内で現在選択されている部品の要件を生成する操作をトリガします。
「要件を実行」ボタン。このボタンは、現在選択されている要件を満たすために、選択および指定可能な対象部品のリストをユーザーに表示します。
「エフェクティビティログを表示」ボタン。このボタンは、ブラウザウィンドウを開き、現在選択されている要件のエフェクティビティログを表示します。
標準「元に戻す」ボタン
標準「コメント」ボタン
標準「元に戻す」ボタン
標準「コメント」ボタン
テーブルのポップアップメニューも定義されます。これには、以下の 3 つの操作のためのメニューアイテムが含まれます。
要件を生成
要件を実行
エフェクティビティログを表示
「要件」タブのメニューを定義するには
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. <ExplorerElementGroup> エレメントの <LogicContext> サブエレメントにあるアプリケーション属性値 'ptc.pdm.ProductStructureExplorer' を見つけます。ActionDefinition エレメントが LogicContext エレメントの後に追加されます。
3. 以下のセクションの手順に従って、適切なエレメントを定義します。
「要件を実行」操作の ActionDefinition エレメントの定義
「要件を実行」操作の操作定義エレメントが定義されます。
前述の詳細のとおり、<ExplorerElementGroup> エレメントの <LogicContext> サブエレメントにあるアプリケーション属性値 'ptc.pdm.ProductStructureExplorer' を見つけます。次のとおり、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 クラスを指定します。設計解決策ノードが変更アイテムノードの 2 レベル下にある場合は、com.ptc.windchill.explorer.structureexplorer.panel.actions.FulfillChangeActionForStruc tureWithIntermediateNodeAction クラスを指定します。
<StructureAuthorAction> エレメントのインポート id は、ExplorerStructures.xml ファイルで定義されている構造定義の id と一致させる必要があります。
actionClass で定義されているレベルにあるすべての部品が、条件を満たす設計解決策候補とみなされ、ピックリストに入ってユーザーに表示されます。
「変更作業を生成」操作の ActionDefinition エレメントの定義
「変更作業を生成」操作の操作定義エレメントが定義されます。
前述の詳細のとおり、<ExplorerElementGroup> エレメントの <LogicContext> サブエレメントにあるアプリケーション属性値 'ptc.pdm.ProductStructureExplorer' を見つけます。次のとおり、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 エレメントの定義
「エフェクティビティログを表示」操作の操作定義エレメントが定義されます。
前述の詳細のとおり、<ExplorerElementGroup> エレメントの <LogicContext> サブエレメントにあるアプリケーション属性値 'ptc.pdm.ProductStructureExplorer' を見つけます。次のとおり、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 と一致させる必要があります。
タブを有効にするタイミングを制御する '有効決定' クラスの実装
「要件」タブの有効と無効のタイミングを制御する新しいクラスが作成されます。有効決定クラスで指定されたいずれかのタイプと一致する部品が構造ツリーで選択された場合にのみ、「要件」タブが有効で動作可能になります。
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;
}
}