You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by SG...@osc.state.ny.us on 2012/06/14 23:23:26 UTC

[scxml] JEXL Evaluator's evalCond issue

1. Problem renaming method in class used for condition evaluation. 

Class: Test 
method: boolean method1(integer i) 

xml snippet: 

<state id="DELETE_STATE"> 
            <transition event="delete" target="STATUS_UNKNOWN" 
cond="test.method1(100)"/> 
</state> 


We are trying rename test.method1(integer i) in Test class to 
test.methodRenamed(integer i) 

and update xml to: 

<state id="DELETE_STATE"> 
            <transition event="delete" target="STATUS_UNKNOWN" 
cond="test.methodRenamed(100)"/> 
</state> 

Executing SCXML after the above change, test.methodRenamed(100) is not 
invoked and no information in logs are seen nor any exception seen in the 
trace. 

Note: Putting back to the old method name (test.method1(100)) works as 
expected. 


2. Problem adding a new method (test.methodNew(200)). 

Class: Test 
methods: boolean method1(Integer i) 
                  boolean methodNew(Integer i) 

<transition event="delete" target="STATUS_UNKNOWN" cond="test.method1(100) 
&amp;&amp; test.methodNew(200)"/> 


Executing SCXML: 

1. test.method1(100) was invoked and returned true. 

2. test.methodNew(200) was never invoked 

3. JexlEvaluator's method "evalCond" line 
exp.evaluate(getEffectiveContext(jexlCtx)) returns false. 

Note: Adding a non existent method or junk string to the xml's cond 
attribute doesn't yield any failure information and JexlEvaluator simply 
returns false . 

Versions used: commons-scxml-0.9.jar, commons-jexl.1.1.jar 

The issue seems to be a JEXL issue, however upgrading to the latest JEXL 2 
version is not feasible due to compilation issues. 

Is there/will there be a version of SCXML that is compatible with a later 
version of JEXCL? (ie: JEXL2) 


Thanks & Regards
Satish Gutta



Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: [scxml] JEXL Evaluator's evalCond issue

Posted by Rahul Akolkar <ra...@gmail.com>.
On Thu, Jun 14, 2012 at 5:23 PM,  <SG...@osc.state.ny.us> wrote:
> 1. Problem renaming method in class used for condition evaluation.
>
> Class: Test
> method: boolean method1(integer i)
>
> xml snippet:
>
> <state id="DELETE_STATE">
>            <transition event="delete" target="STATUS_UNKNOWN"
> cond="test.method1(100)"/>
> </state>
>
>
> We are trying rename test.method1(integer i) in Test class to
> test.methodRenamed(integer i)
>
> and update xml to:
>
> <state id="DELETE_STATE">
>            <transition event="delete" target="STATUS_UNKNOWN"
> cond="test.methodRenamed(100)"/>
> </state>
>
> Executing SCXML after the above change, test.methodRenamed(100) is not
> invoked and no information in logs are seen nor any exception seen in the
> trace.
>
> Note: Putting back to the old method name (test.method1(100)) works as
> expected.
>
<snip/>

It isn't clear how you are testing the changes once you update the
Test class. From the description, it doesn't look like the new Test
class is loaded. I don't think this is related to Commons SCXML (i.e.
the library code).


>
> 2. Problem adding a new method (test.methodNew(200)).
>
> Class: Test
> methods: boolean method1(Integer i)
>                  boolean methodNew(Integer i)
>
> <transition event="delete" target="STATUS_UNKNOWN" cond="test.method1(100)
> &amp;&amp; test.methodNew(200)"/>
>
>
> Executing SCXML:
>
> 1. test.method1(100) was invoked and returned true.
>
> 2. test.methodNew(200) was never invoked
>
> 3. JexlEvaluator's method "evalCond" line
> exp.evaluate(getEffectiveContext(jexlCtx)) returns false.
>
> Note: Adding a non existent method or junk string to the xml's cond
> attribute doesn't yield any failure information and JexlEvaluator simply
> returns false .
>
<snap/>

Same comment as above. Additionally, boolean expressions are assumed
to be false unless they successfully evaluate to true.


> Versions used: commons-scxml-0.9.jar, commons-jexl.1.1.jar
>
> The issue seems to be a JEXL issue, however upgrading to the latest JEXL 2
> version is not feasible due to compilation issues.
>
> Is there/will there be a version of SCXML that is compatible with a later
> version of JEXCL? (ie: JEXL2)
>
<snip/>

You can try the Evaluator implementation attached here [1] (which is
not released code) or provide your own evaluator implementation [2]
for this.

-Rahul

[1] https://issues.apache.org/jira/browse/SCXML-114
[2] http://commons.apache.org/scxml/guide/contexts-evaluators.html


>
> Thanks & Regards
> Satish Gutta
>
>
>
> Notice: This communication, including any attachments, is intended solely
> for the use of the individual or entity to which it is addressed. This
> communication may contain information that is protected from disclosure
> under State and/or Federal law. Please notify the sender immediately if
> you have received this communication in error and delete this email from
> your system. If you are not the intended recipient, you are requested not
> to disclose, copy, distribute or take any action in reliance on the
> contents of this information.

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