Yet another exercise in the iep workshop...
Another small exercise for the iep workshop. You can get it here. It's about keeping only the last derived value of a stream, according to the need of the client of the process. Not something complex, and this can be considered to be a building block of the iep modeling. You can also get the wink file how to build the application...
Have fun!
Serge
Posted at 04:09PM Sep 09, 2009 by sergeblais in OpenESB | Comments[4]
Serge, I have a request,
could you explain how we could find events that propagate? for example:
Suppose nodes have a parent child relationship:
E <- A
A <- B
B <- C
B <- D
where each node has a "parent" attribute with the parent id.
now lets say that an event happens on the parent node, and you want all the nodes in the hierarchy to raise an event when something happens to an ancestor. IN the above example, if I receive an event on A, I want to generate events for B, C, D, but not E
This could be easily solved if I could feed an output stream back to the input of a previous step, creating a loop. But It does not seem possible to do loops. If it is, please explain how.
Can you tell me how this could be solved with IEP?
Posted by Paul Pacheco on November 04, 2009 at 01:25 PM EST #
Doing event based, you would consider the iep processed to be daisy chained. So, the event happens on A. Then for A, you would get the direct childs of A (see the fan out event processing), and call the self process on each of these children. Then this process would recursively process all the hierarchy of A. This could even add a "checked" flag for non tree relations, so that if a branch has been checked, you don't go that path again in the recursion. Now you have to be aware that for each child of A, there will be one process, and so on for each node processed.
Posted by Serge Blais on November 04, 2009 at 01:54 PM EST #
Small addendum here. I have create a small project to show how it could be done. Just go to kenai to get the source code (Iterative Example svn) . The sql to create the table (for the parent child relationship) is in the iep project. And the test method is in the test classes from the Composite application project.
Serge
Posted by Serge Blais on November 09, 2009 at 12:02 PM EST #
Forgot the URL...
http://kenai.com/projects/iep-workshop
Serge
Posted by Serge Blais on November 09, 2009 at 12:04 PM EST #