commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Loïc Quéran (JIRA) <j...@apache.org>
Subject [jira] Commented: (SCXML-108) Add <script> and EcmaScript + E4X support
Date Wed, 23 Sep 2009 14:11:16 GMT

    [ https://issues.apache.org/jira/browse/SCXML-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758710#action_12758710
] 

Loïc Quéran commented on SCXML-108:
-----------------------------------

More details on my previous comment:

In oacs.io.SCXMLSerializer.serializeActions(final StringBuffer b, final List<Action>
l, final String indent), oacs.model.Scripts are not taken into account even in J6 branch.

Am I misunderstanding something ?

What is more, http://www.w3.org/TR/scxml/#script-module states (sic) that to support the script
module, one must "Redefine the <scxml> element to allow <script> as a child."
This is not possible, as <onentry> is not possible child of <scxml> (which it
should even without the script module). Please, see no criticism here.


The following does not execute properly:
<?xml version="1.0"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
       version="1.0"
       initial="script">
       
       <!-- Should work, but neither script not onentry is supported here. SCXMLReader
does not read them. -->
    <script>
	function Hello(s) {
	    // Private variable
	     var what = String(s);
	
            // Public method
            this.say = function() {
                return "Hello " + what + "!\n";
	    };
	}
    </script>

    <datamodel>
        <data id="s" expr="'Bonjour tout le monde !\n'"/>
    </datamodel>

    <state id="script">
        <onentry>
            <script>
            	hello_world = new Hello("world");
		s = hello_world.say();
            </script>
        </onentry>
        <transition target="end" cond="s =='Hello world!\n'"/>
    </state>

    <final id="end"/>

</scxml>

 The only workaround I've found is to add a state with onentry script that defines "script"
state as a sub state.

> Add <script> and EcmaScript + E4X support
> -----------------------------------------
>
>                 Key: SCXML-108
>                 URL: https://issues.apache.org/jira/browse/SCXML-108
>             Project: Commons SCXML
>          Issue Type: New Feature
>    Affects Versions: 0.9
>            Reporter: Ingmar Kliche
>             Fix For: 1.0
>
>         Attachments: 090501_oacs_script_and_rhino.patch.txt
>
>
> I propose to add <script> support and an EcmaScript evaluator which supports E4X.
I will provide a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message