Package com.ptc.windchill.esi.rnd
Class ESIEffectivityHandlerImpl
java.lang.Object
com.ptc.windchill.esi.rnd.ESIEffectivityHandlerImpl
- All Implemented Interfaces:
ESIEffectivityHandler
The default implementation of ESI effectivity handler.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Field Summary
Fields inherited from interface com.ptc.windchill.esi.rnd.ESIEffectivityHandler
DATE_EFFECTIVITY_TYPE, LOT_NUMBER_EFFECTIVITY_TYPE, SERIAL_NUMBER_EFFECTIVITY_TYPE, UNIT_EFF_CXT_IS_INVALID, UNIT_EFF_CXT_NOT_IN_RESULTING_ITEMS, UNIT_EFF_NO_ERROR, VALIDATE_EFFECTIVITY_CONTEXT -
Method Summary
Modifier and TypeMethodDescriptiongetClassForEffectivityType(int type) Returns the Class instance corresponding to the type of effectivity that is passed to it.protected EffgetLastExportedEffectivity(EffManagedVersion emv, ESITarget target, int type) Returns an Eff instance of the passed type that was last exported to the given distribution target for the given object (of type EffManagedVersion).getLastExportedEffectivity(EffManagedVersion emv, ESITarget target, int type, String efType) Returns an Eff instance of the passed type that was last exported to the given distribution target for the given object (of type EffManagedVersion).protected EffgetLastExportedEffectivity(WTPart part, ESITarget target) Returns the last released Eff object for associated with a WTPart and an ESITarget.Eff[]Fetches the latest date, serial number and lot number effectivities associated with a given object (of type EffManagedVersion), stores them in an array of Eff instances and returns the array to the caller.getLatestEffectivities(EffManagedVersion emv, String type) Fetches the latest date, serial number and lot number effectivities associated with a given object (of type EffManagedVersion), stores them in an array of Eff instances and returns the array to the caller.Deprecated.getLatestEffectivity(EffManagedVersion emv, int type) Returns the latest Effectivity of a given type that is associated with a given object.getLatestEffectivity(EffManagedVersion emv, int type, String efType) Returns the latest Effectivity of a given type that is associated with a given object.protected ESITransactionUtilityGets the value of the attribute: transactionUtility; A reference to an ESITransactionUtility.booleanisCompEffReleased(WTPart part, Collection<WTPart> componentParts, ESITargetAssociation assn, WTPart root, NavigationCriteria navCriteria) Lets the caller know if the latest serial or lot effectivity associated with any of the components in the passed BOM is already published.booleanChecks if the latest date effectivity associated with the given object (of type EffManagedVersion) is also the date effectivity that was last exported to the given distribution target OR if the given object does not have any date effectivity assigned to it.booleanisReleased(EffManagedVersion emv, ESITarget target, int type) Returns a true, if the latest effectivity of the passed type associated with the given object (of type EffManagedVersion) is also the effectivity (of the same type) that was last exported to the given distribution target OR if the given object does not have any effectivity of the given type assigned to it.voidsetBuilder(VdbBuilder builder) Sets the attribute that holds a reference to the VdbBuilder instance.intvalidateUnitEffOnChangeable(WTPart part, Map<Releasable, String> changeables, Map<WTPart, String> contextIterations, NavigationCriteria navCriteria) Lets the caller know if the latest unit effectivity associated with the input part is valid.
-
Method Details
-
getTransactionUtility
Gets the value of the attribute: transactionUtility; A reference to an ESITransactionUtility. Use lazy-initializing getter method to access this attribute.
Supported API: true- Returns:
- ESITransactionUtility
-
getLatestEffectivity
Deprecated.UsegetLatestEffectivity(EffManagedVersion, int)instead of this API
Note: Effectivties are not returned for a checked-out version of EffManagedVersion object.
Supported API: trueReturns the latest non-product-specific Date Effectivity that is associated with an object.- Specified by:
getLatestEffectivityin interfaceESIEffectivityHandler- Parameters:
part- The part whose effectivity is to be obtained- Returns:
- Eff
- Throws:
WTException
-
getLatestEffectivity
Returns the latest Effectivity of a given type that is associated with a given object. The method tries to fetch the required information from cache to start with, failing which it invokes EffHelper.service.getEffs(). The PersistInfo associated with each Eff instance is looked up to determine the latest among the multiple Eff instances (of the given type) that getEffs() may return. The latest Eff instance thus fetched is then cached, so it may be fetched conveniently from the cache during a subsequent call, without having to hit the database.
Note: Effectivties are not returned for a checked-out version of EffManagedVersion object.
Supported API: true- Specified by:
getLatestEffectivityin interfaceESIEffectivityHandler- Parameters:
emv- object iteration (of type EffManagedVersion) whose effectivity needs to be returned.type- This is either ESIEffectivityHandler.DATE_EFFECTIVITY_TYPE, ESIEffectivityHandler.SERIAL_NUMBER_EFFECTIVITY_TYPE or ESIEffectivityHandler.LOT_NUMBER_EFFECTIVITY_TYPE, according as the latest Date, Serial Number or Lot Number effectivity associated with the given object is to be fetched respectively.- Returns:
- Eff
- Throws:
WTException
-
isReleased
Checks if the latest date effectivity associated with the given object (of type EffManagedVersion) is also the date effectivity that was last exported to the given distribution target OR if the given object does not have any date effectivity assigned to it. The object and the distribution target are worked out from the passed ESITargetAssociation instance. If the input object is a process plan, it performs the above said checks for serial and lot effectivity as well. The method returns a true if all the performed checks succeed; it returns a false otherwise.
Supported API: true- Specified by:
isReleasedin interfaceESIEffectivityHandler- Parameters:
assn- The ESITargetAssociation instance from which to work out the EffManagedVersion and ESITarget instances.- Returns:
- boolean
-
isReleased
Returns a true, if the latest effectivity of the passed type associated with the given object (of type EffManagedVersion) is also the effectivity (of the same type) that was last exported to the given distribution target OR if the given object does not have any effectivity of the given type assigned to it.
Supported API: true- Specified by:
isReleasedin interfaceESIEffectivityHandler- Parameters:
emv- Object iteration of type EffManagedVersion for which to determine if the effectivity has been released to the given distribution target or not.target- The given distribution target.type- Specifies the type of effectivity in question - it takes any of the named constants defined in the interface ESIEffectivityHandler for its value.- Returns:
- boolean
-
getClassForEffectivityType
Returns the Class instance corresponding to the type of effectivity that is passed to it.
Supported API: true- Specified by:
getClassForEffectivityTypein interfaceESIEffectivityHandler- Parameters:
type- Specifies the type of effectivity - this could take any of the named constants defined in interface ESIEffectivityHandler for its value.- Returns:
- Class
-
getLastExportedEffectivity
Returns the last released Eff object for associated with a WTPart and an ESITarget. Delegates the work to ESITransactionUtility.latestEffExport().
Supported API: true- Parameters:
part- The part of interest.target- The ESITarget where the part is to be released.- Returns:
- Eff
- Throws:
WTException
-
getLastExportedEffectivity
protected Eff getLastExportedEffectivity(EffManagedVersion emv, ESITarget target, int type) throws WTException Returns an Eff instance of the passed type that was last exported to the given distribution target for the given object (of type EffManagedVersion). The method tries to fetch the required information from cache to start with, failing which it invokes ESITransactionUtility.latestEffExport(EffManagedVersion emv, ESITarget target, int type), an overloaded version that takes the additional argument type.
Supported API: true- Parameters:
emv- object iteration of type EffManagedVersion for which to determine the last exported effectivity.target- Given distribution target.type- Specifies the type of effectivity - takes any of the named constants defined in the interface ESIEffectivityHandler for its value.- Returns:
- Eff
- Throws:
WTException
-
setBuilder
Sets the attribute that holds a reference to the VdbBuilder instance.
Supported API: true- Specified by:
setBuilderin interfaceESIEffectivityHandler- Parameters:
builder- Reference to the VdbBuilder instance that the attribute is to be set to.
-
getLatestEffectivities
Fetches the latest date, serial number and lot number effectivities associated with a given object (of type EffManagedVersion), stores them in an array of Eff instances and returns the array to the caller. Some of the elements in the output array could be null, depending on whether or not the given object has the given type of effectivity associated with it.
Supported API: true- Specified by:
getLatestEffectivitiesin interfaceESIEffectivityHandler- Parameters:
emv- EffManagedVersion instance for which to fetch the latest date, serial number and lot number effectivities.- Returns:
- Eff[]
- Throws:
ESIRendererException
-
getLatestEffectivities
public List<Eff>[] getLatestEffectivities(EffManagedVersion emv, String type) throws ESIRendererException Fetches the latest date, serial number and lot number effectivities associated with a given object (of type EffManagedVersion), stores them in an array of Eff instances and returns the array to the caller. Some of the elements in the output array could be null, depending on whether or not the given object has the given type of effectivity associated with it.
Supported API: true- Specified by:
getLatestEffectivitiesin interfaceESIEffectivityHandler- Parameters:
emv- EffManagedVersion instance for which to fetch the latest date, serial number and lot number effectivities.type-- Returns:
- Eff[]
- Throws:
ESIRendererException
-
getLatestEffectivity
public List<Eff> getLatestEffectivity(EffManagedVersion emv, int type, String efType) throws WTException Returns the latest Effectivity of a given type that is associated with a given object. The method tries to fetch the required information from cache to start with, failing which it invokes EffHelper.service.getEffs(). The PersistInfo associated with each Eff instance is looked up to determine the latest among the multiple Eff instances (of the given type) that getEffs() may return. The latest Eff instance thus fetched is then cached, so it may be fetched conveniently from the cache during a subsequent call, without having to hit the database.
Note: Effectivties are not returned for a checked-out version of EffManagedVersion object.
Supported API: true- Specified by:
getLatestEffectivityin interfaceESIEffectivityHandler- Parameters:
emv- object iteration (of type EffManagedVersion) whose effectivity needs to be returned.type- This is either ESIEffectivityHandler.DATE_EFFECTIVITY_TYPE, ESIEffectivityHandler.SERIAL_NUMBER_EFFECTIVITY_TYPE or ESIEffectivityHandler.LOT_NUMBER_EFFECTIVITY_TYPE, according as the latest Date, Serial Number or Lot Number effectivity associated with the given object is to be fetched respectively.efType- This is currently not used. The parameter merely serves to distinguish this method from the other overloaded versions.- Returns:
- List of Eff objects of the input type associated with the input object.
- Throws:
WTException
-
getLastExportedEffectivity
protected List<Eff> getLastExportedEffectivity(EffManagedVersion emv, ESITarget target, int type, String efType) throws WTException Returns an Eff instance of the passed type that was last exported to the given distribution target for the given object (of type EffManagedVersion). The method tries to fetch the required information from cache to start with, failing which it invokes ESITransactionUtility.latestEffExport(EffManagedVersion emv, ESITarget target, int type), an overloaded version that takes the additional argument type.
Supported API: true- Parameters:
emv- object iteration of type EffManagedVersion for which to determine the last exported effectivity.target- Given distribution target.type- Specifies the type of effectivity - takes any of the named constants defined in the interface ESIEffectivityHandler for its value.- Returns:
- Eff
- Throws:
WTException
-
getLatestEffectivity(EffManagedVersion, int)instead of this APINote: Effectivties are not returned for a checked-out version of EffManagedVersion object.