Establishing Distribution Target Assignment Classes
Distribution target assignments are established by creating an ESITargetAssignmentLink object and persisting that object in the database. Windchill ESI services class, StandardESIService, provides a public method, assignTarget(), that creates and saves the appropriate object.
ESITargetUtility
Class ESITargetUtility
The distribution target package is intended to be self-contained and "private", except for the classes, ESITarget, ESITargetAssociation, ESIQueryTargetAssociation, and ESITargetUtility. ESITargetUtility is the public interface to the package. The services of the package should be invoked via the public methods of the ESITargetUtility class. The methods of the class are not thread-safe. Each thread is responsible for creating a new instance of the distribution target utility.
Refer to the Windchill release specific Java documentation for more details on available methods in the class
* 
The getDestinationId() and getPlantName() APIs attempt to invoke an identically named API defined on a class whose name is provided by the Windchill ESI preference Distribution Target Information Finder. Since this preference is set to the name of an interface (com.ptc.windchill.esi.tgt.ESITargetInfoFinder) by default, an exception is thrown upon invoking the API for an SAP target and the exception handler ensures that an appropriate value is returned for such a target. However, in order for the preference to work for custom targets, the preference should be set to the name of a concrete implementation of the interface com.ptc.windchill.esi.tgt.ESITargetInfoFinder.
這是否有幫助?