You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tony Seebregts (JIRA)" <ji...@apache.org> on 2008/04/30 12:23:55 UTC

[jira] Created: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
---------------------------------------------------------------------------

                 Key: SCXML-71
                 URL: https://issues.apache.org/jira/browse/SCXML-71
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.7
         Environment: Java 6
            Reporter: Tony Seebregts
            Priority: Minor


The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 

An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 

For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Updated: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Tony Seebregts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Seebregts updated SCXML-71:
--------------------------------

    Attachment: js-src.zip

> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: js-src.zip
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Commented: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595352#action_12595352 ] 

Rahul Akolkar commented on SCXML-71:
------------------------------------

Thank you for your time, I'll take a look early next week.

Please attach patches, its much easier to incorporate incremental changes that way (the directory structure seems slightly different between SVN and the attached zip). Details on patches:

  http://commons.apache.org/patches.html

Also, the (now renamed) J6 branch, which would be the base for the patch, is here:

  http://svn.apache.org/repos/asf/commons/proper/scxml/branches/J6/


> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: js-src.zip
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Resolved: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Akolkar resolved SCXML-71.
--------------------------------

    Resolution: Fixed

Fixed in the sense that the documentation and test improvments attached have been applied, thanks. There are no functional changes.

Please submit any patches against the latest version of the J6 branch (or trunk, as the case may be).


> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: js-src.zip
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Commented: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594604#action_12594604 ] 

Rahul Akolkar commented on SCXML-71:
------------------------------------

That'd be great, thanks in advance.


> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Commented: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Tony Seebregts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595309#action_12595309 ] 

Tony Seebregts commented on SCXML-71:
-------------------------------------

I've added a (fairly minimal) comment in the JSEvaluator.java javadoc comments and also added a sample to the end of the example-01.xml. 

The attached file has the all the relevant files I found in the J5 branch but the only ones that have changed are:

- JSEvaluator.java (added comment)
- JSExampleTest.java (added MapTest inner class to support the _eventdatamap example)
- example-01.xml (added the maptest example at the bottom)

Hope that all helps :-) 



> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Updated: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Akolkar updated SCXML-71:
-------------------------------

    Fix Version/s: 1.0

> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Commented: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593382#action_12593382 ] 

Rahul Akolkar commented on SCXML-71:
------------------------------------

I think patching the documentation to mention this is a good start.

Two comments about this:

 * The fact that all derived events are processed in one microstep by the engine is subject to change. Pending some clarification from the WG, this may change such that each derived event is processed in its own cycle (at the cost of more cycles). If that happens in some subsequent major release, then the need for using _eventdatamap will disappear altogether.

 * I think we should avoid patches that specifically handle bits for any expression language used. There are going to be idiosyncrasies associated with the usage of each EL that users will have to be aware of and deal with appropriately. We tend to use ELs as-is.


> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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


[jira] Commented: (SCXML-71) Javascript expression evaluator cannot evaluate _eventdatamap['event.name']

Posted by "Tony Seebregts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SCXML-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594589#action_12594589 ] 

Tony Seebregts commented on SCXML-71:
-------------------------------------

Ok, Rahul - that makes lots of sense to me too. I'll update the Javadoc comments and add an example.

> Javascript expression evaluator cannot evaluate _eventdatamap['event.name']
> ---------------------------------------------------------------------------
>
>                 Key: SCXML-71
>                 URL: https://issues.apache.org/jira/browse/SCXML-71
>             Project: Commons SCXML
>          Issue Type: Bug
>    Affects Versions: 0.7
>         Environment: Java 6
>            Reporter: Tony Seebregts
>            Priority: Minor
>             Fix For: 1.0
>
>
> The _eventdatamap is implemented as a Java HashMap - and the Javascript engines (both JDK and JSR223) don't seem to be able to apply the [] operator to a Java Map object. 
> An interim workaround when using the Javascript evaluator is to use _eventdatamap.get('event.name'). 
> For the longer term this anomalous behaviour can either just be documented or a patch that specifically handles _eventdatamap[] can be included in the eval functions

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