Package com.ptc.windchill.esi.txn
Class ESITransactionUtility
java.lang.Object
com.ptc.windchill.esi.txn.ESITransactionUtility
Provides common services which are not intended to be available to remote consumers. This class is not thread-safe. A
separate instance must be created if multiple threads are to use the services of the class.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidDeprecated.final voidaddTransactionMessage(ESITransaction txn, String text, boolean txnRequired) Adds a message to an ESITransaction.final voidcreateReleaseActivity(Persistable persistable, String description, ESITransaction transaction, boolean successful, ESITarget target, String message, String timestamp, String action, String cls, String user) Create and save a new ReleaseActivity from the arguments
Supported API: truefinal ESITransactioncreateTransaction(Persistable object) Creates a new ESITransaction that is associated to the argument.final ESITransactioncreateTransaction(Persistable object, String userName) Creates a new ESITransaction that is associated to the argument.static voidfilterERPDataReleaseActivities(Collection<ReleaseActivity> activities) Deprecated.- Instead of this API, use your own logic to filter out ERP Data from release activities.static Collection<ESITransaction> filterMarkedForDeleteTransactions(Collection<ESITransaction> txnCollection) From the input collection of transactions, filter out all those transactions which are marked for delete.final QueryResultReturns allESITransactionobjects for the given object.final QueryResultfindTransactions(Persistable obj, String status) ReturnsESITransactionobjects for the given object and status.final Collection<ReleaseActivity> getActivities(ESITransaction txn, String targetNumber) Returns the ReleaseActivities associated with the input ESITransaction object and distribution target.final Collection<ReleaseActivity> getActivities(String ufid) Returns theReleaseActivityobjects associated with theESITransactionidentified by the UFID in the argument.final Collection<ReleaseActivity> getActivities(Persistable object) Returns a Collection ofReleaseActivityobjects that are associated with the input persistable object.static Collection<ReleaseActivity> getActivities(Persistable obj, ESITarget target) Returns a collection of ReleaseActivities associated with the input persistable object and distribution target.final Collection<ReleaseActivity> getAllActivities(Persistable object) Returns a collection ofReleaseActivityobjects that are associated with the input persistable object.static PersistableReturns the primary business object associated to the input ESITransaction object.getCurrentDocument(WTDocumentMaster master) Returns the most recent released iteration of the input document master.Eff[]getLatestExportedEffs(EffManagedVersion emv, ESITarget target) Fetches the date, serial number and lot number effectivities associated with the given object (of type EffManagedVersion) that were last exported to the given target, stores them in an array of Eff instances and returns the array to the caller.final GroupgetReleaseActivities(String ufid) Returns an Info*Engine Group of mapped ReleaseActivity objects given the ufid of the ESITransaction object.final GroupgetReleaseActivities(String ufid, boolean isBaseLineDisplay) Returns an Info*Engine Group of mapped ReleaseActivity objects given the ufid of the ESITransaction object.final GroupReturns an Info*Engine Group of mapped ReleaseActivityMessage object given the ufid of the ReleaseActivity object.static final GroupgetTargetsWithHistory(Collection<Persistable> objects) Returns an Info*Engine Group of mapped ESITargetHistory objects.static final CollectiongetTargetsWithHistory(Persistable object) Returns a Collection of ESITargetHistory objects.final ESITransactiongetTransaction(String number, Persistable obj) Return the ESITransaction object whose number matches the method argument for a given Persistable.final ESITransactiongetTransaction(String number, OrgContainer organization) Return the ESITransaction object whose number and organization container matches the method argument.static final ESITransactiongetTransaction(String transactionID, WTContained wtContainedObj, boolean isSubtransaction, String targetID) This method will search the transaction in the container of the input object.If transaction is not found the transaction is searched irrespective of the container.final Collection<ReleaseActivity> getTransactionActivities(String id, Persistable obj) Return a collection ReleaseActivities associated with the ESITransaction identified by the argument.final Collection<ReleaseActivity> getTransactionActivities(String id, OrgContainer organization) Return a collection ReleaseActivities associated with the ESITransaction identified by the argument.final GroupReturns an Info*Engine Group of mapped ESITransactionMessage object given the ufid of the ESITransaction object.final GroupgetTransactions(Group ufids) Returns an Info*Engine group ofESITransactionobjects that are associated with the objects in the argument.final GroupgetTransactions(Group elements, String searchCondition) Returns an Info*Engine Group ofESITransactionobjects that are associated with the objects in the input Group and that satisfy the input search criteria.getTransactionUfid(String number, Persistable obj) Returns UFID of ESITransaction object whose number matches the method argument for a given Persistable.getTransactionUfid(String number, OrgContainer organization) Returns UFID of ESITransaction object whose number matches the method argument for a given Persistable.static final booleanDeprecated.This method is deprecated as of R10.0 M050.static ESIObjectReleaseStatusLets the caller know if the input object is an already released object.static final booleanhasReleased(Persistable obj, ESITarget target) Check if the input object has at least one pending or successful sub-transaction (ReleaseActivity) for the given target.static final booleanhasReleased(Persistable obj, ESITarget target, boolean ignoreState) Check if the input object has at least one pending or successful sub-transaction (ReleaseActivity) for the given target.final voidhideTransaction(String ufid) Hide an ESITransaction from the user interface.static booleanisAssociatedProcessPlanPublished(WTPart part, Collection<ESITarget> targets) Returns true, if the input part or any of its previous iterations from the current version has a process plan associated with it and both the part/previous iteration and the process plan are successfully published to atleast one of the input targets.booleanisInRelease(Persistable obj) This is to check if the input releasable object is in ESI release .static booleanisLifeCycleStateChange(Persistable obj, ESITarget target) Returns true, if the life cycle state of input persistable is different than the life cycle state stored on the latest release activity whose RoleA and RoleB objects are the input persistable and the distribution target respectively.static booleanisLifeCycleStateChange(Persistable obj, ESITarget target, ReleaseActivity ra) Returns true, if the life cycle state of input persistable is different than the life cycle state stored in provided release activity as parameter.static booleanisLifeCycleStateChange(Persistable obj, ESITarget target, String[] excludeStatuses) Returns true, if the life cycle state of input persistable is different than the life cycle state stored on the latest release activity whose RoleA and RoleB objects are the input persistable and the distribution target respectively.static booleanisNewerThan(Versioned current, Versioned other) Checks two versions and returns true if the current iteration is newer than the other version.static booleanisNewerThanCheckIteration(Versioned current, Versioned other) Checks two versions and returns true if the current iteration is newer than the other version.static final booleanisPartNewerThan(WTPart current, WTPart other) Deprecated.Use isNewerThan instead of this API
Supported API: truefinal Collection<ESITargetAssociation> latestPartExport(Collection<? extends ESITargetAssociation> tgtAssocs) Returns a collection of ESITargetAssociations.voidmarkPending(Collection tgtAssns, ESITransaction transaction) Create a ReleaseActivity with status = PENDING for each of the object - target pairs (ESIPendingTxnRequest objects) in the tgtAssns argument.static voidPerforms the necessary startup logic for the Transaction Utility.final voidDeprecated.This method is deprecated as of R10.0.final voidpostResult(String objectID, String description, String txnID, boolean isSuccessful, boolean isSubtran, String targetNumber, String message, String timestamp, String action, String cls, String user) Processes postResult RPC requests by invoking an overloaded version.final voidpostResult(Collection<HashMap<String, String>> results, String txnID, boolean isSubtransaction, String user) PostResult RPC processor that delegates the actual work to an overloaded version.final voidrecordExport(Persistable obj, ESITarget org, String releaseClass) Mark a persistable as exported to an organization
Supported API: truefinal voidDeletes all ReleaseActivities that have a status of PENDING and are associated with the argument.
The method does not create a database transaction.static voidSets the status of the ESIRelease object associated with the input persistable to FAILED, if its status is found to be PENDING.voidSets the status of the ESIRelease object associated to the input releasable object to Failed.final voidSave a transaction in the database
Supported API: true
-
Method Details
-
abortTransaction
Deprecated.As of 10.2, this API considers ESIRelease object rather than ESITransaction and delegates the work toESIReleaseUtility.abortRelease(Persistable)Note : This method can ONLY be called on ESI workflow if any system errors (e.g. JMS server not available ) Occurred during release, means that unable to send messages to com.ptc.windchill.esi.Event queue.
Supported API: trueRemoves anESIReleaseobject if there are no associatedESITransactionobjects, otherwise does nothing.- Parameters:
obj- - The primary business object for which publication is triggered.
-
addTransactionMessage
public final void addTransactionMessage(ESITransaction txn, String text, boolean txnRequired) throws WTException Adds a message to an ESITransaction. If the transaction already had a message, the old one is replaced by the new message. This results in multiple database activities which should be wrapped in a database transaction. If caller has started a transaction, pass false in the txnRequired argument, otherwise pass true in the argument.
Supported API: true- Parameters:
txn- The transaction to which an message is to be added.text- The text of the message to add.txnRequired- Should this request be wrapped in a database transaction. Should be false if caller has started a transaction.- Throws:
WTException
-
createReleaseActivity
public final void createReleaseActivity(Persistable persistable, String description, ESITransaction transaction, boolean successful, ESITarget target, String message, String timestamp, String action, String cls, String user) throws WTException Create and save a new ReleaseActivity from the arguments
Supported API: true- Parameters:
persistable- The object being flagged as releaseddescription- A textual description of the release typetransaction- The transaction associated with this activity.successful- Was the transaction successful?target- The destination where this object was releasedmessage- An optional message to associate with the ReleaseActivitytimestamp- The time when the ReleaseActivity occurred. Must resolve to a java.sql.TimeStamp. If it doesn't the current time will be used.action- must be "create", "change", or "delete" (case insensitive)cls- The ESI logical class of the object being flaggeduser- The user who requested the activity- Throws:
WTException
-
createTransaction
Creates a new ESITransaction that is associated to the argument. Persists the transaction and the relationship. As of R9.1, the transaction number for ESITransaction object will be in sequence and unique for the organization to which the argument object belongs to.
Supported API: true- Parameters:
object- - The object that is to be associated with the ESITransaction.- Returns:
- ESITransaction
- Throws:
WTException
-
createTransaction
public final ESITransaction createTransaction(Persistable object, String userName) throws WTException Creates a new ESITransaction that is associated to the argument. Persists the transaction and the relationship. As of R9.1, the transaction number for ESITransaction object will be in sequence and unique for the organization to which the argument object belongs to.
Supported API: true- Parameters:
object- - The object that is to be associated with the ESITransaction.userName- - The name of the user responsible for initiating the transaction.- Returns:
- ESITransaction
- Throws:
WTException
-
findTransactions
- Parameters:
obj- - The object for which ESITransaction needs to be found out.- Returns:
- QueryResult - The query result containing ESITransaction objects.
- Throws:
ESIException
-
findTransactions
- Parameters:
obj- - The object for which ESITransaction needs to be found out.status- - The status of the transaction to be considered while finding the transactions.- Returns:
- QueryResult - The query result containing transaction objects.
- Throws:
ESIException
-
getActivities
Returns theReleaseActivityobjects associated with theESITransactionidentified by the UFID in the argument.
Supported API: true- Parameters:
ufid- - The UFID of an ESITransaction.- Returns:
- Collection
- Throws:
WTException
-
getActivities
Returns a Collection ofReleaseActivityobjects that are associated with the input persistable object. Only release activities that are Pending or Successful are returned.
Supported API: true- Parameters:
object- - Persistable object whose history is to be retrieved.- Returns:
- Collection
- Throws:
WTException
-
getAllActivities
Returns a collection ofReleaseActivityobjects that are associated with the input persistable object.
Supported API: true- Parameters:
object- - Persistable object whose history is to be retrieved.- Returns:
- Collection
- Throws:
WTException
-
getReleaseActivities
Returns an Info*Engine Group of mapped ReleaseActivity objects given the ufid of the ESITransaction object.
Supported API: true- Parameters:
ufid- The ufid of the ESITransaction object.- Returns:
- Group
- Throws:
WTException
-
getReleaseActivities
Returns an Info*Engine Group of mapped ReleaseActivity objects given the ufid of the ESITransaction object.
Supported API: true- Parameters:
ufid- The ufid of the ESITransaction object.isBaseLineDisplay- The isBaseLineDisplay flag indicates, whether or not baselines should be retrieved.- Returns:
- Group
- Throws:
WTException
-
getReleaseActivitiesMessage
Returns an Info*Engine Group of mapped ReleaseActivityMessage object given the ufid of the ReleaseActivity object.
Supported API: true- Parameters:
ufid- ufid of the ReleaseActivity object.- Returns:
- Group
- Throws:
WTException
-
getTargetsWithHistory
Returns an Info*Engine Group of mapped ESITargetHistory objects. The ESITargetHistory objects contain the following- The target attribute of the will be one of the available targets.
- The persistableObject will be one of the objects in the argument to this method.
- If the persistable object has been exported to the target, the releaseAttribute will contain the appropriate ReleaseActivity.
The result will be serialized by the ESI mapping service to a group of Info*Engine Element objects.
Supported API: true- Parameters:
objects- A collection of persistable objects. The objects must all be instances of the same class.- Returns:
- Group
- Throws:
WTException
-
getTargetsWithHistory
Returns a Collection of ESITargetHistory objects. The ESITargetHistory objects contain the following- The target attribute of the will be one of the available targets.
- The persistableObject will be one of the objects in the argument to this method.
- If the persistable object has been exported to the target, the releaseAttribute will contain the appropriate ReleaseActivity.
Supported API: true- Parameters:
object- The Persistable whose target assignments are to be queried.- Returns:
- Collection
- Throws:
WTException
-
getTransactions
Returns an Info*Engine group ofESITransactionobjects that are associated with the objects in the argument. The argument is an Info*Engine group containing elements that have been created by (or resemble the output of) a Query-Objects webject.
Supported API: true- Parameters:
ufids- - An Info*Engine Group containing Elements that have been created by (or resemble the output of) a Query-Objects webject.- Returns:
- Group Returns an Info*Engine Group of ESITransaction objects that are associated with the objects in the argument.
- Throws:
WTException
-
getTransactions
Returns an Info*Engine Group ofESITransactionobjects that are associated with the objects in the input Group and that satisfy the input search criteria.
Supported API: true- Parameters:
elements- An Info*Engine Group containing Elements that have been created by (or resemble the output of) a Query-Objects webject.searchCondition- Input search criteria specifying the start date, completed on date etc. for the output ESITransactions.- Returns:
- Group of ESITransaction objects.
- Throws:
WTException
-
getTransactionLogMessage
Returns an Info*Engine Group of mapped ESITransactionMessage object given the ufid of the ESITransaction object.
Supported API: true- Parameters:
ufid- ufid of the ESITransaction object.- Returns:
- Group
- Throws:
WTException
-
hasReleased
Check if the input object has at least one pending or successful sub-transaction (ReleaseActivity) for the given target. API does consider state of object if object is life cycle managedLifeCycleManagedto check if object in given state has release or not.
Supported API: true- Parameters:
obj- - The releasable object.target- - Target to which this object may be published.- Returns:
- True if the object has at least one pending or successful sub-transaction to the specified target, False otherwise.
- Throws:
ESIException
-
hasReleased
public static final boolean hasReleased(Persistable obj, ESITarget target, boolean ignoreState) throws ESIException Check if the input object has at least one pending or successful sub-transaction (ReleaseActivity) for the given target. API does consider state of object if object is life cycle managedLifeCycleManagedand ignoreState is set to 'false' to check if object in given state has release or not.
Supported API: true- Parameters:
obj- - The releasable object.target- - Target to which this object may be published.ignoreState- - Ignores state of LifeCycleManaged object while checking publication when set to 'true' otherwise considers state of LifeCycleManaged object to determine publication status- Returns:
- True if the object has at least one pending or successful sub-transaction to the specified target, False otherwise.
- Throws:
ESIException
-
hideTransaction
Hide an ESITransaction from the user interface.
Supported API: true- Parameters:
ufid- - UFID corresponding to the transaction.- Throws:
WTException
-
isInRelease
This is to check if the input releasable object is in ESI release . Returns true if the transaction or release activity has been created for the given releasable object or any releasable iteration for the given master, regardless of the targets and the status. Otherwise returns false.
Supported API: true- Parameters:
obj- - The persistable object.- Returns:
- boolean
- Throws:
ESIException
-
isPartNewerThan
Deprecated.Use isNewerThan instead of this API
Supported API: trueChecks two different part versions and returns true if the current iteration is newer than the other version. if the preference "Check Iteration" is set to true then part iterations are also checked.- Parameters:
current- - current part iteration to testother- - previous part iteration.- Returns:
- boolean
-
latestPartExport
public final Collection<ESITargetAssociation> latestPartExport(Collection<? extends ESITargetAssociation> tgtAssocs) throws WTException Returns a collection of ESITargetAssociations. These associations holds the latest iteration of WTPart that is published to target. It finds the previously published association which are in PENDING or SUCCEEDED or PARTIALLY_SUCCEEDED.
Supported API: true- Parameters:
tgtAssocs- - A collection of ESITargetAssociations, each having a WTPart as the persistable object.- Returns:
- Collection - A collection of ESITargetAssociations having target and latest WTPart iteration information.
- Throws:
WTException
-
markPending
Create a ReleaseActivity with status = PENDING for each of the object - target pairs (ESIPendingTxnRequest objects) in the tgtAssns argument. Associate the ReleaseActivity objects with the input ESITransaction. Enclose all database requests in a database transaction so that if anything fails the entire request is rolled back.
Supported API: true- Parameters:
tgtAssns- - A collection of ESITargetAssociationstransaction- - The ESITransaction that is to be associated to the ReleaseActivity objects that are created by this method.- Throws:
WTException
-
performStartupProcess
Performs the necessary startup logic for the Transaction Utility. Should be called upon method server startup.
Supported API: true- Throws:
WTException
-
postEvent
@Deprecated public final void postEvent(String objectID, String transaction, boolean isSuccessful, String message) throws WTException Deprecated.This method is deprecated as of R10.0. The API ESIReleaseUtility.postEvent() is invoked instead, as part of processing PostResult RPC requests for overall transactions.Process postEvent RPC requests.
Supported API: true- Parameters:
objectID- The object which is associated with the Windchill event that this RPC will create. It is expected to be the value supplied in the <WaitingObjectID> that is provided in the ESIEvent that intiates the transaction.transaction- The transaction number that is associated with this event.isSuccessful- This is either true or false, according as publication of data to the distribution targets in the release was successful or otherwise, respectively.message- An optional message to pass to the Windchill workflow that is suspended and waiting for this event.- Throws:
WTException
-
postResult
public final void postResult(String objectID, String description, String txnID, boolean isSuccessful, boolean isSubtran, String targetNumber, String message, String timestamp, String action, String cls, String user) throws WTException Processes postResult RPC requests by invoking an overloaded version. As of R9.1, this method requires the objectID parameter while recording the status for the overall transaction. As of R10.0, the postEvent() API is not invoked either by ESI middleware or by ERP Connector to mark the end of a transaction. Instead, it is invoked via the call to the postResult() itself when all the transactions in the given release have been completed.
Supported API: true- Parameters:
objectID- - The UFID of the object being tracked.description- - A user-friendly description of the object.txnID- - The transaction number related to this request.isSuccessful- - Did the request succeed?isSubtran- - If false, this is the end of the transaction messages. If true, it is a transaction line item.targetNumber- - The number attribute of the ESITarget associated with this request.message- - An optional textual description. Generally used for error messages, but not restricted to errors.timestamp- - Optional parameter. If supplied must be a string that can be converted to a java.sql.Timestamp.action- - The action that was requested. Must be one of the values defined by ReleaseActivityAction.cls- - The ESI logical class of the object being tracked. This value came from the ESI RPC response that generated the ESI transaction.user- - The user who requested the transaction.- Throws:
WTException
-
postResult
public final void postResult(Collection<HashMap<String, String>> results, String txnID, boolean isSubtransaction, String user) throws WTExceptionPostResult RPC processor that delegates the actual work to an overloaded version.
Supported API: true- Parameters:
results- - Collection of HashMaps. Each HashMap holds the data pertaining to a given object for which PostResult needs to be processed. The HashMap holds names and values of attributes such as "ObjectID", "ObjectDescription", "Class", "TargetID" etc.txnID- - The transaction number for which PostResult needs to be processed.isSubtransaction- - A true indicates that PostResult is invoked for the sub-transactions and input collection holds post result data for sub-transactions only. A false indicates that PostResult is invoked for an overall transaction.user- - The user who created the transaction.- Throws:
WTException- Any exception that occurs during PostResult processing.
-
recordExport
public final void recordExport(Persistable obj, ESITarget org, String releaseClass) throws WTException Mark a persistable as exported to an organization
Supported API: true- Parameters:
obj- - the object being flaggedorg- - The ESIOrganization which received the objectreleaseClass- - the type of release activity.- Throws:
WTException
-
removePending
Deletes all ReleaseActivities that have a status of PENDING and are associated with the argument.
The method does not create a database transaction. It is assumed that this operation will be performed as part of a larger database request.
Supported API: true- Parameters:
txn- - The ESITranaction that has completed.- Throws:
WTException
-
updateTransaction
Save a transaction in the database
Supported API: true- Parameters:
txn- - The transaction to be saved- Throws:
WTException
-
getTransaction
Return the ESITransaction object whose number matches the method argument for a given Persistable. Throw an WTException if no entry is found.
Supported API: true- Parameters:
number- - the id of the transaction of interest.obj- - the persistable object associated with the transaction.- Returns:
- ESITransaction
- Throws:
WTException
-
getTransactionActivities
public final Collection<ReleaseActivity> getTransactionActivities(String id, Persistable obj) throws WTException Return a collection ReleaseActivities associated with the ESITransaction identified by the argument. If no such transaction, throw a WTException.
Supported API: true- Parameters:
id- - the id of the transaction of interest.obj- - the persistable object associated with the transaction.- Returns:
- Collection
- Throws:
WTException
-
getTransactionUfid
Returns UFID of ESITransaction object whose number matches the method argument for a given Persistable. Throw an WTException if no entry is found.
Supported API: true- Parameters:
number- - the id of the transaction of interest.obj- - the persistable object associated with the transaction.- Returns:
- String
- Throws:
WTException
-
getTransaction
public final ESITransaction getTransaction(String number, OrgContainer organization) throws WTException Return the ESITransaction object whose number and organization container matches the method argument. Throw an WTException if no entry is found.
Supported API: true- Parameters:
number- - the id of the transaction of interest.organization- - The organization container of the transaction.- Returns:
- ESITransaction
- Throws:
WTException
-
getTransactionActivities
public final Collection<ReleaseActivity> getTransactionActivities(String id, OrgContainer organization) throws WTException Return a collection ReleaseActivities associated with the ESITransaction identified by the argument. If no such transaction, throw an WTException.
Supported API: true- Parameters:
id- - the id of the transaction of interest.organization- - The organization container of the transaction.- Returns:
- Collection
- Throws:
WTException
-
getTransactionUfid
Returns UFID of ESITransaction object whose number matches the method argument for a given Persistable. Throw an WTException if no entry is found.
Supported API: true- Parameters:
number- the id of the transaction of interest.organization- The organization container of the transaction.- Returns:
- String
- Throws:
WTException
-
getCurrentDocument
Returns the most recent released iteration of the input document master.
Supported API: true- Parameters:
master- - Input document master.- Returns:
- Most recent iteration having its lifecycle state set to "RELEASED", or a null if no such iteration exists.
- Throws:
WTException- If an error occurred while fetching the iterations for the input document master.
-
isNewerThan
Checks two versions and returns true if the current iteration is newer than the other version. if the preference "Check Iteration" is set to true then object iterations are also checked.
Supported API: true- Parameters:
current- - Current object iteration to testother- - Previous object iteration.- Returns:
- boolean
- Throws:
WTException
-
isNewerThanCheckIteration
public static boolean isNewerThanCheckIteration(Versioned current, Versioned other) throws WTException Checks two versions and returns true if the current iteration is newer than the other version. API does not consider the preference "Check Iteration" when version and iterations are checked.
Supported API: true- Parameters:
current- - Current object iteration to testother- - Previous object iteration.- Returns:
- boolean
- Throws:
WTException
-
updateReleaseOnFailure
Sets the status of the ESIRelease object associated to the input releasable object to Failed. Additionally it sets all the pending and processing transactions within this release to Failed. Note: This method is typically invoked when the user chooses to terminate the RTM workflow after a failed ESI release.
Supported API: true- Parameters:
obj- - primary business object.
-
hasAlreadyReleased
Deprecated.This method is deprecated as of R10.0 M050. Instead of this usehasObjectAlreadyReleased(Persistable)API
Supported API: trueLets the caller know if the input object is an already released object.- Parameters:
obj- The input releasable object.- Returns:
- boolean a true, if the input object in obj is an already released object; a false, otherwise.
- Throws:
ESIException- When any of the invoked methods throws a WTException.
-
hasObjectAlreadyReleased
Lets the caller know if the input object is an already released object. If it is not released object it will it is possible that either the object has never been published or it is failed. Hence, returned object provide reason code indicating whether it has failed or never published or sucessfully published along with status.
Supported API: true- Parameters:
obj- The input releasable object.- Returns:
- - The release status information of an object.
- ESIObjectReleaseStatus has a status value true, if the input object in obj is an already released
object; a false, otherwise.
- When status is 'true' then reason code is RELEASED_SUCESSFULLY.
- When status is 'false' and object is never published then reason code will be NEW_OBJECT
- When status is 'false' and object has failed in published then reason code will be RELEASE_FAILED
- ESIObjectReleaseStatus has a status value true, if the input object in obj is an already released
object; a false, otherwise.
- Throws:
ESIExceptionWTException
-
getActivities
public final Collection<ReleaseActivity> getActivities(ESITransaction txn, String targetNumber) throws WTException Returns the ReleaseActivities associated with the input ESITransaction object and distribution target.
Supported API: true- Parameters:
txn- Input ESITransaction object.targetNumber- Number attribute of the target for which to return the ReleaseActivities.- Returns:
- Collection of ReleaseActivity objects.
- Throws:
WTException
-
getLatestExportedEffs
Fetches the date, serial number and lot number effectivities associated with the given object (of type EffManagedVersion) that were last exported to the given target, 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 type of effectivity was exported to the target for the object.
Note: Effectivties are not returned for a checked-out version of EffManagedVersion object.
Supported API: true- Parameters:
emv- EffManagedVersion instance for which to fetch the last exported date, serial number and lot number effectivitiestarget- ESITarget instance for which to fetch the last exported date, serial number and lot number effectivities- Returns:
- Eff[] array of Eff objects that represent the last exported date, serial number and lot number effectivities
- Throws:
WTException- , if thrown from latestEffExport()
-
getActivities
Returns a collection of ReleaseActivities associated with the input persistable object and distribution target.
Supported API: true- Parameters:
obj- - Input persistable object.target- - input distribution target object.- Returns:
- Collection of release activities whose roleA object is the input persistable and roleB object is the given distribution target.
-
isLifeCycleStateChange
Returns true, if the life cycle state of input persistable is different than the life cycle state stored in provided release activity as parameter.
Supported API: true- Parameters:
obj- - Input persistable.target- - Input distribution target.ra- - Input earlier release activity- Returns:
- - true if the state is different, a false otherwise.
-
isLifeCycleStateChange
Returns true, if the life cycle state of input persistable is different than the life cycle state stored on the latest release activity whose RoleA and RoleB objects are the input persistable and the distribution target respectively.
Supported API: true- Parameters:
obj- - Input persistable.target- - Input distribution target.- Returns:
- - true if the state is different, a false otherwise.
-
setPendingReleaseToFailed
Sets the status of the ESIRelease object associated with the input persistable to FAILED, if its status is found to be PENDING. Logs the stack trace if an exception is encountered while fetching the ESIRelease object or while setting its status.
Supported API: true- Parameters:
obj- - persistable object.
-
getAssocPrimaryBusinessObject
Returns the primary business object associated to the input ESITransaction object.
Supported API: true- Parameters:
txn- The input ESITransaction object.- Returns:
- Persistable The associated primary business object.
- Throws:
ESIException- - if some error was encountered while navigating to the primary business object.WTException
-
filterERPDataReleaseActivities
@Deprecated public static void filterERPDataReleaseActivities(Collection<ReleaseActivity> activities) Deprecated.- Instead of this API, use your own logic to filter out ERP Data from release activities.
Supported API: trueFilter out the release activities of wt.esi.ERPPartSpecificPlantData and wt.esi.ERPMaterial objects from the input collection of release activities.- Parameters:
activities- - Collection of release activities.
-
filterMarkedForDeleteTransactions
public static Collection<ESITransaction> filterMarkedForDeleteTransactions(Collection<ESITransaction> txnCollection) From the input collection of transactions, filter out all those transactions which are marked for delete.
Supported API: true- Parameters:
txnCollection- - Input collection of transactions.- Returns:
- - Collection of transactions which are not marked for delete.
-
getTransaction
public static final ESITransaction getTransaction(String transactionID, WTContained wtContainedObj, boolean isSubtransaction, String targetID) throws WTException This method will search the transaction in the container of the input object.If transaction is not found the transaction is searched irrespective of the container. It makes use of the apigetTransactions(String, ESITransactionStatusType[], WTContainerRef)to serach the transaction.
Supported API: true- Parameters:
transactionID- - Transaction numberwtContainedObj- - The persistable object associated with the post release.isSubtransaction- - A 'true' indicates the post result is called for the subtransaction. A 'false' indicates that the post result is called for the overall transaction. container.targetID- - Target number- Returns:
- Throws:
WTException
-
isAssociatedProcessPlanPublished
public static boolean isAssociatedProcessPlanPublished(WTPart part, Collection<ESITarget> targets) throws WTException Returns true, if the input part or any of its previous iterations from the current version has a process plan associated with it and both the part/previous iteration and the process plan are successfully published to atleast one of the input targets.Example: A.1, A.3, A.8, B.1 are existing iterations of a part and A.3 has associated process plan which was successfully published to one of the input targets. Then this API returns true only for A.3 and A.8 and flase for A.1 and B.1 of the input part.
- Throws an exception if any of the input parameters is null
- Returns a false, when one of the following conditions are met.
- Input "targets" collection is empty.
- MPMLink is not installed.
- Input part or any of its previous iterations from the current version doesn't have a successfully published process plan associated with it. Only iterations from the current version of the input part will be considered while checking process plan association.
- Retuns true in all other cases.
Supported API: true- Parameters:
part- - Input part.targets- - Collection of distribution targetESITargetobjects.- Returns:
- - Value 'true' as explained above otherwise 'false'.
- Throws:
WTException
-
isLifeCycleStateChange
public static boolean isLifeCycleStateChange(Persistable obj, ESITarget target, String[] excludeStatuses) Returns true, if the life cycle state of input persistable is different than the life cycle state stored on the latest release activity whose RoleA and RoleB objects are the input persistable and the distribution target respectively.
Supported API: true- Parameters:
obj- - Input persistable.target- - Input distribution target.excludeStatuses- - Statuses to be excluded while finding release activities- Returns:
- - true if the state is different, a false otherwise.
-
ESIReleaseUtility.abortRelease(Persistable)