Topic
  • 5 replies
  • Latest Post - ‏2013-03-21T18:30:49Z by MaitreBart
MaitreBart
MaitreBart
84 Posts

Pinned topic Cancel and restart tm()

‏2013-02-19T23:12:46Z |
Hi all,

I have an active state chart where some states have a tm() transition.
I have another process that can change some data in my class, and when that happens, I wish the tm() to be interrupted and the current state restarted right away.

I saw the cancelTimeout(arg) and cancelTimeouts() methods in my class but I'm not sure how to used them and not sure if they do what I just described.

What I did up to now is that when the other process changes my data, I call a trigger method to restart the state right away but it does not appear to be working.

What would you suggest to do?

Also, is there any doc/methods that would let me know in which current state my class is?

Thanks.

Note: I'm using Rhapsody 7.5.1 for C++ developers.
Updated on 2013-03-21T18:30:49Z at 2013-03-21T18:30:49Z by MaitreBart
  • shanz9903
    shanz9903
    315 Posts

    Re: Cancel and restart tm()

    ‏2013-02-20T09:28:01Z  
    Maybe a superstate combined with a history connector?
    Not completely sure though!
  • MaitreBart
    MaitreBart
    84 Posts

    Re: Cancel and restart tm()

    ‏2013-02-22T22:54:46Z  
    Actually I thought calling a transition on the same state did not work, but it appears it does work.
    I was simply not in the right state when I was doing it!

    _______________________________________
    Using Rhapsody 7.5.1 for C++ developers
  • shanz9903
    shanz9903
    315 Posts

    Re: Cancel and restart tm()

    ‏2013-02-25T09:53:22Z  
    As for what state your class is in, I only know about the macro IN_STATE. You'd have to use a switch or if statement with it I suppose.
  • shanz9903
    shanz9903
    315 Posts

    Re: Cancel and restart tm()

    ‏2013-02-25T11:00:30Z  
    • shanz9903
    • ‏2013-02-25T09:53:22Z
    As for what state your class is in, I only know about the macro IN_STATE. You'd have to use a switch or if statement with it I suppose.
    I meant IS_IN
  • MaitreBart
    MaitreBart
    84 Posts

    Re: Cancel and restart tm()

    ‏2013-03-21T18:30:49Z  
    • shanz9903
    • ‏2013-02-25T11:00:30Z
    I meant IS_IN
    Good to know. Thanks.

    _______________________________________
    Using Rhapsody 7.5.1 for C++ developers