Welcome [ B2BiAxis Sign In / Register ]  
Follow Us

Cache Properties Files

Cache Properties Files

 

When developing business processes always develop with the mindset that your processes should operate in a generic fashion.� The way that you can avoid any hard coding values within a business process is to reference property cache files in your business process

 

Business Scenario

You have three environments DEV, QA, and PROD.� Each has a ftp framework bpml layer.� Your host ip address for connection to SIA are different for each environment.� How do you avoid hard coding these values so that you don't have to have a separate business process for each environment.

 

Create a ftp.cache.properties file in your properties folder/directory for each enviornment.� Enter cache values for each ftp.cache.properties file.

 

in ftpinfo.cache.properties in DEV

SIA_Host=abc.dev.ftp.com

�in ftpinfo.cache.properties on QA

SIA_Host=abc.qa.ftp.com

�In ftpinfo.cache.properties on PROD

SIA_Host=abc.ftp.com

Then in your bpml you use the sci-get-property () to retrieve the property value.

                                 <operation name="FTPBegin">
<participant name="FTPClientBeginSession"/>
<output message="FTPClientBeginSessionServiceTypeInputMessage">
<assign to="ConnectionRetries">3</assign>
<assign to="FTPClientAdapter">FTPClientAdapter</assign>
<assign to="RemoteHost" from="sci-get-property('ftpinfo.cache.properties','SIA_Host')"></assign>

Before you run your business process you have to refresh the cache pointing to your property file

                              <operation name="FTPCacheService">
<participant name="CacheRefreshService"/>
<output message="CacheRefreshServiceTypeInputMessage">
<assign to="cache_name">ftpinfo.cache.properties</assign>
<assign to="cache_type">properties</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>