com.ptc.windchill.esi.bom
Class ESIBOMRenderer

java.lang.Object
  extended bycom.ptc.windchill.esi.rnd.BasicESIRenderer
      extended bycom.ptc.windchill.esi.bom.ESIBOMRenderer
All Implemented Interfaces:
ESIRenderer, Serializable

public class ESIBOMRenderer
extends BasicESIRenderer
implements Serializable

This class renders the output of BOM which includes header, components, substitutes and reference designators.

Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
protected  class ESIBOMRenderer.BomDiffResult
           
protected  class ESIBOMRenderer.PreviousExportedIterationKey
           
private  class ESIBOMRenderer.WarningPart
           
 
Field Summary
private  String adapterName
           
private  HashSet allRenderedPartsSet
           
private  boolean alternates
           
private  String authentication
           
private static String BOM_COMPONENT_CLASS
           
private  boolean bomPart
           
private static String CLASSNAME
           
private  boolean componentParts
           
private  String configspec
           
private  boolean delta
           
private  boolean documents
           
private  ESIEffectivityHandler effectivityHandler
           
protected static boolean enforceOrgs
           
private  TaskHelper helper
           
private  boolean lineNumbers
           
private  int multilevel
           
private  String obid
           
private  boolean referenceDesignators
           
protected static boolean requireChange
           
private static String RESOURCE
           
private  WTPart rootPart
           
private static String SUBSTITUTE_CLASS
           
private  boolean substitutes
           
private  ESITargetUtility targetUtility
           
private  Integer transactionID
           
private  ESITransactionUtility transactionUtility
           
 
Fields inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
PART_CLASS_NAME, TASK_URI, XML_META_NAME
 
Constructor Summary
ESIBOMRenderer()
           
 
Method Summary
protected  void addRenderedPart(WTPart part)
           
protected  void addRenderedParts(Collection parts)
           
protected  boolean buildBom(WTPart part)
           
protected  boolean buildBOMHeaderOutput(WTPart part, Collection diffResults)
           
protected  void buildGroups()
          Builds the renderer output.
private  void configspecValidate(String a_Configspec)
           
protected  Collection[] convertEnumArrayToCollectionArray(Enumeration[] enumArray)
           
protected  boolean doRenderAssemblyPart()
           
protected  boolean doRenderComponentParts()
           
private  void generateWarningReleaseActivity(WTPartMaster partMaster, ESIBOMRenderer.BomDiffResult bdr)
           
private  void generateWarnings(ESIBOMRenderer.BomDiffResult bdr)
           
protected  String getAdapterName()
          Gets the value of the attribute: adapterName; The name of the Windchill Adapter to use when obtaining information from Windchill.
private  Collection getAffectedParts(ESIBOMRenderer.BomDiffResult bdr)
           
protected  String getAuthentication()
          Gets the value of the attribute: authentication; Authentication information to use when using the Windchill Adapter for obtaining information.
 IeCollection getBOM(String objectID, boolean delta, boolean bomPart, boolean componentParts, boolean alternates, boolean substitutes, boolean referenceDesignators, boolean lineNumbers, String mulitLevel, boolean documents, String configSpec, String auth, String wcAdapter, String transactionID)
          getBOM RPC processor.
 void getBOM(WTPart part, boolean delta, boolean bomPart, boolean componentParts, boolean alternates, boolean substitutes, boolean referenceDesignators, boolean lineNumbers, String mulitLevel, boolean documents, String configSpec, String auth, String wcAdapter, VdbBuilder builder)
          RPC processor when called from getECN RPC.
protected  Collection getBomUfids()
           
protected  String getConfigspec()
          Gets the value of the attribute: configspec; The Config Spec.
protected  int getMultilevel()
          Gets the value of the attribute: multilevel; How many levels are we to traverse when extracting multi-level BOMs?

Supported API: true
private  BOMTreeNavigator getNavigator()
           
protected  String getObid()
          Gets the value of the attribute: obid; The UFID of the Windchill assembly part to be rendered.
protected  Map getOrgPreviousExportIterationAssociations(WTPart part, Collection orgs, boolean delta)
           
protected  WTPart getRootPart()
           
protected  ESITargetUtility getTargetUtility()
           
protected  TaskHelper getTaskHelper()
           
protected  Integer getTransactionID()
          Gets the value of the attribute: transactionID; The number of an ESI transaction.
protected  ESITransactionUtility getTransactionUtility()
           
protected  boolean isAlternates()
          Gets the value of the attribute: alternates; If parts = true, should the output also include the alternates of the parts?

