Hello,

I have written an application utilizing Apache Commons SCXML and JNI to add a 
state machine to an application written in C++. Each state in my state machine 
executes a custom action that will run a C++ routine.

I need to add traceability to my application so that a history log containing 
what states and triggers were used during the traversal of the state machine 
can be created. The state machine I am using is based off of 
AbstractStateMachine and I am using the following code to get the current 
state's ID:

    public String getCurrentState()
    {
      Set states = getEngine().getCurrentStatus().getStates();
      return ((org.apache.commons.scxml.model.State) states.iterator().
          next()).getId();
    }

I call this Java routine from within the C++ routine executed by the custom 
action of that state. The problem is this: it appears that the returning state 
ID of the routine is always one state "behind" the state in which the custom 
action is run. It appears there is a timing issue.

How would I fix this? Better yet, is there a different approach to this problem 
I should be using?

Thanks,
--
Landon Ouyang
Senior Design Engineer
ITT Electronics Systems, Radar Systems - Gilfillan
7821 Orion Ave,
Van Nuys, CA 91406
(818) 901-2982


________________________________
This e-mail and any files transmitted with it may be proprietary and are 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of ITT Corporation. 
The recipient should check this e-mail and any attachments for the presence of 
viruses. ITT accepts no liability for any damage caused by any virus 
transmitted by this e-mail.

Reply via email to