Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Persisting Data using iWay 9.2 Object Store Connector


Recommended Posts

We came across the following requirement while integrating iWay Service Manager with Tibco Foresight. We needed the ability to remember a count after ISM would either be shut down or restarted. Of course we could of written the data to a file or introduce a database to the solution... but that would of introduced a bit of complexity which we just did not want in our solution. Introducing the iWay Object Store Connector. 

The iWay Object Store provides a means to store variable key/value pairs and have them persisted across server stop/start sessions, unlike special registers which are not retained if the server goes down for some reason.

Object Store Component

Flow Editor Palette now has an additional component that lets the user interact with the Object Store.

IIT Palette

Setting Variables in Object Store

To set some variable(s) in the Object Store, drag an Object Store component onto the flow canvas, and select action "create/set object store variable(s)". On the Configuration tab specify an Object Name where variables are to be stored. The named object will be automatically added to the Object Store in case it doesn't yet exist in the Object Store.
image2023-7-20_13-9-42(1).thumb.png.b4ef2d2f7a6bb29b7e4accd2f73c25be.png
 

On the Variables tab add some key/value variable pairs.

image2023-7-20_13-11-33.thumb.png.d256fe03138d4ae054abaee8a7a8bc34.png

 

Removing Variables from Object Store

To remove some variable(s) from an object in the Object Store, drag an Object Store component onto the flow canvas, and select action "remove object variable(s)". On the Configuration tab specify an Object Name where variables are to be removed. If all variables belonging to the named Object in the Object Store are to be removed, leave the Variables tab empty. If specific variables should be removed, add the specific variable names on the Variables tab.

Test Variable Existence

To test for existence of some variable(s) in an object in the Object Store, drag an Object Store component onto the flow canvas, and select action "test if object contains variable(s)". On the Configuration tab specify an Object Name where existence of variables is to be checked. When testing for existence of multiple variables, Boolean Operator of AND or OR will be used to join the comparison operations. Specify the variable names to test for existence on the Variables tab.

Note that if no Object with the specified name is found in the Object Store, a status of "fail_object_exists" will be returned. Create an edge to handle this case when needed.

image2023-7-26_10-47-57.thumb.png.701527ce8c0c58bf802dc44bfc12e8db.png
 

Retrieving Variables from Object Store

Several ways are provided for retrieving variable(s) stored in the Object Store. One way is by using the "retrieve object variable(s)" action of the Object Store component. Drag an Object Store component onto the flow canvas, and select action "retrieve object variable(s)". On the Configuration tab specify an Object Name where variables are to be retrieved from. If all variables belonging to the named Object are to be retrieved, leave the Variables tab empty. If specific variables are to be retrieved, add the specific variable names on the Variables tab. Variables will be returned as a JSON object. If no Object with the specified name is found in the Object Store, a status of "fail_object_exists" will be returned. Create an edge to handle this case when needed.

Another way to retrieve variables is by using the iFL function _psreg(<object name>, <variable name>). For example, to retrieve variable 'var1' stored in the object 'object.1', the following iFL expression can be used _psreg('object.1', var1)

Object Store Configuration

Deployment Templates have several areas that let you customize your Object Store and optionally pre-configure the stored objects. Object Store uses Nitrite DB to persist the variables. Each deployed application has its own object store file located under <iwayhome>/config/<deployment name>/varsStore.db. The file is secured using a username password pair. The username and password can be set only once while creating the database. Nitrite does not store raw password, so retrieval or change of password is not possible. Adding a new username password pair is also not possible for existing database. Default values for username and password are iway/iway. It is recommended to change these settings under Settings/General Settings/Object Store.
 

 

image2023-7-20_14-14-40.thumb.png.66e085489119fcdcce811194c043a8c0.png

Object configuration presents a screen where you can specify a TTL (time to live in hours; can be decimal value). When TTL is provided, any variables that haven't been updated within the time slot equal to TTL value will be automatically removed from the object. Variables and their respective initial values may be added in the table below.

image2023-7-20_16-32-33.thumb.png.8731156f44ce8cdd5a855cd38c419c16.png

So that's pretty much it. For those who wondering whether we support managing the object store via ISM's runtime console, the answer is yes. We are scheduled to release this feature in iWay 9.2 and hope it will assist you in your integration projects. Any feedback and/or enhancements which you may need of this feature would be greatly appreciated.
 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...