Supported API: true
protected  boolean isBomPart()
          Gets the value of the attribute: bomPart; Should a part be created for the BOM?

Supported API: true
protected  boolean isComponentParts()
          Gets the value of the attribute: componentParts; Should parts be created for the BOM's components?

Supported API: true
protected  boolean isDelta()
          Gets the value of the attribute: delta; Should the output contain only items that have changed since the last time an object was released?

Supported API: true
protected  boolean isDocuments()
          Gets the value of the attribute: documents; Are documents to be included in the output?

Supported API: true
protected  boolean isLineNumbers()
          Gets the value of the attribute: lineNumbers; Are line numbers to be included in the output?

Supported API: true
protected  boolean isReferenceDesignators()
          Gets the value of the attribute: referenceDesignators; Are reference designators to be included in the output?

Supported API: true
protected  boolean isSubstitutes()
          Gets the value of the attribute: substitutes; Are substitutes to be included in the output?

Supported API: true
 void setConfigspec(String a_Configspec)
          Sets the value of the attribute: configspec; The Config Spec.
 void setData(String obid, boolean provideDelta, boolean buildBOMPart, boolean buildComponentParts, boolean buildAlternates, boolean buildSubs, boolean buildRefDes, boolean useLineNumbers, String multiLevel, boolean buildDocs, String configSpec, String auth, String wcAdapter, String transactionID)
          Provide the data required to render a BOM.
 void setDocuments(boolean a_Documents)
          Sets the value of the attribute: documents; Are documents to be included in the output?

Supported API: true
private  void updateWarningCollection(HashMap hm, WTPartMaster wtpm)
           
protected  void validate()
          Make sure that obid is not null.
 
Methods inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adjustEffectivities, adjustObjectID, adjustTargets, buildUfidString, getAttsFromMapFile, getBuilder, getEffectivityHandler, getGroupInfo, getMap, getMapInfo, getTargetsFromAssns, getWCAttributeList, invokeQueryTask, invokeQueryTask, invokeQueryTask, mapElement, mapObject, render, setBuilder, setEffectivityHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

obid

private String obid

delta

private boolean delta

bomPart

private boolean bomPart

componentParts

private boolean componentParts

alternates

private boolean alternates

substitutes

private boolean substitutes

referenceDesignators

private boolean referenceDesignators

lineNumbers

private boolean lineNumbers

multilevel

private int multilevel

documents

private boolean documents

configspec

private String configspec

authentication

private String authentication

adapterName

private String adapterName

transactionID

private Integer transactionID

BOM_COMPONENT_CLASS

private static final String BOM_COMPONENT_CLASS
See Also:
Constant Field Values

SUBSTITUTE_CLASS

private static final String SUBSTITUTE_CLASS
See Also:
Constant Field Values

requireChange

protected static boolean requireChange

enforceOrgs

protected static boolean enforceOrgs

helper

private TaskHelper helper

targetUtility

private ESITargetUtility targetUtility

transactionUtility

private ESITransactionUtility transactionUtility

effectivityHandler

private ESIEffectivityHandler effectivityHandler

rootPart

private WTPart rootPart

allRenderedPartsSet

private HashSet allRenderedPartsSet
Constructor Detail

ESIBOMRenderer

public ESIBOMRenderer()
Method Detail

getObid

protected String getObid()
Gets the value of the attribute: obid; The UFID of the Windchill assembly part to be rendered.

Supported API: true

Returns:
String

isDelta

protected boolean isDelta()
Gets the value of the attribute: delta; Should the output contain only items that have changed since the last time an object was released?

Supported API: true

Returns:
boolean

isBomPart

protected boolean isBomPart()
Gets the value of the attribute: bomPart; Should a part be created for the BOM?

Supported API: true

Returns:
boolean

isComponentParts

protected boolean isComponentParts()
Gets the value of the attribute: componentParts; Should parts be created for the BOM's components?

Supported API: true

Returns:
boolean

isAlternates

protected boolean isAlternates()
Gets the value of the attribute: alternates; If parts = true, should the output also include the alternates of the parts?

Supported API: true

Returns:
boolean

isSubstitutes

protected boolean isSubstitutes()
Gets the value of the attribute: substitutes; Are substitutes to be included in the output?

Supported API: true

Returns:
boolean

isReferenceDesignators

protected boolean isReferenceDesignators()
Gets the value of the attribute: referenceDesignators; Are reference designators to be included in the output?

Supported API: true

Returns:
boolean

isLineNumbers

protected boolean isLineNumbers()
Gets the value of the attribute: lineNumbers; Are line numbers to be included in the output?

Supported API: true

Returns:
boolean

