Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.1
-
Fix Version/s: 2.0.2
-
Component/s: Modules: Scripting
-
Labels:None
-
User impact:Medium
-
Affects Docs:Yes
-
Migration Impact:The bindings in the script context need to be documented
-
Similar Issues:None
Description
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
fixed in: r11879