Cache Refresh Service

The Cache Refresh service refreshes cached customer defined property file information without restarting the Sterling B2B Integrator.

The following table provides an overview of the Cache Refresh service:

System name CacheRefreshServiceType
Graphical Process Modeler (GPM) categories All Services, Process Controls
Description The Cache Refresh service allows a user to refresh cached customer defined property file information without restarting the Sterling B2B Integrator.
Business usage As a performance enhancement, you might write a business process that will pick up and cache information from a customer-defined properties file. When the same data is frequently referenced, caching it saves the time that would have been used for repeated lookups. The Cache Refresh service allows updated property file information in the cache to be refreshed without a restart of the system.
Usage example For business reasons, information, such as a fax number, needs to be included in output documents. This information can be stored in the properties file and cached. When this information needs to be changed, such as a new fax number in this example, after the properties file has been changed, the cache must be refreshed or the system restarted. This service can be used to refresh the cache without a system restart.
Note: Refreshing the cache makes updated property file information instantly available to all instances of business processes that reference it.
Preconfigured? Yes. A CacheRefreshService configuration is available. However, values for required fields need to be entered when the Cache Refresh service is used in a business process.
Requires third-party files? No
Platform availability All supported platforms
Related services None
Application requirements None
Initiates business processes? No.
Invocation The Cache Refresh service is invoked by a business process.
Business process Considerations The properties file needs to be referenced in the business process using an XPath function (sci-get-property). To run this service on a schedule, create a business process containing this service and then schedule the business process.
Returned status values None
Restrictions The referenced customer property file must either exist in the <Sterling B2B Integrator>/properties directory, or the <Sterling B2B Integrator>/properties/servers.properties file must contain a tag/value pair with "FileTag=<the full file description>". Only customer property files can be refreshed using this service. Cached Sterling B2B Integrator property file information should not be updated while Sterling B2B Integrator is running.
Persistence level System Default
Testing considerations None

Cache Refresh Service Operation

When invoked, the Cache Refresh service:
  1. Flushes the cache of all tag/value pair information from the property file referenced by the PropertyFileTag parameter in the sci-get-property XPath function
  2. Reads the property file
  3. Stores all tag/value pair information in the cache
The Cache Refresh service searches for the PropertyFileTag property file in the following manner:
  1. The service looks in the properties directory of the Sterling B2B Integrator installation for the PropertyFileTag.properties property file. If found, the service reads the property file.
  2. The service looks in the properties directory of the Sterling B2B Integrator installation for the PropertyFileTag (exact match) file.
  3. The service reads the servers.properties file in the properties directory of the Sterling B2B Integrator installation. If a tag for the PropertyFileTag property is found in the servers.properties file, the Cache Refresh service reads the property file.
  4. If the PropertyFileTag property file is not found, the service displays an error message.
    Note: The sci-get-property XPath function will read a property file into cache if it references a PropertyFileTag parameter that is not already in the cache. After the new PropertyFileTag and its contents are initially loaded into the cache, the Cache Refresh service must be run before the new information will be available in the cache.

Implementing the Cache Refresh Service

To implement the Cache Refresh service, complete the following tasks:
  1. Configure the Cache Refresh service.
  2. Use the Cache Refresh service in a business process.

Configuring the Cache Refresh Service

To configure the Cache Refresh service, you must specify settings for the following fields in the Graphical Process Modeler (GPM):

Field Description
Config Unique and meaningful name for the service configuration. Required.
cache_name Name of the property file or the property file tag. Required. Valid value: any string.
Note: This name must match the PropertyFileTag in sci-get-property. For more information, see Referencing the Properties File.
cache_type Type of cache to use. Required. Valid value: Properties

Output from Business Process to Service

The following table contains the parameters passed from the business process to the Cache Refresh service:

Field Description
cache_name Name of the property file or the property file tag. Required. Valid value: any string.
cache_type Type of cache to use. Required. Valid value: Properties

Business Process Example

The following example business process illustrates the use of the Cache Refresh service:

<operation>
      <participant name="CacheRefreshService"/>
      <output message="Xout">
        <assign to="cache_type" from="'properties'"></assign>
        <assign to="cache_name" from="'customer_foo'"></assign>
      </output>
      <input message="Xin">
      </input> 
</operation>

Referencing the Properties File

XPath Function Syntax:

sci-get-property("PropertyFileTag", "PropertyName")
Where:
  • PropertyFileTag – The name of the tag defined in servers.properties or the property file name in the properties directory
  • PropertyName – The name of the property in the properties file

Example:

A property file named customer_fax.properties has been created that contains the following assign statements:

description = some_fax_information 
some_fax_number=000.555.1212

Place the customer_fax.properties file in the <Sterling B2B Integrator installation>/properties directory. This file is referenced by the PropertyFileTag parameter and the tag/value pair contents of this file are read into the cache.

After the property tag customer_fax has been created, the following XPath function statements can be used to retrieve the data from the customer_fax.properties file:
  • <assign to="SomeDescription" from="sci-get-property('customer_fax','description')"/>
  • <assign to="faxNumber" from="sci-get-property('customer_fax','some_fax_number')"/>