It is currently Mon Feb 06, 2012 2:24 am

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 6 posts ] 
Author Message
 Post subject: "cathc all" for events?
PostPosted: Thu Feb 04, 2010 12:07 pm 

Joined: Thu Feb 04, 2010 12:00 pm
Posts: 44
Not sure I'm able to describe what I want in words, but will try.

I have a statechart with two states stateA and stateB. I have two events, evGotoA and evGotoB that will let me transition between the states.

So if I'm in stateA and generate the evGotoB state I will transiton to stateB. evGotoA will then take me back to stateA.

Now, if I'm in stateA and generate evGotoA nothing will happen and the event will be consumed "behind the scenes".

Is there a way to catch this event and say do a printout when it was not consumed by my statechart? Naturaly I could do things like a super state and use reaction in state, or I can handle it in stateA, but if I have lots of states and lots of events this becomes "cumbersome". I looking for a generic way of doing this.

Is there a way to do this?


Offline
 Profile  
 
 Post subject: Re: "cathc all" for events?
PostPosted: Thu Feb 04, 2010 4:14 pm 

Joined: Wed May 07, 2008 3:50 pm
Posts: 147
Location: Horsham, W Sussex, England
Override the handleEvent method on every reactive class in order to catch unhandled events
In C++ this is found in OMReactive.h/.cpp known as handleEventNotConsumed()


Offline
 Profile  
 
 Post subject: Re: "cathc all" for events?
PostPosted: Fri Feb 05, 2010 8:59 am 

Joined: Thu Feb 04, 2010 12:00 pm
Posts: 44
shanz wrote:
Override the handleEvent method on every reactive class in order to catch unhandled events
In C++ this is found in OMReactive.h/.cpp known as handleEventNotConsumed()


Thanks,

This would have to be done in the oxf framework then? That would give me a generic override for everyone. Is there a awy to do an individual override for only the classes where I want it? I can foresee several different uses for this so can't make one that works for all.


Offline
 Profile  
 
 Post subject: Re: "cathc all" for events?
PostPosted: Fri Feb 05, 2010 10:38 am 

Joined: Wed May 07, 2008 3:50 pm
Posts: 147
Location: Horsham, W Sussex, England
No, you can choose to override or not on a class by class basis.
I only mentioned the oxf so you'd know its signature to help you override it.
http://publib.boulder.ibm.com/infocenter/rhaphlp/v7r5/topic/com.ibm.rhapsody.reference.doc/topics/rhp_r_fw_handle_event_not_consume.html?resultof=%22%68%61%6e%64%6c%65%45%76%65%6e%74%4e%6f%74%43%6f%6e%73%75%6d%65%64%22%20%22%68%61%6e%64%6c%65%65%76%65%6e%74%6e%6f%74%63%6f%6e%73%75%6d%22%20


Offline
 Profile  
 
 Post subject: Re: "cathc all" for events?
PostPosted: Fri Feb 05, 2010 12:10 pm 

Joined: Thu Feb 04, 2010 12:00 pm
Posts: 44
shanz wrote:


Gotcha!

Thanks, looks to be exactly what I need.


Offline
 Profile  
 
 Post subject: Re: "cathc all" for events?
PostPosted: Thu Sep 16, 2010 9:30 pm 

Joined: Wed Oct 31, 2007 3:09 pm
Posts: 58
Location: Milkyway, classic 9-planet solar system
shanz wrote:


Just more or less accidently I stumbled into this thread... and saw, that there seems to be some deprecated information/documentation regarding the oxf.

The v5 compatibility mode for oxf has been discontinued with v7.5 (support endend in v7.4.x).
OMReactive's (backward compatibility) operations like handleEventNotConsumed() and
handleTONotConsumed() have been removed... a new operation handleNotConsumed()
(now dealing with both, asynchronous events and triggered operations) has been introduced
with Rhapsody v6.0

Other examples for deprecated operations are:
v5 compatibility -> new v6/v7 API
getThread() -> getActiveContext()
setThread() -> setActiveContext()
gen() -> send()
takeEvent() -> handleEvent()
takeTrigger() -> handleTrigger()
popNullConfig() -> popNullTransition()
pushNullConfig() -> pushNullTransition()
rootState_dispatchEvent() -> rootState_processEvent()
...
Interestingly some operations are documented correctly and match with
both the framework model in <RhpInstDir>\Share\LangCpp\oxf\model\oxf.rpy
and the generated code in <RhpInstDir>\Share\LangCpp\oxf

Fortunately the Rhapsody code generator knows, which signatures
to use... 8) :lol:

-Luke



_________________
May the force be with you ...
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:


suspicion-preferred