About this task
To use an interface extension solution
to create the appropriate currency conversion code list:
Procedure
- In the file named the ApplicationServerDirectory/properties/ach.properties.in,
(located in the properties directory under the main Sterling B2B Integrator Server
directory), add a line in the ACH section that reads:
currencyConversionRateProvider=com.ibm.services.edi.ach.utils.
SampleCurrencyConversionRateGenerator
- Initialize a new file in the same properties
directory called ACHCurrencyConversion.properties and add a single
line that reads:
USD.to.CAD=1.33333
- You can add other lines for other currency
conversions, and the Sterling B2B Integrator will find
the correct one to use—the batch envelope definition tells the Sterling B2B Integrator the 'from'
and 'to' currencies to look for. The 1.33333 is the exchange rate.
- Add the following lines to the customer_overrides.properties
file:
customer_overrides.properties:vendor.ACHCurrencyConversion=
ApplicationServerDirectory/properties/ACHCurrencyConversion.properties
server.ACHCurrencyConversion=ApplicationServerDirectory/properties/
ACHCurrencyConversion.properties
- Run setupfiles.sh in ApplicationServerDirectory/bin/
directory supplying no arguments. This rolls the .in files contents
mentioned above into their corresponding ach.properties, vendor.properties
and servers.properties files.
- You must then reload the Sterling B2B Integrator server
for it to locate the changes.
Results
In production, you can dynamically update
the ACHCurrencyConversion.properties file and the Sterling B2B Integrator will immediately
locate the changes without having to restart Sterling B2B Integrator server.
This allows you to supply the correct current exchange rate to the
process in an automated way.
If you want to view
a sample on how to set up and use the class you can view a sample
implementation of the interface at:
com.ibm.services.edi.ach.utils.ICurrencyConversionRateGenerator
through class com.ibm.services.edi.ach.utils.SampleCurrencyConversionRateGenerator
This class reads the conversion rates from the file
ACHCurrencyConversion.properties in the properties directory. Sterling B2B Integrator will first
determine if an extension class is defined and is accessible. If it
is unable to find the extension point, it will try to use the codelist.