com.ptc.windchill.esi.bom
Class BOMUtility

java.lang.Object
  extended bycom.ptc.windchill.esi.bom.BOMUtility
All Implemented Interfaces:
Externalizable, Serializable

public final class BOMUtility
extends Object
implements Externalizable

A convenient class to set or retrieve BOM info from Windchill back end for ESI's need.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  TaskHelper taskHelper
           
private  ESITransactionUtility txnUtility
           
 
Constructor Summary
BOMUtility()
           
 
Method Summary
 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.
 Collection getBOMUfids(String baseUFID, int depth)
          Returns a list of multilevel BOM UFIDs.
private  TaskHelper getTaskHelper()
           
private  ESITransactionUtility getTxnUtility()
           
static boolean hasPartUsages(WTPart part)
           
 boolean isBom(WTPart part)
          Returns true if the given part has any children (connected to a WTPartMaster via a WTPartUsageLink) or was ever released by ESI to any target as a BOM.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(BOMUtility thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
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

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

taskHelper

private TaskHelper taskHelper

txnUtility

private ESITransactionUtility txnUtility
Constructor Detail

BOMUtility

public BOMUtility()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(BOMUtility thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getBOMUfids

public Collection getBOMUfids(String baseUFID,
                              int depth)
                       throws ESIException
Returns a list of multilevel BOM UFIDs. If depth is 1, returns the root part UFID.

Supported API: true

Parameters:
baseUFID - The UFID of root object.
depth - the level of BOM , default is 1 ( i.e. returns root bom itself ).
Returns:
Collection
Throws:
ESIException

getBOM

public final 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 final 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

isBom

public final boolean isBom(WTPart part)
                    throws WTException
Returns true if the given part has any children (connected to a WTPartMaster via a WTPartUsageLink) or was ever released by ESI to any target as a BOM. Otherwise returns false

Supported API: true

Parameters:
part - The WTPart to be evaluated.
Returns:
boolean
Throws:
WTException

getTxnUtility

private ESITransactionUtility getTxnUtility()

getTaskHelper

private TaskHelper getTaskHelper()

hasPartUsages

public static boolean hasPartUsages(WTPart part)
                             throws WTException
Throws:
WTException