Advanced Customization > Windchill ESI Customization > ERP Connector Customization > Windchill ESI Services Modules > Distribution Targets > Configuring ESI for Setting Destination ID and Target ID in ESI Response
Configuring ESI for Setting Destination ID and Target ID in ESI Response
ERP Connector now provides configurable capability instead of customizing ESITargetInfoFinder class and overriding adjustTarget. The existing customization code will continue to work, but it is recommended to use the new configuration method.
Refer to the use case scenario below:
Use case: Use the File type distribution target to send the data to SAP
To use the File type distribution target to send the data to SAP, you need information about plant, SAP client, and instance. This information is used by the custom interface middleware.
When File type distribution target is used, the value is generated based on OOTB logic or ESITargetInfoFinder and with adjustTarget API in ESI response XML as:
<Transaction>
<TransactionNumber>6</TransactionNumber>
<ReleaseNumber>3</ReleaseNumber>
<PrimaryObjectID>OR:wt.part.WTPart:209305:480582545-1654861223916-877175368-17-180-228-10@linux227990.rd-plm.bdns.ptc.com</PrimaryObjectID>
<CreatedBy>wcadmin</CreatedBy>
<CreatedDate>2022-06-17 11:03:21 UTC</CreatedDate>
<Locale>en_US</Locale>
<DestinationID>FILE-002</DestinationID>
</Transaction>

<Part>
<ObjectID>OR:wt.part.WTPart:209254:480582545-1654861223916-877175368-17-180-228-10@linux227990.rd-plm.bdns.ptc.com</ObjectID>
<Class>com.ptc.windchill.esi.Part</Class>
<LastChangedBy>wcadmin</LastChangedBy>
<Number>WCDS000242</Number>
<DefaultUnit>ea</DefaultUnit>
<Name>01-31005.prt</Name>
<PartType>component</PartType>
<Source>make</Source>
<State>INWORK</State>
<View>Design</View>
<IsPhantom>false</IsPhantom>
<Version>A</Version>
<Iteration>1</Iteration>
<EnterpriseVersion/>
<PreviousVersion/>
<IsConfigurable>false</IsConfigurable>
<IsCollapsible>false</IsCollapsible>
<AssociatedEffectivityID/>
<IsAllocatedAsResource>false</IsAllocatedAsResource>
<TargetID>FILE-002</TargetID>
</Part>
With configuration changes, you can specify any attribute on target. This attribute can be reusable, local, or calculated attribute.
To use the File type target to send the data to SAP, the ESI response must contain SystemID, client information, and plant information. For example:
<DestinationID>DH4.800</DestinationID> — Add SystemID, client attribute such as SAP target on File type distribution target and define DestinationID calculated attribute as “SystemID+”.”+Client”. Specify this destination on preference, The value of the Distribution Target attribute to be used as a Destination value in the ESI response.
<TargetID>SAP_DH4:1100</TargetID> — Add plant attribute on File type target such as SAP type of distribution target. Specify this TargetID on the preference, Add a suffix to the TargetID in the ESI Response.
In this case, if you add the following value in the preference and define calculated attribute on the File type distribution target, you can get the updated information in the ESI response:
Specify as value for the preference, The value of the Distribution Target attribute to be used as a Destination value in the ESI responsecom.ptc.windchill.esi.tgt.ESIFileTarget:destinationID
Specify as value for the preference, Add a suffix to the TargetID in the ESI Responsecom.ptc.windchill.esi.tgt.ESIFileTarget:Plant
Refer to the sections below for more information on the preferences:
Add a suffix to the TargetID in the ESI Response
The preference, Add a suffix to the TargetID in the ESI Response allows users to add the value of a distribution target attribute as a suffix to the TargetID rendered in the ESI response. The suffix value can be the value of any attribute or a calculated attribute. For example, in case of SAP or Oracle Applications type of distribution targets plant or organization, the attribute value is added as a suffix for the downstream interface processing. The suffix value can be specified as a coma-separated list of target type:attribute name pairs. For example: com.ptc.windchill.esi.tgt.ESISAPTarget:Plant,com.ptc.windchill.esi.tgt.ESIOATarget:Organization.
The value of the Distribution Target attribute to be used as a Destination value in the ESI response
The value of the Distribution Target attribute to be used as a Destination value in the ESI response preference provides connection information for the downstream integration. For example, in the case of SAP or Oracle Applications type of distribution targets, the destination value is SystemID.Client or DNS attribute, respectively. The preference value can be specified as a coma-separated list of target type:attribute name pairs. For example, com.ptc.windchill.esi.tgt.ESITarget:destinationID
For more information on configuring ESI for setting DestinationID and TargetID, see ERP Connector Customizer’s Guidè on the PTC’s Document Reference Site.
The above preferences are available in the Preference Management under ESI > Settings > Target. For more information on setting a preference, see Windchill ESI Preferences.
Was this helpful?