getMultilevel

protected int getMultilevel()
Gets the value of the attribute: multilevel; How many levels are we to traverse when extracting multi-level BOMs?

Supported API: true

Returns:
int

isDocuments

protected boolean isDocuments()
Gets the value of the attribute: documents; Are documents to be included in the output?

Supported API: true

Returns:
boolean

setDocuments

public void setDocuments(boolean a_Documents)
                  throws WTPropertyVetoException
Sets the value of the attribute: documents; Are documents to be included in the output?

Supported API: true

Parameters:
a_Documents -
Throws:
WTPropertyVetoException

getConfigspec

protected String getConfigspec()
Gets the value of the attribute: configspec; The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.

Supported API: true

Returns:
String

setConfigspec

public void setConfigspec(String a_Configspec)
                   throws WTPropertyVetoException
Sets the value of the attribute: configspec; The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.

Supported API: true

Parameters:
a_Configspec -
Throws:
WTPropertyVetoException

configspecValidate

private void configspecValidate(String a_Configspec)
                         throws WTPropertyVetoException
Parameters:
a_Configspec -
Throws:
WTPropertyVetoException

getAuthentication

protected String getAuthentication()
Gets the value of the attribute: authentication; Authentication information to use when using the Windchill Adapter for obtaining information.

Supported API: true

Returns:
String

getAdapterName

protected String getAdapterName()
Gets the value of the attribute: adapterName; The name of the Windchill Adapter to use when obtaining information from Windchill.

Supported API: true

Overrides:
getAdapterName in class BasicESIRenderer
Returns:
String

getTransactionID

protected Integer getTransactionID()
Gets the value of the attribute: transactionID; The number of an ESI transaction.

Supported API: true

Returns:
Integer

setData

public void setData(String obid,
                    boolean provideDelta,
                    boolean buildBOMPart,
                    boolean buildComponentParts,
                    boolean buildAlternates,
                    boolean buildSubs,
                    boolean buildRefDes,
                    boolean useLineNumbers,
                    String multiLevel,
                    boolean buildDocs,
                    String configSpec,
                    String auth,
                    String wcAdapter,
                    String transactionID)
             throws WTException
Provide the data required to render a BOM.

Supported API: true

Parameters:
obid - The UFID of the Windchill assembly part to be rendered.
provideDelta - Should the output contain only items that have changed since the last time an object was released?
buildBOMPart - Should a part be created for the BOM?
buildComponentParts - Should parts be created for the BOM's components?
buildAlternates - If buildParts = true, should the output also include the alternates of the parts?
buildSubs - Are substitutes to be included in the output?
buildRefDes - Are reference designators to be included in the output?
useLineNumbers - Are line numbers to be included in the output?
multiLevel - How many levels are we to traverse when extracting multi-level BOMs?
buildDocs - Are documents to be included in the output?
configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
auth - Authentication information to use when using the Windchill Adapter for obtaining information.
wcAdapter - The name of the Windchill Adapter to use when obtaining information from Windchill.
transactionID - The number of an ESI transaction.
Throws:
WTException

validate

protected void validate()
                 throws ESIRendererException
Make sure that obid is not null.

Supported API: true

Specified by:
validate in class BasicESIRenderer
Throws:
ESIRendererException

buildGroups

protected void buildGroups()
                    throws ESIRendererException
Builds the renderer output. Does the following:
  1. Obtains the list of parts to be rendered. Uses the services of a BOMTreeNavigator if multilevel > 1.
  2. For each part obtained:
    • Finds the last previous released version of the part for each target.
    • For each previous version : current version pair, obtains the difference from the StandardWTPartService. If there is no previous version, the entire part structure is returned.
    • Calls the BOM header renderer.
    • Calls the BOM component renderer.
    • Optionally calls the substiture renderer.
    • Optionally calls the reference designator renderer
    • Calls adjustElement().
  3. If parts are requested, calls com.ptc.com.esi.esipart. ESIWTPartRenderer.getPart() to render the parts on the BOM.


Supported API: true

Specified by:
buildGroups in class BasicESIRenderer
Throws:
ESIRendererException

getBOM

public IeCollection getBOM(String objectID,
                           boolean delta,
                           boolean bomPart,
                           boolean componentParts,
                           boolean alternates,
                           boolean substitutes,
                           boolean referenceDesignators,
                           boolean lineNumbers,
                           String mulitLevel,
                           boolean documents,
                           String configSpec,
                           String auth,
                           String wcAdapter,
                           String transactionID)
                    throws WTException
getBOM RPC processor. Validates arguments, creates a VDBBuilder and then renders the BOM.

