[switchyard-issues] [JBoss JIRA] (SWITCHYARD-769) Simplify context access in mapping expressions

David Ward (JIRA) jira-events at lists.jboss.org
Mon May 14 13:10:17 EDT 2012


David Ward created SWITCHYARD-769:
-------------------------------------

             Summary: Simplify context access in mapping expressions
                 Key: SWITCHYARD-769
                 URL: https://issues.jboss.org/browse/SWITCHYARD-769
             Project: SwitchYard
          Issue Type: Enhancement
          Components: component-rules
    Affects Versions: 0.5
            Reporter: David Ward
            Assignee: David Ward
            Priority: Minor
             Fix For: 0.5


The work done in SWITCHYARD-714 included the ability to use MVEL expressions to set rules and bpm variables. Inside the expressions, pre-set variables were called exchange, message and context, as well as context_in (same as context), context_out and context_exchange. These last names were there so that map access to the context from an expression would know which Scope to use. This is confusing and messy.

Instead, context_in, context_out and context_exchange should all be removed, and just leave context, message and exchange.  Map access to the context in an mvel expression should default to Scope.IN, but add an additional attribute to override that to Scope.OUT or Scope.EXCHANGE.  See "contextScope" below:

<mapping expression="context['foobar']" variable="foobar"/>
same as
<mapping expression="context['foobar']" variable="foobar" contextScope="IN"/>
same as
@Mapping(expression="context['foobar']", variable="foobar")
same as
@Mapping(expression="context['foobar']", variable="foobar", contextScope=Scope.IN)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the switchyard-issues mailing list