complexType "scriptType"
Namespace: |
|
Content: |
|
Defined: |
|
Includes: |
|
Used: |
|
Content Model Diagram
Content Model Elements (4):
-
All Direct / Indirect Based Elements (2):
-
Known Usage Locations
Annotation
The script to execute as a service. When run inside Mule, scripts have a number of objects available to them in the script context. These are:
{html}
<table>
<tr>
<td>log</td>
<td>a logger that can be used to write to Mule's log file.</td>
</tr>
<tr>
<td>muleContext</td>
<td>a reference to the MuleContext object.</td>
</tr>
<tr>
<td>message</td>
<td>the current message.</td>
</tr>
<tr>
<td>originalPayload</td>
<td>the payload of the current message before any transforms.</td>
</tr>
<tr>
<td>payload</td>
<td>the transformed payload of the current message if a transformer is
configured on the service. Otherwise this is the same value as
_originalPayload_.
</td>
</tr>
<tr>
<td>service</td>
<td>a reference to the current service object.</td>
</tr>
<tr>
<td>id</td>
<td>the current event id.</td>
</tr>
<tr>
<td>result</td>
<td>a placeholder object where the result of the script can be written.
Usually it's better to just return a value from the script unless the script
method doesn't have a return value.
</td>
</tr>
</table>
{html}
Type Definition Detail
Type Derivation Tree scriptType |
XML Source (w/o annotations (5); see within schema source)
<xsd:complexType name="scriptType"> <xsd:complexContent mixed="true"> <xsd:sequence> <xsd:element minOccurs="0" name="text" type="xsd:string"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="engine" type="xsd:string"/> <xsd:attribute name="file" type="xsd:string"/> </xsd:extension> </xsd:complexContent> </xsd:complexType> |
Attribute Detail (all declarations; defined within this component only; 3/4)
engine-
Type: |
xsd:string, predefined |
Use: |
optional |
The name of the script engine being used. All scripting languages that support JSR-223 have a script engine name such as groovy, ruby, python, etc. If this value is not set, but a script file is configured, Mule will attempt to load the correct script engine according to the script file's extension.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="engine" type="xsd:string"/> |
file-
Type: |
xsd:string, predefined |
Use: |
optional |
The script file to load for this object. The file can be on the classpath or local file system.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="file" type="xsd:string"/> |
name-
Type: |
xsd:string, predefined |
Use: |
optional |
The name used to identify this script object. This is used when you want to reference this script object from a component or transformer.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="name" type="xsd:string"/> |
Content Element Detail (all declarations; defined within this component only; 1/4) -
Type: |
xsd:string, predefined, simple content |
Used for embedding script code inside the XML. This is useful for simple scripts where you are just mocking up a quick application.
XML Source (w/o annotations (1); see within schema source)
<xsd:element minOccurs="0" name="text" type="xsd:string"/> |