commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] Log output?
Date Tue, 24 Mar 2009 22:53:13 GMT
On Tue, Mar 24, 2009 at 7:49 AM, Anna Södling <> wrote:
> Hi,
> I want to use some logging in my scxml-file, for example upon entering
> and exiting a state. Unfortunately, I can't seem to get the hang of how
> it works. I've got this line in my scxml-file:
> <log label="'Renegade'" expr="'Entering state: A'"/>
> And the log output I get (in a console window in Eclipse) looks like
> this:
> 2009-mar-24 11:39:08 org.apache.comm
> ons.scxml.model.Log execute
> INFO: 'Renegade': Entering state: A
> 2009-mar-24 11:39:08 org.apache.commons.scxml.model.Log execute
> INFO: 'Renegade': Entering state: A

That seems OK to me (other than the fact it appeared twice, probably a
cut-n-paste error?).

> Also, I'm doing some ordinary printed outputs (in Java) while I'm
> running my state machine, and the log info is not placed on the right
> place among these outputs either, but before all of them (so it doesn't
> show up when I'm actually entering the state).
> And that's not really what I wanted. I would simply like to have an
> output that says "'Renegade': Entering state: A" (or something similar)
> when I'm actually entering state A. Is this possible? Or have I
> missunderstood how the <log>-tag works?

Please say more about the Java code which contains these print
statements. Are you using an AbstractStateMachine subclass, an
SCXMLListener or something else? (<onentry> content in the SCXML
document executes before code in both those specific cases).

If you want more fine-grained control about the timing of your
procedural code within state changes (or sequencing even within a
particular <onentry> or <onexit>), that kind of thing can be achieved
by using custom actions [1] to call your code from the appropriate
place(s) in SCXML executable content.



> Sincerely,
> Anna

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message