Class ESITransactionManagementDelegateImpl

java.lang.Object
com.ptc.windchill.esi.txn.ESITransactionManagementDelegateImpl
All Implemented Interfaces:
ESITransactionManagementDelegate

public class ESITransactionManagementDelegateImpl extends Object implements ESITransactionManagementDelegate
Provides common services which are used for management of transactions in ESI.

Supported API: true

Extendable: true
  • Method Details

    • addTransactionMessage

      public 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
      Specified by:
      addTransactionMessage in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      createReleaseActivity in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      createTransaction in interface ESITransactionManagementDelegate
      Parameters:
      object - - The object that is to be associated with the ESITransaction.
      Returns:
      ESITransaction
      Throws:
      WTException
    • createTransaction

      public 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
      Specified by:
      createTransaction in interface ESITransactionManagementDelegate
      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 QueryResult findTransactions(Persistable obj) throws ESIException
      Returns all ESITransaction objects for the given object.

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

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

      Supported API: true
      Specified by:
      findTransactions in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      getActivities in interface ESITransactionManagementDelegate
      Parameters:
      ufid - - The UFID of an ESITransaction.
      Returns:
      Collection
      Throws:
      WTException
    • getActivities

      public 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
      Specified by:
      getActivities in interface ESITransactionManagementDelegate
      Parameters:
      object - - Persistable object whose history is to be retrieved.
      Returns:
      Collection
      Throws:
      WTException
    • getAllActivities

      public Collection<ReleaseActivity> getAllActivities(Persistable object) throws WTException
      Returns a collection of ReleaseActivity objects that are associated with the input persistable object.

      Supported API: true
      Specified by:
      getAllActivities in interface ESITransactionManagementDelegate
      Parameters:
      object - - Persistable object whose history is to be retrieved.
      Returns:
      Collection
      Throws:
      WTException
    • getReleaseActivities

      public 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
      Specified by:
      getReleaseActivities in interface ESITransactionManagementDelegate
      Parameters:
      ufid - The ufid of the ESITransaction object.
      Returns:
      Group
      Throws:
      WTException
    • getReleaseActivities

      public 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
      Specified by:
      getReleaseActivities in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      getReleaseActivitiesMessage in interface ESITransactionManagementDelegate
      Parameters:
      ufid - ufid of the ReleaseActivity object.
      Returns:
      Group
      Throws:
      WTException
    • getTargetsWithHistory

      public 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
      Specified by:
      getTargetsWithHistory in interface ESITransactionManagementDelegate
      Parameters:
      objects - A collection of persistable objects. The objects must all be instances of the same class.
      Returns:
      Group
      Throws:
      WTException
    • getTargetsWithHistory

      public 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
      Specified by:
      getTargetsWithHistory in interface ESITransactionManagementDelegate
      Parameters:
      object - The Persistable whose target assignments are to be queried.
      Returns:
      Collection
      Throws:
      WTException
    • getTransactions

      public 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
      Specified by:
      getTransactions in interface ESITransactionManagementDelegate
      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 Group getTransactions(Group group, 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
      Specified by:
      getTransactions in interface ESITransactionManagementDelegate
      Parameters:
      group - 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 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
      Specified by:
      getTransactionLogMessage in interface ESITransactionManagementDelegate
      Parameters:
      ufid - ufid of the ESITransaction object.
      Returns:
      Group
      Throws:
      WTException
    • hasReleased

      public 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
      Specified by:
      hasReleased in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      hasReleased in interface ESITransactionManagementDelegate
      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 void hideTransaction(String ufid) throws WTException
      Hide an ESITransaction from the user interface.

      Supported API: true
      Specified by:
      hideTransaction in interface ESITransactionManagementDelegate
      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
      Specified by:
      isInRelease in interface ESITransactionManagementDelegate
      Parameters:
      obj - - The persistable object.
      Returns:
      boolean
      Throws:
      ESIException
    • latestPartExport

      public 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
      Specified by:
      latestPartExport in interface ESITransactionManagementDelegate
      Parameters:
      tgtAssocs - - A collection of ESITargetAssociations with WTParts as the pesistable object.
      Returns:
      Collection - A collection of ESITargetAssociations having target and latest WTPart iteration information.
      Throws:
      WTException
    • postResult

      public 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
      Specified by:
      postResult in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      postResult in interface ESITransactionManagementDelegate
      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 void recordExport(Persistable obj, ESITarget org, String releaseClass) throws WTException
      Mark a persistable as exported to an organization

      Supported API: true
      Specified by:
      recordExport in interface ESITransactionManagementDelegate
      Parameters:
      obj - - the object being flagged
      org - - The ESIOrganization which received the object
      releaseClass - - the type of release activity.
      Throws:
      WTException
    • removePending

      public 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
      Specified by:
      removePending in interface ESITransactionManagementDelegate
      Parameters:
      txn - - The ESITranaction that has completed.
      Throws:
      WTException
    • updateTransaction

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

      Supported API: true
      Specified by:
      updateTransaction in interface ESITransactionManagementDelegate
      Parameters:
      txn - - The transaction to be saved
      Throws:
      WTException
    • getMaxTransactionNumber

      public int getMaxTransactionNumber(WTContained contained) throws WTException
      Finds the maximum value for transaction number in the database in an organization of the contained object.

      Supported API: true
      Specified by:
      getMaxTransactionNumber in interface ESITransactionManagementDelegate
      Parameters:
      contained - - Primary business object for which transaction number needs to be found out.
      Returns:
      int
      Throws:
      WTException
    • getTransaction

      public 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
      Specified by:
      getTransaction in interface ESITransactionManagementDelegate
      Parameters:
      number - - the id of the transaction of interest.
      obj - - the persistable object associated with the transaction.
      Returns:
      ESITransaction
      Throws:
      WTException
    • getTransactionActivities

      public 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
      Specified by:
      getTransactionActivities in interface ESITransactionManagementDelegate
      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
      Specified by:
      getTransactionUfid in interface ESITransactionManagementDelegate
      Parameters:
      number - - the id of the transaction of interest.
      obj - - the persistable object associated with the transaction.
      Returns:
      String
      Throws:
      WTException
    • getTransaction

      public 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
      Specified by:
      getTransaction in interface ESITransactionManagementDelegate
      Parameters:
      number - - the id of the transaction of interest.
      organization - - The organization container of the transaction.
      Returns:
      ESITransaction
      Throws:
      WTException
    • getTransactionActivities

      public 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
      Specified by:
      getTransactionActivities in interface ESITransactionManagementDelegate
      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
      Specified by:
      getTransactionUfid in interface ESITransactionManagementDelegate
      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
      Specified by:
      getCurrentDocument in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      isNewerThan in interface ESITransactionManagementDelegate
      Parameters:
      current - - Current object iteration to test
      other - - Previous object iteration.
      Returns:
      boolean
      Throws:
      WTException
    • isNewerThanCheckIteration

      public 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
      Specified by:
      isNewerThanCheckIteration in interface ESITransactionManagementDelegate
      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
      Specified by:
      updateReleaseOnFailure in interface ESITransactionManagementDelegate
      Parameters:
      obj - - primary business object.
    • hasObjectAlreadyReleased

      public 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
      Specified by:
      hasObjectAlreadyReleased in interface ESITransactionManagementDelegate
      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 Collection<ReleaseActivity> getActivities(ESITransaction txn, String targetNumber) throws WTException
      Returns the ReleaseActivities associated with the input ESITransaction object and distribution target.

      Supported API: true
      Specified by:
      getActivities in interface ESITransactionManagementDelegate
      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
      Specified by:
      getLatestExportedEffs in interface ESITransactionManagementDelegate
      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 Collection<ReleaseActivity> getActivities(Persistable obj, ESITarget target)
      Returns a collection of ReleaseActivities associated with the input persistable object and distribution target.

      Supported API: true
      Specified by:
      getActivities in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      isLifeCycleStateChange in interface ESITransactionManagementDelegate
      Parameters:
      obj - - Input persistable.
      target - - Input distribution target.
      Returns:
      - true if the state is different, a false otherwise.
    • setPendingReleaseToFailed

      public 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
      Specified by:
      setPendingReleaseToFailed in interface ESITransactionManagementDelegate
      Parameters:
      obj - - persistable object.
    • getAssocPrimaryBusinessObject

      public Persistable getAssocPrimaryBusinessObject(ESITransaction txn) throws WTException
      Returns the primary business object associated to the input ESITransaction object.

      Supported API: true
      Specified by:
      getAssocPrimaryBusinessObject in interface ESITransactionManagementDelegate
      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
    • filterMarkedForDeleteTransactions

      public 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
      Specified by:
      filterMarkedForDeleteTransactions in interface ESITransactionManagementDelegate
      Parameters:
      txnCollection - - Input collection of transactions.
      Returns:
      - Collection of transactions which are not marked for delete.
    • getTransaction

      public 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
      invalid reference
      #getTransactions(String, ESITransactionStatusType[], WTContainerRef)
      to serach the transaction.

      Supported API: true
      Specified by:
      getTransaction in interface ESITransactionManagementDelegate
      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 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
      Specified by:
      isAssociatedProcessPlanPublished in interface ESITransactionManagementDelegate
      Parameters:
      part - - Input part.
      targets - - Collection of distribution target ESITarget objects.
      Returns:
      - Value 'true' as explained above otherwise 'false'.
      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
      Specified by:
      markPending in interface ESITransactionManagementDelegate
      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
    • isLifeCycleStateChange

      public 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
      Specified by:
      isLifeCycleStateChange in interface ESITransactionManagementDelegate
      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.