Schema "mule-scripting.xsd"
Target Namespace:
http://www.mulesoft.org/schema/mule/scripting
Defined Components:
global elements, 5 local elements, 6 complexTypes
Default Namespace-Qualified Form:
Local Elements: qualified; Local Attributes: unqualified
Schema Location:
http://www.mulesoft.org/schema/mule/scripting/3.3/mule-scripting.xsd; see XML source
Imports Schemas (2):
mule.xsd [src], xml.xsd [src]
Imported by Schema:
_mule-all-included.xsd
Annotation
The scripting module provides facilities for using scripting languages in Mule. Any scripting languages that supports [JSR-223|http://www.jcp.org/en/jsr/detail?id=223] can be used inside Mule. Scripts can be used as implementations of service components or transformers. Also, scripts can be used for expression evaluations, meaning message routing can be controlled using script evaluations on the current message. You can even configure Mule instances from scripts.
All Element Summary
component Defines a script component backed by a JSR-223 compliant script engine such as Groovy, JavaScript, or Ruby.
Type:
Content:
complex, 1 attribute, attr. wildcard, 5 elements
Subst.Gr:
Defined:
globally; see XML source
Used:
never
filter Runs a script to perform filter on the current message.
Type:
Content:
complex, 1 attribute, attr. wildcard, 2 elements
Subst.Gr:
Defined:
globally; see XML source
Used:
never
groovy-refreshable A wrapper for a component object that allows the underlying object to be reloaded at runtime.
Type:
Content:
complex, 3 attributes, attr. wildcard, 1 element
Subst.Gr:
may substitute for element mule:abstract-extension
Defined:
globally; see XML source
Used:
never
java-interface-binding A binding associates a Mule endpoint with an injected Java interface (this is like using Spring to inject a bean, but instead of calling a method on the bean a message is sent to an endpoint).
Type:
Content:
complex, 2 attributes, 1 element
Defined:
locally witnin scriptComponentType complexType; see XML source
lang This element allows the http://www.springframework.org/schema/lang namespace to be embedded.
Type:
Content:
mixed (allows character data), attr. wildcard, 1 element, elem. wildcard
Subst.Gr:
may substitute for element mule:abstract-mixed-content-extension
Defined:
globally; see XML source
Used:
never
script Represents a script that can be used as a component for a service or a transformer.
Type:
Content:
mixed (allows character data), 3 attributes, attr. wildcard, 4 elements
Subst.Gr:
may substitute for element mule:abstract-mixed-content-extension
Defined:
globally; see XML source
Used:
never
script (type scriptType)
Type:
Content:
mixed (allows character data), 3 attributes, attr. wildcard, 4 elements
Defined:
locally at 3 locations
text Used for embedding script code inside the XML.
Type:
xsd:string
Content:
simple
Defined:
locally witnin scriptType complexType; see XML source
transformer Runs a script to perform transformation on the current message.
Type:
Content:
complex, 5 attributes, attr. wildcard, 2 elements
Subst.Gr:
Defined:
globally; see XML source
Used:
never
Complex Type Summary
Content:
complex, 3 attributes, attr. wildcard, 1 element
Defined:
globally; see XML source
Includes:
definitions of 3 attributes
Used:
Content:
mixed (allows character data), attr. wildcard, 1 element, elem. wildcard
Defined:
globally; see XML source
Includes:
definition of elem. wildcard
Used:
Content:
complex, 1 attribute, attr. wildcard, 5 elements
Defined:
globally; see XML source
Includes:
definitions of 1 attribute, 2 elements
Used:
Content:
complex, 1 attribute, attr. wildcard, 2 elements
Defined:
globally; see XML source
Includes:
definition of 1 element
Used:
Content:
complex, 5 attributes, attr. wildcard, 2 elements
Defined:
globally; see XML source
Includes:
definition of 1 element
Used:
The script to execute as a service.
Content:
mixed (allows character data), 3 attributes, attr. wildcard, 4 elements
Defined:
globally; see XML source
Includes:
definitions of 3 attributes, 1 element
Used:
XML Source
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.mulesoft.org/schema/mule/scripting" xmlns="http://www.mulesoft.org/schema/mule/scripting" xmlns:mule="http://www.mulesoft.org/schema/mule/core" xmlns:schemadoc="http://www.mulesoft.org/schema/mule/schemadoc" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:annotation>
<xsd:documentation>
The scripting module provides facilities for using scripting languages in Mule. Any scripting languages that supports [JSR-223|http://www.jcp.org/en/jsr/detail?id=223] can be used inside Mule. Scripts can be used as implementations of service components or transformers. Also, scripts can be used for expression evaluations, meaning message routing can be controlled using script evaluations on the current message. You can even configure Mule instances from scripts.
</xsd:documentation>
<xsd:appinfo>
<schemadoc:short-name>Scripting</schemadoc:short-name>
<schemadoc:page-title>Scripting Module</schemadoc:page-title>
<schemadoc:additional-documentation where="after-common-elements">
h2. Script Context Bindings

When run inside Mule, scripts have a number of objects available to them in the script context. These are:

||Name||Description||
|log|a logger that can be used to write to Mule's log file.|
|muleContext|a reference to the MuleContext object.|
|eventContext| A reference to the eventcontext. This allows you to dispatch events progammatically from your script|
|message|the current message.|
|originalPayload|the payload of the current message before any transforms.|
|payload|the transformed payload of the current message if a transformer is configured on the service. Otherwise this is the same value as _originalPayload_.|
|src|same as _payload_, kept for backward compatability.|
|service|a reference to the current service object.|
|id|the current event id.|
|result|a placeholder object where the result of the script can be written to. Usually it's better to just return a value from the script unless the script method doesn't have a return value.|
</schemadoc:additional-documentation>
<schemadoc:additional-documentation where="after-specific-elements">
h2. Script Configuration Builder

The {javadoc:mule/module/scripting/builders|ScriptConfigurationBuilder}ScriptConfigurationBuilder{javadoc} allows developers to create a Mule instance from a JSR-223 compliant script. To load the manager from Groovy:

{code:java}
ConfigurationBuilder builder = new ScriptConfigurationBuilder("groovy", "../conf/mule-config.groovy");
MuleContext muleContext = new DefaultMuleContextFactory().createMuleContext(builder);
{code}

Or to start the server from the command line:
{code}
mule -M-Dorg.mule.script.engine=groovy
-builder org.mule.module.scripting.builders.ScriptConfigurationBuilder
-config ../conf/mule-config.groovy
{code}

For more information about configuring a Mule instance from code or script see [Configuration Overview].
</schemadoc:additional-documentation>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="component" substitutionGroup="mule:abstract-component" type="scriptComponentType">
<xsd:annotation>
<xsd:documentation>
Defines a script component backed by a JSR-223 compliant script engine such as Groovy, JavaScript, or Ruby. Scripting allows you to either directly embed your script inside the XML config or reference a script using Spring's dynamic language support: http://static.springframework.org/spring/docs/2.5.x/reference/dynamic-language.html.
</xsd:documentation>
<xsd:appinfo>
<schemadoc:snippet id="component-example" lang="xml" sourcePath="modules/scripting/src/test/resources/groovy-component-config.xml">
This example demonstrates how to configure a Groovy Script component with an in-line script.
</schemadoc:snippet>
<schemadoc:snippet id="binding-config" lang="xml" sourcePath="modules/scripting/src/test/resources/groovy-binding-config.xml">
This example demonstrates how to orchestrate message flows using bindings. The example calls out to two different services and passes the results on to the outbound router.
</schemadoc:snippet>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="scriptComponentType">
<xsd:complexContent>
<xsd:extension base="mule:abstractComponentType">
<xsd:sequence>
<xsd:element minOccurs="0" name="script" type="scriptType">
<xsd:annotation>
<xsd:documentation>
A script to be executed by a JSR-223 compliant script engine such as Groovy, JavaScript(Rhino), Python, Ruby, or Beanshell.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="java-interface-binding" type="mule:pojoBindingType">
<xsd:annotation>
<xsd:documentation>
A binding associates a Mule endpoint with an injected Java interface (this is like using Spring to inject a bean, but instead of calling a method on the bean a message is sent to an endpoint). Script bindings will only work with Java-based scripting languages. Right now there is no validation on when languages support Java bindinngs because there are so many scripting languages.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="script-ref" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
A reference to a script object bean, that is, a {{&lt;script:script ...&gt;}} definition.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="script" substitutionGroup="mule:abstract-mixed-content-extension" type="scriptType">
<xsd:annotation>
<xsd:documentation>
Represents a script that can be used as a component for a service or a transformer. The script text can be pulled in from a script file or can be embedded inside this element. A script can be executed by any JSR-223 compliant script engine such as Groovy, JavaScript(Rhino), Python, Ruby, or Beanshell.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="scriptType">
<xsd:annotation>
<xsd:documentation>
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}
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent mixed="true">
<xsd:sequence>
<xsd:group minOccurs="0" ref="mule:propertiesGroup"/>
<xsd:element minOccurs="0" name="text" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Used for embedding script code inside the XML. This is useful for simple scripts where you are just mocking up a quick application.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The name used to identify this script object. This is used when you want to reference this script object from a component or transformer.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="engine" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
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.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="file" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The script file to load for this object. The file can be on the classpath or local file system.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="transformer" substitutionGroup="mule:abstract-transformer" type="scriptTransformerType">
<xsd:annotation>
<xsd:documentation>
Runs a script to perform transformation on the current message.
</xsd:documentation>
<xsd:appinfo>
<schemadoc:snippet id="transformer-config" lang="xml" sourcePath="modules/scripting/src/test/resources/groovy-transformer-config.xml"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="scriptTransformerType">
<xsd:complexContent>
<xsd:extension base="mule:abstractTransformerType">
<xsd:sequence>
<xsd:element name="script" type="scriptType">
<xsd:annotation>
<xsd:documentation>
A script to be executed by a JSR-223 compliant script engine such as Groovy, JavaScript(Rhino), Python, Ruby, or Beanshell.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="filter" substitutionGroup="mule:abstract-filter" type="scriptFilterType">
<xsd:annotation>
<xsd:documentation>
Runs a script to perform filter on the current message.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="scriptFilterType">
<xsd:complexContent>
<xsd:extension base="mule:abstractFilterType">
<xsd:sequence>
<xsd:element name="script" type="scriptType">
<xsd:annotation>
<xsd:documentation>
A script to be executed by a JSR-223 compliant script engine such as Groovy, JavaScript(Rhino), Python, Ruby, or Beanshell.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="groovy-refreshable" substitutionGroup="mule:abstract-extension" type="groovyRefreshableType">
<xsd:annotation>
<xsd:documentation>
A wrapper for a component object that allows the underlying object to be reloaded at runtime. This makes it possible to hot-deploy new component logic without restarting.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="groovyRefreshableType">
<xsd:complexContent>
<xsd:extension base="mule:abstractExtensionType">
<xsd:attribute name="name" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>
The name for this refreshable groovy bean wrapper.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="refreshableBean-ref" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The reference to a {{groovy.lang.Groovy}} object to use for this component.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="methodName" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The entrypoint method to invoke when a message is received for the object.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="lang" substitutionGroup="mule:abstract-mixed-content-extension" type="langType">
<xsd:annotation>
<xsd:documentation>
This element allows the http://www.springframework.org/schema/lang namespace to be embedded. Within this element developers can include the Spring {{lang}} namespace.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="langType">
<xsd:complexContent mixed="true">
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="http://www.springframework.org/schema/lang namespace" processContents="strict"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

XML schema documentation generated with DocFlex/XML RE 1.8.5 using DocFlex/XML XSDDoc 2.5.0 template set. All content model diagrams generated by Altova XMLSpy via DocFlex/XML XMLSpy Integration.