Supported API: true

Parameters:
objectID - UFID for a WTPart.
delta - If "true", returns only the changes since the last successful export. Default is "true".
bomPart - Should a part be created for the BOM?
componentParts - Should parts be created for the BOM's components?
alternates - If "true", returns alternate part info, default is "false". Only operative if "Parts" = "true".
substitutes - If "true", returns substitute data
referenceDesignators - If "true", returns Reference Designator data.
lineNumbers - If "true", returns line numbers info, no line numbers info otherwise.
mulitLevel - The number of levels of BOM, default is 1.
documents - If "true", returns associated documents info, default is "false".Only operative if "Parts" = "true".
configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
auth - This parameter contains authentication information from I*E.
wcAdapter - This parameter contains the name of the Windchill adapter.
transactionID - The TransactionID of the ESITransaction that is related to this RPC request.
Returns:
IeCollection
Throws:
WTException

getBOM

public void getBOM(WTPart part,
                   boolean delta,
                   boolean bomPart,
                   boolean componentParts,
                   boolean alternates,
                   boolean substitutes,
                   boolean referenceDesignators,
                   boolean lineNumbers,
                   String mulitLevel,
                   boolean documents,
                   String configSpec,
                   String auth,
                   String wcAdapter,
                   VdbBuilder builder)
            throws WTException
RPC processor when called from getECN RPC. Validates arguments then creates a VDBBuilder if one hasn't already been provided. Creates a BOM Renderer. Passes control to the renderer. Does not call asVDB() on the renderer because the caller of this method is responsible to do that.

Supported API: true

Parameters:
part - The assembly part for the top-level BOM.
delta - If "true", returns only the changes since the last successful export. Default is "true".
bomPart - Should a part be created for the BOM?
componentParts - Should parts be created for the BOM's components?
alternates - If "true", returns alternate part info, default is "false". Only operative if "Parts" = "true".
substitutes - If "true", returns substitute data
referenceDesignators - If "true", returns Reference Designator data.
lineNumbers - If "true", returns line numbers info, no line numbers info otherwise.
mulitLevel - The number of levels of BOM, default is 1.
documents - If "true", returns associated documents info, default is "false".Only operative if "Parts" = "true".
configSpec - The Config Spec. value to use when navigating the BOM. See the Query-Tree Webject documentation for acceptable and default values.
auth - This parameter contains authentication information from I*E.
wcAdapter - This parameter contains the name of the Windchill adapter.
builder - The VdbBuilder to use when creating output.
Throws:
WTException

addRenderedPart

protected void addRenderedPart(WTPart part)

addRenderedParts

protected void addRenderedParts(Collection parts)

getRootPart

protected WTPart getRootPart()
                      throws WTException
Throws:
WTException

getBomUfids

protected Collection getBomUfids()
                          throws WTException
Throws:
WTException

getNavigator

private BOMTreeNavigator getNavigator()
                               throws ESIRendererException
Throws:
ESIRendererException

buildBom

protected boolean buildBom(WTPart part)
                    throws ESIRendererException
Throws:
ESIRendererException

convertEnumArrayToCollectionArray

protected Collection[] convertEnumArrayToCollectionArray(Enumeration[] enumArray)

getOrgPreviousExportIterationAssociations

protected Map getOrgPreviousExportIterationAssociations(WTPart part,
                                                        Collection orgs,
                                                        boolean delta)
                                                 throws WTException
Throws:
WTException

buildBOMHeaderOutput

protected boolean buildBOMHeaderOutput(WTPart part,
                                       Collection diffResults)
                                throws ESIRendererException
Throws:
ESIRendererException

doRenderAssemblyPart

protected boolean doRenderAssemblyPart()

doRenderComponentParts

protected boolean doRenderComponentParts()

generateWarnings

private void generateWarnings(ESIBOMRenderer.BomDiffResult bdr)
                       throws WTException
Throws:
WTException

getAffectedParts

private Collection getAffectedParts(ESIBOMRenderer.BomDiffResult bdr)
                             throws WTException
Throws:
WTException

updateWarningCollection

private void updateWarningCollection(HashMap hm,
                                     WTPartMaster wtpm)

generateWarningReleaseActivity

private void generateWarningReleaseActivity(WTPartMaster partMaster,
                                            ESIBOMRenderer.BomDiffResult bdr)
                                     throws WTException
Throws:
WTException

getTargetUtility

protected ESITargetUtility getTargetUtility()

getTransactionUtility

protected ESITransactionUtility getTransactionUtility()

getTaskHelper

protected TaskHelper getTaskHelper()