You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Hallvard Trætteberg (JIRA)" <ji...@apache.org> on 2006/10/02 22:28:20 UTC

[jira] Commented: (SCXML-26) Add parameter to Evaluator.newContext

    [ http://issues.apache.org/jira/browse/SCXML-26?page=comments#action_12439305 ] 
            
Hallvard Trætteberg commented on SCXML-26:
------------------------------------------

I understand that there is a 1:1 mapping between context and targets. The problem is that this mapping is established by the caller of the newContext method, and there is no way the Evaluator implementation or other code can get hold of the context for a specific target, or the target for a specific context. This may be needed for ensuring scripts/expressions from outside SCXML are evaluated in the same contexts as SCXML's.

In my case, I generate the SCXML structures from a diagram language, which also includes other elements with script/expression code. The scripting language is used elsewhere, and it's vital that all expressions are evaluated in the correct context. Since it is SCXML that generates the contexts, I either need to be able to 1) query SCXML for the context for a specific target (and have it be created if necessary), or 2) provide the extra argument to the Evaluator, so it can keep track of the mapping itself. The reason for wanting the second solution, is that the Evaluator might need the target to correctly configure the context, e.g. initialise the bindings so the script may navigate to contextual objects, like the target itself. I know this is not needed by SCXML itself, but I see no reason for preventing it, as SCXML should not limit other parts that may include SCXML (in general, SCXML should not assume it is used on isolation, e.g. by being read from a file, but work well in a broader context).

> Add parameter to Evaluator.newContext
> -------------------------------------
>
>                 Key: SCXML-26
>                 URL: http://issues.apache.org/jira/browse/SCXML-26
>             Project: Commons SCXML
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Hallvard Trætteberg
>             Fix For: 1.0
>
>
> The Evaluator.newContext method currently takes one argument, the parent context. However, to make it easier for the context to link to relevant application data, it would be nice if it also took a TransitionTarget argument, i.e. have the signature     public Context newContext(TransitionTarget target, Context parent); By including the target in the context, it becomes easier for expressions to refer to contextual data. In my case, SCXML is used together with data bindings, and expressions are used to refer to data in the context of states and transitions. I had to modify SCXML as suggested above, to provide the link between state and data bindings.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

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