Issue Details (XML | Word | Printable)

Key: MULE-3422
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ross Mason
Reporter: Ross Mason
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Mule

Bindings on the script component are not well defined

Created: 01/Jun/08 03:43 PM   Updated: 02/Jun/08 05:53 AM
Component/s: Modules: JSR-223 Scripting
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Time Tracking:
Not Specified

Labels:
User impact: Medium
Affects Docs: Yes
Migration Impact: The bindings in the script context need to be documented
Similar Issues: MULE-3319 Implement script component bindings using expressions
MULE-3455 Groovy script component could support component bindings
MULE-4135 Nested routers / bindings do not correctly handle NullPayload


 Description  « Hide
Right now you get different bindings depending on who calls the script. Some times the $message binding is the payload and sometimes its the MuleMessage instance. Not good. I suggest the following bindings:

$muleContext MuleContext
$eventContext MuleEventContext
$message MuleMessage
$log Logger

if MuleMessage is passed in
$payload MuleMessage.getPayload
otherwise
$originalPayload MuleEvent.getMessage.getPayload
$payload MuleEvent.transformMessage()

(all message headers get added to the context too)

For backward compatability:
$src = $payload



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Ross Mason added a comment - 02/Jun/08 05:53 AM
fixed in: r11879