Skip to main content

Child relation

2 replies [Last post]
scottjg
Offline
Joined: 2008-08-21

Hi,

I'm thinking about how to work out solution to keep state of service using CMP fields. I composite my service from:
- root sbb,
- child sbb
- external app, which communicates with SBBs using SleeConnection and NullActivity

Root sbb handles service processing when gets specific initial event (Event1) from given activity, create and attache child sbb to that activity, and send information to external application with some sessionId (stored in root sbb, and in child sbb for example using CMP fileds). Now I need to send back information with same sessionId from external app to slee service using SleeConection but I can't send it to child sbb directly because this event (Event2) wouldn't be handled by child sbb entity created before (this child sbb entity has attached activity to further service processing - this from Event1).
I'm thinking about solution where: Event2 is handled by root sbb and using ChildRelation and sbb local interface find sbb child entity which have given sessionId and dispatch Event2 to that child sbb.

And here is a question: when Event2 comes SLEE create new root sbb entity (Event2 is initial event) and when I get ChildRelation in root sbb will I get all child sbb entity created before, or I will get empty collection because SLEE creates a new sbb entity tree with only root sbb entity?

Thanks
scottjg

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eduardomartins
Offline
Joined: 2005-10-10

You will need to use an initial event method for both initial events, and set up the same custom name in the InitialEventSelector object that the method returns, this is the only way that will result in the same sbb entity for that root sbb. All this arises from a problem in the specs, which is the fact that you can't create an ExternalActivityand get its aci from an sbb (this would allow you to attach the sbb to that activity). For more info about the event routing and initial event read section 8.5 (specially 8.5.4) of the JAIN SLEE 1.0 specs.

For an easier solution you can send all state that you are storing in the CMPs to the external component, and make it return that state when firing the event back to SLEE. IF you need to keep track of a specific ACI you can bind a name and pass it to the external component too.

scottjg
Offline
Joined: 2008-08-21

Thanks a lot.
I saw this method before but I admit I didn't read about it. I'm working with ParlayRA and up to now I didn't need it ( I saw that to keep track of transaction or dialog by specific entity people are using this method, but I didn't understad that then). Now I have more control to drive logic of my service properly.

Thanks once again,
scottjg