Persisting State for Sharing across Processes

Posted by wvanrensburg on 10-Aug-2010 17:10

Hi, im trying to find out what the est way is to persist state from a Process, so that another Process can utlize that state. A perfect example of this, is a counter that loops from 1 to 10. I could have a Process that starts at 1, and increments every time it is invoked, and when it reaches 10, it resets back to 1.

Is this possible, if so, how would I do that?

Also, Im using version 7.6.2 FYI.

Thanks

Wesley

All Replies

Posted by mnair on 11-Aug-2010 00:18

Hi Wesley,

While executing an ESB process, the  process instance information (state of the process) travels with the  message; i.e. ESB does not maintain a centralized state like other  traditional business process execution environment. What this also means  is that at any given point in time you could have multiple instances of  the process in various stages of execution that are spread across the  entire bus.

So what you are trying to achieve does not fit naturally in to the ESB process model.

Some additional information that might be useful here:

1.  In 7.6.2 any user defined information can only be stored in the message  and thus it could be lost if any of the down stream services in the  process do not propagate this information. Sonic ESB 8.0 has support for  process context properties where you can store properties that are  guaranteed to available from any step during the execution of that  process instance.

2. To implement this correctly you will need  persistence. You will have to write a custom service that can handle  this persistence and then include this service as a step in the process.

3. Given the distributed nature of an ESB process you will also  have to constrant how the custom service is configured (some long the  lines of a single instance with a single listener) to ensure that the  'state' operations are not performed concurrently to prevent the risk of  out of order processing.

4. You could consider using BPEL as an alternative.

Thanks

-Mahesh

Posted by jnyholt on 15-Sep-2010 23:04

This requirement could be met using the CacheTables service type in combination with a stylesheet.

The CacheTables service is available in the PSDN code share.

This thread is closed