추가 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> 요소의 import 하위 요소에 지정된 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> 요소의 import 하위 요소에 지정된 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> 요소의 import 하위 요소에 지정된 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> 요소의 import 하위 요소에 지정된 id와 일치해야 합니다.
요구 사항 유형에 대한 <Table> 요소 정의
구조 트리에서 선택된 부품과 연관된 요구 사항(변경 작업)을 표시할 테이블을 정의합니다. 다음은 열에 표시되는 데이터입니다.
요구 사항 번호
요구 사항 유효성 범위
요구 사항 상태
이 요구 사항을 소유하는 ChangeDirective의 번호
이 요구 사항을 이행하는 부품의 식별자
이 요구 사항의 선행자 요구 사항 번호
요구 사항 유형에 대한 <Table> 요소를 정의하려면 다음 절차를 따르십시오.
1. 다음 위치에서 PDMLinkExplorerForTablesAndPanels.xml 파일을 엽니다.
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. 파일 끝에서 다음 작업을 수행합니다.
a. <LogicRepository> 요소의 하위 요소로 다음 <ExplorerElementGroup>을 작성합니다.
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> 요소의 import 하위 요소에 지정된 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> 요소의 import 하위 요소에 지정된 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
* 
파일에 정의된 등록 정보 이름(예: <property name>.value)은 XML 구성 파일에 있는 <Resource> 요소의 key 속성과 일치해야 합니다.
<MenuItem> 요소에서 참조될 <ActionDefinition> 요소 정의
PSE에서 요구 사항 탭에 작업을 제공하기 위한 지침입니다. 이 지침은 요구 사항 탭 설정의 사용자 정의 지침에 정의된 요구 사항 이행 작업에 대한 메뉴 및 도구 모음 항목 엔트리에 해당하는 작업을 제공합니다.
1. 다음 위치에서 PDMLinkExplorerActions.xml 파일을 엽니다.
<Windchill>/codebase/config/logicrepository/xml/explorer/produc
tstructure
2. <LogicContext> 하위 요소와 'ptc.pdm.ProductStructureExplorer' 응용 프로그램 속성 값을 가진 <ExplorerElementGroup> 요소를 찾습니다. LogicContext 요소 뒤에 ActionDefinition 요소를 추가합니다.
3. 다음 단원에 나오는 단계에 따라 적절한 요소를 정의합니다.
요구 사항 이행 작업에 대한 ActionDefinition 요소 정의
요구 사항 이행 작업에 대한 ActionDefinition 요소를 정의합니다.
위에 설명된 것과 같이 <LogicContext> 하위 요소와 'ptc.pdm.ProductStructureExplorer' 응용 프로그램 속성 값을 가진 <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 메뉴 항목에 대해 정의된 import id와 일치해야 합니다.
actionClass 속성은 변경 항목 및 설계 솔루션의 노드 구조를 기반으로 정의됩니다. 설계 솔루션 세트가 변경 항목 노드 바로 아래에 있으면 com.ptc.windchill.explorer.structureexplorer.panel.actions.FulfillChangeActionAction 클래스를 지정해야 합니다. 설계 솔루션 세트가 해당 변경 항목 노드보다 두 레벨 아래에 있으면 com.ptc.windchill.explorer.structureexplorer.panel.actions.FulfillChangeActionForStruc tureWithIntermediateNodeAction 클래스를 지정해야 합니다.
<StructureAuthorAction> 요소의 import id는 ExplorerStructures.xml 파일에 정의된 구조 정의의 id와 일치해야 합니다.
actionClass로 정의된 레벨에 있는 모든 부품은 이행을 위한 잠재적 설계 솔루션으로 간주되고 선택 목록으로 사용자에게 제공됩니다.
변경 작업 생성 작업에 대한 ActionDefinition 요소 정의
변경 작업 생성 작업에 대한 ActionDefinition 요소를 정의합니다.
위에 설명된 것과 같이 <LogicContext> 하위 요소와 'ptc.pdm.ProductStructureExplorer' 응용 프로그램 속성 값을 가진 <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 메뉴 항목에 대해 정의된 import id와 일치해야 합니다.
유효성 로그 보기 작업에 대한 ActionDefinition 요소 정의
유효성 로그 보기 작업에 대한 ActionDefinition 요소를 정의합니다.
위에 설명된 것과 같이 <LogicContext> 하위 요소와 'ptc.pdm.ProductStructureExplorer' 응용 프로그램 속성 값을 가진 <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 메뉴 항목에 대해 정의된 import 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;
}
}