Interface ESIService

All Known Implementing Classes:
StandardESIService

@RemoteInterface public interface ESIService
Defines the ESI methods that are available to remote clients.

Supported API: true

Extendable: false
  • Method Details

    • assignTarget

      void assignTarget(Persistable object, Group targets) throws ESITargetAssignmentException, WTException
      Assign an object to an InfoEngine group of ESITarget objects for ESI target system destination determination. Delegates all work to an instance of ESITargetUtility.

      Supported API: true
      Parameters:
      object - The object to which the target is being assigned
      targets - The InfoEngine group of ESITarget objects to be assigned to the object argument.
      Throws:
      ESITargetAssignmentException
      WTException
    • assignTarget

      void assignTarget(Persistable object, ESITarget target) throws ESITargetAssignmentException, WTException
      Assign an object to an ESITarget for ESI target system destination determination. Delegates all work to an instance of ESITargetUtility.

      Supported API: true
      Parameters:
      object - The object to which the target is being assigned
      target - The ESITarget to be assigned to the object argument.
      Throws:
      ESITargetAssignmentException
      WTException
    • createTransaction

      void createTransaction(WTObject object) throws WTException
      Creates and saves in the database a new ESITransaction that is linked to a WTObject. Delegates all work to an instance of ESITransactionUtility.

      Supported API: true
      Parameters:
      object - The primary business object associated with the ESI transaction.
      Throws:
      WTException
    • deleteTarget

      void deleteTarget(ESITarget tgt) throws WTException
      Deletes an ESITarget from the database. Delegates all work to an instance of ESITargetUtility. As of X-20 ESIResponse meta information is cleared from cache when distribution target is deleted.

      Supported API: true
      Parameters:
      tgt - The object to be deleted.
      Throws:
      WTException
    • findESITargets

      Collection findESITargets(Persistable anObject) throws ESIException, WTException
      Returns a collection of ESITargets for the given object. If the object is a Change Notice (i.e. WTChangeOrder2), returns the targets associated with the changeables on the Change Notice. If the object is a Promotion Request (i.e. PromotionNotice), returns the targets associated with its promotables.

      Supported API: true
      Parameters:
      anObject - The object whose ESITarget associations are to be found.
      Returns:
      Collection
      Throws:
      ESIException
      WTException
    • getTarget

      ESITarget getTarget(String system) throws WTException
      Deprecated.
      - Use ESITargetUtility.getTarget(String, WTContainerRef) instead of this API. System attribute is no loger used for ESITarget instead numeber attribute of target should be used along with container reference.

      Supported API: true
      Return the ESI Target whose system attribute matches the argument. Throw an ESIException if no matching ESITarget exists. Delegates all work to an instance of ESITargetUtility.
      Parameters:
      system - The value of the ESITarget system attribute.
      Returns:
      ESITarget
      Throws:
      WTException
    • isWfLaunched

      boolean isWfLaunched(LifeCycleManaged anObject) throws ESIException, WTException
      Deprecated.
      - Write query to check if workflow process with the status of OPEN_RUNNING for given object.

      Supported API: true
      Check whether there is a workflow process with the status of OPEN_RUNNING for the given object.
      Parameters:
      anObject - The object whose workflow status is to be determined.
      Returns:
      boolean
      Throws:
      ESIException
      WTException
    • isInRelease

      boolean isInRelease(Persistable obj) throws ESIException, WTException
      Returns true if the given releasable object or any releasable iteration for the given master has been published to ERP . Otherwise returns false.

      Supported API: true
      Parameters:
      obj - The persistable object.
      Returns:
      boolean
      Throws:
      ESIException
      WTException
    • release

      ESIRelease release(Persistable obj, String userName, Locale locale) throws ESIException, WTException
      Release a business object to destination targets. As of R10.0, the method generates the ESI response and sends it to the relevant destination as dictated by the distribution targets associated to the business object. Also, it returns the ESIRelease object that represents the release to the caller.

      Supported API: true
      Parameters:
      obj - The releasable object.
      userName - The user ID of the individual responsible for publishing the object.
      locale - The locale to use for publishing the object.
      Returns:
      ESIRelease
      Throws:
      ESIException
      WTException
    • removeTargetAssignment

      void removeTargetAssignment(Persistable object, ESITarget target) throws WTException
      Remove the relationship between an ESITarget and a persistable object. Delegates the deletion to an instance of ESITargetUtility.

      Supported API: true
      Parameters:
      object - The object whose target association is to be removed.
      target - The ESITarget that is no longer to be associated with the persistable object in the object argument.
      Throws:
      WTException
    • updateTransaction

      void updateTransaction(String ufid, String status, String message) throws WTException
      Updates the status of the ESITransaction object represented by the ufid. It also sets the corresponding transaction message for the object.

      Supported API: true
      Parameters:
      ufid -
      status -
      message -
      Throws:
      WTException
    • updateReleaseActivity

      void updateReleaseActivity(String ufid, String status, String message) throws WTException
      Updates the ReleaseActivity object represented by the ufid. It also sets the corresponding release activity message for the object.

      Supported API: true
      Parameters:
      ufid -
      status -
      message -
      Throws:
      WTException
    • deleteReleaseActivity

      void deleteReleaseActivity(String ufid) throws WTException
      Marks the input ReleaseActivity (represented by ufid) for delete.

      Supported API: true
      Parameters:
      ufid -
      Throws:
      WTException
    • getTransaction

      ESITransaction getTransaction(String id, Persistable obj) throws WTException
      Return the ESITransaction object whose number matches the method argument for a given Persistable. Throw an ESIException if no matching transaction exists. Delegates all work to an instance of ESITransactionUtility.

      Supported API: true
      Parameters:
      id - The idNumber attribute value for and ESITransaction that is to be fetched.
      obj - The persistable object associated with the transaction.
      Returns:
      ESITransaction
      Throws:
      WTException
    • getTransaction

      ESITransaction getTransaction(String id, OrgContainer organization) throws WTException
      Return the ESITransaction object whose number and organization container matches the method argument. Throw an ESIException if no matching transaction exists. Delegates all work to an instance of ESITransactionUtility.

      Supported API: true
      Parameters:
      id - The idNumber attribute value for and ESITransaction that is to be fetched.
      organization - The organization container of the transaction.
      Returns:
      ESITransaction
      Throws:
      WTException
    • publishObject

      void publishObject(LifeCycleManaged anObject, boolean validateState) throws ESIException, WTException
      Deprecated.
      Use publishObject(Releasable, boolean, Set) instead of this API.

      Supported API: true
      Triggers the ESI publication for the input object. A few preliminary steps have to be performed before invoking this API, if the input object is a BOM that needs to be sent as a material (rather than as a BOM) to the destination. See the Javadoc for the overloaded version mentioned in the deprecated section for more information.
      Parameters:
      anObject - The input LifeCycleManaged object to be published. It must be a Releasable object as well, in order for the API to work.
      validateState - If true, the object is published only if its life cycle state is one of the values specified for the preference "Configuration Specification State" (or equivalent). Otherwise, the object is published regardless of its life cycle state.
      Throws:
      ESIException
      WTException
    • publishObject

      void publishObject(String ufidReleasableObject, boolean validateState) throws ESIException, WTException
      Triggers the ESI publication for the object corresponding to the input UFID. A few preliminary steps have to be performed before invoking this API, if the input UFID is that of a BOM that needs to be sent as a material (rather than as a BOM) to the destination. See the Javadoc for the overloaded version publishObject(Releasable, boolean, Set) for more information.

      Supported API: true
      Parameters:
      ufidReleasableObject - The input UFID of the Releasable object to be published.
      validateState - If true, the object is published only if its life cycle state is one of the values specified for the preference "Configuration Specification State" (or equivalent). Otherwise, the object is published regardless of its life cycle state.
      Throws:
      ESIException
      WTException
    • getTransactions

      Collection<ESITransaction> getTransactions(Persistable object, Collection<String> targets) throws WTException
      Returns the ESITransactions related to object & ESITarget object.

      Supported API: true
      Parameters:
      object - the persistable object.
      targets - the collection of ESITarget objects object id strings
      Returns:
      Collection containing transactions for object and for a specific target
      Throws:
      WTException
    • validateTargetUpdate

      boolean validateTargetUpdate(ESITarget tgt) throws WTException
      Examines if the ESITarget object is eligible for updation. ESITarget object can be updated if it is not matching with the following criteria. 1.There is atleast one release activity with status as "pending". 2.There is atleast one failure task for the transactions in which this target has involved.

      Supported API: true
      Parameters:
      tgt - The target object to be validated.
      Returns:
      boolean
      Throws:
      WTException
    • adjustTargetAssignments

      void adjustTargetAssignments(String ufids, Group targetInfo) throws WTException
      Given a concatenated set of UFIDs (for WTParts) and a Collection of ESITarget UFIDs, make (or remove) any required assignments.
      • The ufids argument contains a set of UFIDs which define the parts to operate on.
      • The targetInfo argument is an Group. Each element in the group has Atts that:
        1. define the ufid of an ESITarget
        2. define the operation to perform on the parts. If the operation is add, then all parts that do not have the target assigned are given the assignment. If the operation is remove, then all existing assignments for that target to any of the existing parts are removed.

      Delegates all action to ESITransactionUtility.adjustTargetAssignments(String ufids, Group targetInfo)

      Supported API: true
      Parameters:
      ufids - A concatenated list of UFIDs of the objects to operate on.
      targetInfo - A collection of Info*Engine elements containing the UFIDs of the ESITargets to assign/remove and the operation to perform.
      Throws:
      WTException
    • adjustTargetAssignments

      void adjustTargetAssignments(Collection<Persistable> objects, Group targetInfo) throws WTException
      Given a collection of WTParts and a Collection of ESITarget UFIDs, make (or remove) any required assignments.
      • The objects argument contains a collection of parts to operate on.
      • The targetInfo argument is an Group. Each element in the group has Atts that:
        1. define the ufid of an ESITarget
        2. define the operation to perform on the parts. If the operation is add, then all parts that do not have the target assigned are given the assignment. If the operation is remove, then all existing assignments for that target to any of the existing parts are removed.

      Delegates all action to ESITargetUtility.adjustTargetAssignments(Collection, Group)

      Supported API: true
      Parameters:
      objects - - A collection of objects to operate on.
      targetInfo - - A collection of Info*Engine elements containing the UFIDs of the ESITargets to assign/remove and the operation to perform.
      Throws:
      WTException
    • saveTarget

      ESITarget saveTarget(ESITarget distributionTarget) throws WTException, WTPropertyVetoException
      Saves the target to windchill database. Loads the ESI response meta information as well for target after saving the object.

      Supported API: true
      Parameters:
      distributionTarget - The distribution target object to be saved.
      Returns:
      ESITarget
      Throws:
      WTException
      WTPropertyVetoException
    • updateTarget

      ESITarget updateTarget(ESITarget distributionTarget) throws WTException, WTPropertyVetoException
      Updates the target in the Windchill database. Updates the ESI response meta information as well for the target (as appropriate), after saving the object.

      Supported API: true
      Parameters:
      distributionTarget - The distribution target object to be saved.
      Returns:
      ESITarget
      Throws:
      WTException
      WTPropertyVetoException
    • validateTargetAssocsWithViewTargetMappings

      boolean validateTargetAssocsWithViewTargetMappings(Persistable anObject) throws WTException
      Checks if the distribution target associations of the input persistable are valid with respect to the view and target mappings specified in the preference "View To Distribution Target Mappings". Returns true if the associations are valid, false otherwise.

      Supported API: true
      Parameters:
      anObject -
      Returns:
      boolean
      Throws:
      WTException
    • assignTargets

      void assignTargets(Persistable anObject, Collection<ESITarget> tgtCol) throws WTException
      Assigns the target/s to the object. Delegates the assignment to an instance of ESITargetUtility.

      Supported API: true
      Parameters:
      anObject - - An object to which targets should be assigned
      tgtCol - - The collection of targersto be assigned
      Throws:
      WTException
    • removeTargetAssignments

      void removeTargetAssignments(Persistable anObject, Collection<ESITarget> targets) throws WTException
      Remove the relationship between collection of ESITargets and a persistable object.

      Supported API: true
      Parameters:
      anObject - - An object for which target assignments need to be removed.
      targets - - The collection of distribution targets to be removed from assignments.
      Throws:
      WTException
    • publishObject

      void publishObject(Releasable anObject, boolean validateState, Set<ESITargetFacade> targets) throws ESIException, WTException
      Triggers the ESI publication for the input object. The method generates the ESI response and sends it to the distribution targets associated to the input object, or to the targets in the input Set.

      Note: If the input object is a BOM that needs to be sent as a material (rather than as a BOM) to the destination, the following preliminary steps must be performed before invoking this API:

      SessionContext sessionContext = ESIUtility.getUISessionContext(anObject, SessionHelper.getPrincipal());
      sessionContext.remove(ESIConst.ESI_RESPONSE_SESSION_KEY);
      sessionContext.put(ESIConst.PUBLICATION_TYPE_INFO_SESSION_KEY, ESIConst.ENTERPRISE_DATA);

      Supported API: true
      Parameters:
      anObject - The input Releasable object to be published.
      validateState - If true, the object is published only if its life cycle state is one of the values specified for the preference "Configuration Specification State" (or equivalent). Otherwise, the object is published regardless of its life cycle state.
      targets - Set of distribution targets to which the input object should be published. It can hold some or all the targets that are associated to the input object. If a null was passed in, the input object will be published to all the associated distribution targets.
      Throws:
      ESIException
      WTException
    • release

      ESIRelease release(Releasable obj, String userName, Locale locale, Set<ESITargetFacade> targets) throws ESIException, WTException
      Release a business object to destination targets.
      Note: As of R10.3, the method generates the ESI response and sends it to the relevant destination as dictated by the distribution targets associated to the business object or specified as input argument. Input targets should be subset or all targets that are assigned to object. Also, it returns the ESIRelease object that represents the release to the caller.

      Supported API: true
      Parameters:
      obj - The releasable object.
      userName - The user ID of the individual responsible for publishing the object.
      locale - The locale to use for publishing the object.
      targets - - The set of targets to which osbject shuold be published.
      Example: {T1l,T2}
      Returns:
      ESIRelease
      Throws:
      ESIException
      WTException
    • publishObject

      void publishObject(Releasable anObject, boolean validateState, Map<String,Map<ESITargetFacade,Map<String,Object>>> targetInfoMap) throws ESIException, WTException
      Triggers the ESI publication for the input object. The method generates the ESI response and sends it to the distribution targets associated to the input object, or to the targets in the input Map.

      Note: If the input object is a BOM that needs to be sent as a material (rather than as a BOM) to the destination, the following preliminary steps must be performed before invoking this API:

      SessionContext sessionContext = ESIUtility.getUISessionContext(anObject, SessionHelper.getPrincipal());
      sessionContext.remove(ESIConst.ESI_RESPONSE_SESSION_KEY);
      sessionContext.put(ESIConst.PUBLICATION_TYPE_INFO_SESSION_KEY, ESIConst.ENTERPRISE_DATA);

      Supported API: true
      Parameters:
      anObject - The input Releasable object to be published.
      validateState - If true, the object is published only if its life cycle state is one of the values specified for the preference "Configuration Specification State" (or equivalent). Otherwise, the object is published regardless of its life cycle state.
      targetInfoMap - Each key in this Map is a destination ID, and each value is a Map holding ESITargets (that belong in the given destination) as keys, and certain Maps (that are meant for future use) as values.
      Throws:
      ESIException
      WTException
    • release

      ESIRelease release(Releasable obj, String userName, Locale locale, Map<String,Map<ESITargetFacade,Map<String,Object>>> targetInfoMap) throws ESIException, WTException
      Release a business object to destination targets.
      Note: As of R10.3, the method generates the ESI response and sends it to the relevant destination as dictated by the distribution targets associated to the business object or specified as input argument. Input targets should be subset or all targets that are assigned to object. Also, it returns the ESIRelease object that represents the release to the caller.

      Supported API: true
      Parameters:
      obj - The releasable object.
      userName - The user ID of the individual responsible for publishing the object.
      locale - The locale to use for publishing the object.
      targetInfoMap - - The map containing target information where key is destination id and value contains targets map for targets that has same destination id. This target Map holding ESITargetFacade objects as keys and certain Maps as values; each value Map should be null this value map is meant for future use. Map<String, Map<ESITargetFacade, Map<String, Object>>>.
      Example: {ID1={T1=null,T2=null}}
      Returns:
      ESIRelease
      Throws:
      ESIException
      WTException