Class ESITransactionUtility

java.lang.Object
com.ptc.windchill.esi.txn.ESITransactionUtility

public final class ESITransactionUtility extends Object
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
  • Method Details

    • abortTransaction

      @Deprecated public final void abortTransaction(Persistable obj)
      Deprecated.
      As of 10.2, this API considers ESIRelease object rather than ESITransaction and delegates the work to ESIReleaseUtility.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: true

      Removes an ESIRelease object if there are no associated ESITransaction objects, 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 released
      description - A textual description of the release type
      transaction - The transaction associated with this activity.
      successful - Was the transaction successful?
      target - The destination where this object was released
      message - An optional message to associate with the ReleaseActivity
      timestamp - 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 flagged
      user - The user who requested the activity
      Throws:
      WTException
    • createTransaction

      public final ESITransaction createTransaction(Persistable object) 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.
      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

      public final QueryResult findTransactions(Persistable obj) throws ESIException
      Returns all ESITransaction objects for the given object.

      Supported API: true
      Parameters:
      obj - - The object for which ESITransaction needs to be found out.
      Returns:
      QueryResult - The query result containing ESITransaction objects.
      Throws:
      ESIException
    • findTransactions

      public final QueryResult findTransactions(Persistable obj, String status) throws ESIException
      Returns ESITransaction objects for the given object and status.

      Supported API: true
      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

      public final Collection<ReleaseActivity> getActivities(String ufid) throws WTException
      Returns the ReleaseActivity objects associated with the ESITransaction identified by the UFID in the argument.

      Supported API: true
      Parameters:
      ufid - - The UFID of an ESITransaction.
      Returns:
      Collection
      Throws:
      WTException
    • getActivities

      public final Collection<ReleaseActivity> getActivities(Persistable object) throws WTException
      Returns a Collection of ReleaseActivity objects 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

      public final Collection<ReleaseActivity> getAllActivities(Persistable object) throws WTException
      Returns a collection of ReleaseActivity objects 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

      public final Group getReleaseActivities(String ufid) throws WTException
      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

      public final Group getReleaseActivities(String ufid, boolean isBaseLineDisplay) throws WTException
      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

      public final Group getReleaseActivitiesMessage(String ufid) throws WTException
      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

      public static final Group getTargetsWithHistory(Collection<Persistable> objects) throws WTException
      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

      public static final Collection getTargetsWithHistory(Persistable object) throws WTException
      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

      public final Group getTransactions(Group ufids) throws WTException
      Returns an Info*Engine group of ESITransaction objects 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

      public final Group getTransactions(Group elements, String searchCondition) throws WTException
      Returns an Info*Engine Group of ESITransaction objects 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

      public final Group getTransactionLogMessage(String ufid) throws WTException
      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

      public static final boolean hasReleased(Persistable obj, ESITarget target) 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 managed LifeCycleManaged 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.
      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 managed LifeCycleManaged and 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

      public final void hideTransaction(String ufid) throws WTException
      Hide an ESITransaction from the user interface.

      Supported API: true
      Parameters:
      ufid - - UFID corresponding to the transaction.
      Throws:
      WTException
    • isInRelease

      public boolean isInRelease(Persistable obj) throws ESIException
      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 public static final boolean isPartNewerThan(WTPart current, WTPart other)
      Deprecated.
      Use isNewerThan instead of this API

      Supported API: true
      Checks 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 test
      other - - 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

      public void markPending(Collection tgtAssns, ESITransaction transaction) throws WTException
      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 ESITargetAssociations
      transaction - - The ESITransaction that is to be associated to the ReleaseActivity objects that are created by this method.
      Throws:
      WTException
    • performStartupProcess

      public static void performStartupProcess() throws WTException
      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 WTException
      PostResult 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 flagged
      org - - The ESIOrganization which received the object
      releaseClass - - the type of release activity.
      Throws:
      WTException
    • removePending

      public final void removePending(ESITransaction txn) throws WTException
      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

      public final void updateTransaction(ESITransaction txn) throws WTException
      Save a transaction in the database

      Supported API: true
      Parameters:
      txn - - The transaction to be saved
      Throws:
      WTException
    • getTransaction

      public final ESITransaction getTransaction(String number, Persistable obj) throws WTException
      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

      public String getTransactionUfid(String number, Persistable obj) throws WTException
      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

      public String getTransactionUfid(String number, OrgContainer organization) throws WTException
      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

      public WTDocument getCurrentDocument(WTDocumentMaster master) throws WTException
      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

      public static boolean isNewerThan(Versioned current, Versioned other) throws WTException
      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 test
      other - - 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 test
      other - - Previous object iteration.
      Returns:
      boolean
      Throws:
      WTException
    • updateReleaseOnFailure

      public void updateReleaseOnFailure(Persistable obj)
      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 public static final boolean hasAlreadyReleased(Persistable obj) throws ESIException
      Deprecated.
      This method is deprecated as of R10.0 M050. Instead of this use hasObjectAlreadyReleased(Persistable) API

      Supported API: true
      Lets 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

      public static ESIObjectReleaseStatus hasObjectAlreadyReleased(Persistable obj) throws ESIException
      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
      Throws:
      ESIException
      WTException
    • 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

      public Eff[] getLatestExportedEffs(EffManagedVersion emv, ESITarget target) throws WTException
      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 effectivities
      target - 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

      public static Collection<ReleaseActivity> getActivities(Persistable obj, ESITarget target)
      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

      public static boolean isLifeCycleStateChange(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.

      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

      public static boolean isLifeCycleStateChange(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.

      Supported API: true
      Parameters:
      obj - - Input persistable.
      target - - Input distribution target.
      Returns:
      - true if the state is different, a false otherwise.
    • setPendingReleaseToFailed

      public static void setPendingReleaseToFailed(Persistable obj)
      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

      public static Persistable getAssocPrimaryBusinessObject(ESITransaction txn) throws WTException
      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: true
      Filter 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 api getTransactions(String, ESITransactionStatusType[], WTContainerRef) to serach the transaction.

      Supported API: true
      Parameters:
      transactionID - - Transaction number
      wtContainedObj - - 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.

      1. Throws an exception if any of the input parameters is null
      2. Returns a false, when one of the following conditions are met.
        1. Input "targets" collection is empty.
        2. MPMLink is not installed.
        3. 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.
      3. Retuns true in all other cases.


      Supported API: true
      Parameters:
      part - - Input part.
      targets - - Collection of distribution target ESITarget objects.
      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.