You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Azraiyl <az...@gmail.com> on 2010/09/04 18:40:30 UTC

[scxml] update datamodel

Hello,

I've a simple state machine

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
name="Fan2" initial="Off" exmode="strict">
	<datamodel>
		<data id="T" expr="10"/>
	</datamodel>
	<state id="Off">
		<onentry>
			<log expr="'OnEntry Off'"/>
		</onentry>
		<transition cond="T &gt; 30" target="On"/>
		<onexit>
			<log expr="'OnExit Off'"/>
		</onexit>
	</state>
	<state id="On">
		<onentry>
			<log expr="'OnEntry On'"/>
		</onentry>
		<transition cond="T &lt; 20" target="Off"/>
		<onexit>
			<log expr="'OnExit On'"/>
		</onexit>
	</state>
</scxml>

and like to update T through Java. I tried this:

fan2.getEngine().getRootContext().set("T", "40");

but somehow the engine does not switch into the new state. Do I have
to manually trigger the engine to reevaluate all expression or what
I'am missing?

Thanks in advance for any hint

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [scxml] update datamodel

Posted by Azraiyl <az...@gmail.com>.
Sorry for double post (first posted, then registered and didn't get any reply)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [scxml] update datamodel

Posted by Rahul Akolkar <ra...@gmail.com>.
On Sat, Sep 4, 2010 at 12:40 PM, Azraiyl <az...@gmail.com> wrote:
> Hello,
>
> I've a simple state machine
>
> <?xml version="1.0" encoding="UTF-8"?>
> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
> name="Fan2" initial="Off" exmode="strict">
>        <datamodel>
>                <data id="T" expr="10"/>
>        </datamodel>
>        <state id="Off">
>                <onentry>
>                        <log expr="'OnEntry Off'"/>
>                </onentry>
>                <transition cond="T &gt; 30" target="On"/>
>                <onexit>
>                        <log expr="'OnExit Off'"/>
>                </onexit>
>        </state>
>        <state id="On">
>                <onentry>
>                        <log expr="'OnEntry On'"/>
>                </onentry>
>                <transition cond="T &lt; 20" target="Off"/>
>                <onexit>
>                        <log expr="'OnExit On'"/>
>                </onexit>
>        </state>
> </scxml>
>
> and like to update T through Java. I tried this:
>
> fan2.getEngine().getRootContext().set("T", "40");
>
> but somehow the engine does not switch into the new state. Do I have
> to manually trigger the engine to reevaluate all expression or what
> I'am missing?
>
<snip/>

Yes (this looks like a duplicate post, more in previous reponse linked below):

  http://markmail.org/message/purvcoyinluuwubo

-Rahul


> Thanks in advance for any hint
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org