Package com.ptc.windchill.esi.svc
Interface ESIService
- All Known Implementing Classes:
StandardESIService
Defines the ESI methods that are available to remote clients.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionvoidadjustTargetAssignments(String ufids, Group targetInfo) Given a concatenated set of UFIDs (for WTParts) and a Collection of ESITarget UFIDs, make (or remove) any required assignments.voidadjustTargetAssignments(Collection<Persistable> objects, Group targetInfo) Given a collection of WTParts and a Collection of ESITarget UFIDs, make (or remove) any required assignments.voidassignTarget(Persistable object, Group targets) Assign an object to an InfoEngine group of ESITarget objects for ESI target system destination determination.voidassignTarget(Persistable object, ESITarget target) Assign an object to an ESITarget for ESI target system destination determination.voidassignTargets(Persistable anObject, Collection<ESITarget> tgtCol) Assigns the target/s to the object.voidcreateTransaction(WTObject object) Creates and saves in the database a new ESITransaction that is linked to a WTObject.voiddeleteReleaseActivity(String ufid) Marks the input ReleaseActivity (represented by ufid) for delete.voiddeleteTarget(ESITarget tgt) Deletes an ESITarget from the database.findESITargets(Persistable anObject) Returns a collection of ESITargets for the given object.Deprecated.getTransaction(String id, Persistable obj) Return the ESITransaction object whose number matches the method argument for a given Persistable.getTransaction(String id, OrgContainer organization) Return the ESITransaction object whose number and organization container matches the method argument.getTransactions(Persistable object, Collection<String> targets) Returns the ESITransactions related to object & ESITarget object.booleanisInRelease(Persistable obj) Returns true if the given releasable object or any releasable iteration for the given master has been published to ERP .booleanisWfLaunched(LifeCycleManaged anObject) Deprecated.- Write query to check if workflow process with the status of OPEN_RUNNING for given object.voidpublishObject(String ufidReleasableObject, boolean validateState) Triggers the ESI publication for the object corresponding to the input UFID.voidpublishObject(Releasable anObject, boolean validateState, Map<String, Map<ESITargetFacade, Map<String, Object>>> targetInfoMap) Triggers the ESI publication for the input object.voidpublishObject(Releasable anObject, boolean validateState, Set<ESITargetFacade> targets) Triggers the ESI publication for the input object.voidpublishObject(LifeCycleManaged anObject, boolean validateState) Deprecated.UsepublishObject(Releasable, boolean, Set)instead of this API.release(Releasable obj, String userName, Locale locale, Map<String, Map<ESITargetFacade, Map<String, Object>>> targetInfoMap) 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.release(Releasable obj, String userName, Locale locale, Set<ESITargetFacade> targets) 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.release(Persistable obj, String userName, Locale locale) Release a business object to destination targets.voidremoveTargetAssignment(Persistable object, ESITarget target) Remove the relationship between an ESITarget and a persistable object.voidremoveTargetAssignments(Persistable anObject, Collection<ESITarget> targets) Remove the relationship between collection of ESITargets and a persistable object.saveTarget(ESITarget distributionTarget) Saves the target to windchill database.voidupdateReleaseActivity(String ufid, String status, String message) Updates the ReleaseActivity object represented by the ufid.updateTarget(ESITarget distributionTarget) Updates the target in the Windchill database.voidupdateTransaction(String ufid, String status, String message) Updates the status of the ESITransaction object represented by the ufid.booleanChecks 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".booleanExamines if the ESITarget object is eligible for updation.
-
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 assignedtargets- The InfoEngine group of ESITarget objects to be assigned to the object argument.- Throws:
ESITargetAssignmentExceptionWTException
-
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 assignedtarget- The ESITarget to be assigned to the object argument.- Throws:
ESITargetAssignmentExceptionWTException
-
createTransaction
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
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
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:
ESIExceptionWTException
-
getTarget
Deprecated.- UseESITargetUtility.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: trueReturn 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
Deprecated.- Write query to check if workflow process with the status of OPEN_RUNNING for given object.
Supported API: trueCheck 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:
ESIExceptionWTException
-
isInRelease
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:
ESIExceptionWTException
-
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:
ESIExceptionWTException
-
removeTargetAssignment
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
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
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
Marks the input ReleaseActivity (represented by ufid) for delete.
Supported API: true- Parameters:
ufid-- Throws:
WTException
-
getTransaction
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
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.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:
ESIExceptionWTException
-
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 versionpublishObject(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:
ESIExceptionWTException
-
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
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
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:
- define the ufid of an ESITarget
- 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
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:
- define the ufid of an ESITarget
- 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 toESITargetUtility.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
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:
WTExceptionWTPropertyVetoException
-
updateTarget
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:
WTExceptionWTPropertyVetoException
-
validateTargetAssocsWithViewTargetMappings
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
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 assignedtgtCol- - 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:
ESIExceptionWTException
-
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:
ESIExceptionWTException
-
publishObject
void publishObject(Releasable anObject, boolean validateState, Map<String, Map<ESITargetFacade, throws ESIException, WTExceptionMap<String, Object>>> targetInfoMap) 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:
ESIExceptionWTException
-
release
ESIRelease release(Releasable obj, String userName, Locale locale, Map<String, Map<ESITargetFacade, throws ESIException, WTExceptionMap<String, Object>>> targetInfoMap) 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:
ESIExceptionWTException
-
ESITargetUtility.getTarget(String, WTContainerRef)instead of this API.