Woonsan Ko created SCXML-181:
--------------------------------

             Summary: Provide SCXML source location info when logging warnings 
or errors
                 Key: SCXML-181
                 URL: https://issues.apache.org/jira/browse/SCXML-181
             Project: Commons SCXML
          Issue Type: Improvement
            Reporter: Woonsan Ko


Currently, SCXML model objects do not have source location information for 
debugging purpose.
For this reason, if there's any error (e.g, JEXL script error), then we get the 
following log:

EXPRESSION_ERROR (evalScript('
unknownObject.invoke();
'):org.apache.commons.scxml2.env.jexl.JexlEvaluator.evalScript@161![14,22]: 
'unknownObject.invoke();' attempting to call method on null): Expression error 
inside /hello/world

The reason is that SCXML JexlEvaluator doesn't give a source location 
information to the JexlEngine for itself and so JEXL engine just tries to make 
a debugging information by itself (by finding the caller class (JexlEvaluator 
in this case) and its line number (161) as well as more debugging purpose 
parsed JEXL node information ([14,22])).

In order to give a precise source location information of SCXML, we have to 
provide that kind of information in commons-scxml when invoking JEXL Engine.
For example, JexlEvaluator#evalScript() invokes 
getJexlEngine().createScript(script) currently.
If we want to give source location info, then we'd better change it to 
getJexlEngine().createScript(script, JexlInfo, null), where JexlInfo contains 
the debugging information.
However, the current SCXML model objects do not have source location 
information at all unfortunately.
It can be a good improvement to add that kind of information in SCXML model 
objects in the future.




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to