• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

workflow implemetation with stateful session bean

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I would like to implement a worklflow and I want to use stateful session bean.
So the worklfow rather complicated, this has to do some steps and wait for some events, make some decisions, wait again and so on. There is one workflow logic but more workflow instances have to run simultaneously. I want to implement the workflow logic by a stateful session bean and I need more running instances of this stateful session bean (SFSB). A message driven bean (MDB) will start the workflows and handles the events (the workflow will exit from waiting if a proper event has happened from outside (MDB) ).
The logic of workflows are the same but they differ in some attributes (for example: country). I try to paint this in text

outside world    -->              facade                    -->  workflow HUN (stateful session bean)
(Java client)            (stateless session bean)
                                                                           --> workflow GB (stateful session bean)

                                                                           --> workflow ...

Something like this. So "the outside world" will start workflows through facade. "The outside world" can tell which sort of workflow it wants to start. After some steps the workflow will wait for an event. If the event will happen (I don't know where or when, this is transparent for my workflow) "the outside world" will notify the facade and the facade must find the right workflow to call its method. As You can see above more workflows (so more stateless session bean) must run simultaneously.
In this case how I could find the right workflow storing the reference? (I thought of storing the references of SFSBs in a Map:


Ok, this might not be a good solution but could You please recommend me a good one?
)

Could You please help me?

Thanks!

V.
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please try to re-implement your solution using the "Service Locator" pattern.
 
Viktor Horváth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Madhan,
thank You for your reply!
But in this case I would store the references of stateful session beans as well, wouldn't I?
V.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. To optimize further, you may add lazy-loading pattern too, to load the service that is required only at a given point of time.
 
Viktor Horváth
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have found a solution but it wasn't very good either... We have cluster environment with 2 managed server (weblogic).
As I know the stateful session bean will work on one of the nodes (and not both). But how will the clients know which node they can use? And how can I set this node at lookup?
It is now a very serious problem for me, I cant see any solution...
Thank You very much!

V.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic