|
||
<?xml version="1.0" encoding="utf-8"?>
<!--
Workflow.xsd
Copyright (C) 2009-2010, Ad Astra Information Systems, LLC.
All Rights Reserved
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="Astra74.Script"
xmlns="Astra74.Script"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:scr="Astra74.Script"
xmlns:ty="Astra74.CommonTypes">
<xs:import namespace="Astra74.CommonTypes"/>
<xs:complexType name="NamedElement">
<xs:annotation>
<xs:documentation>
This type is the base for all named elements.
</xs:documentation>
</xs:annotation>
<xs:attribute name="name" use="required" type="ty:Identifier">
<xs:annotation>
<xs:documentation>
The programmatic identifier of the element.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="IfUnlessNode">
<xs:annotation>
<xs:documentation>
This type is a base for nodes with "if" and "unless" attributes.
</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="ty:IfUnlessAttrs"/>
</xs:complexType>
<!-- ******************************************************************** -->
<!-- Variables et.al. -->
<!-- Variable Types -->
<xs:complexType name="BooleanVariable">
<xs:annotation>
<xs:documentation>
This type defines a boolean variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="xs:boolean">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ChoiceVariableIntegerOption">
<xs:annotation>
<xs:documentation>
This type defines an option in an integer choice variable.
</xs:documentation>
</xs:annotation>
<xs:attribute name="display" use="required" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The value associated with this option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" use="required" type="xs:integer">
<xs:annotation>
<xs:documentation>
The value associated with this option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="ChoiceVariableStringOption">
<xs:annotation>
<xs:documentation>
This type defines an option in a string choice variable.
</xs:documentation>
</xs:annotation>
<xs:attribute name="display" use="required" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The value associated with this option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" use="required" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The value associated with this option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="ChoiceIntegerVariable">
<xs:annotation>
<xs:documentation>
This type defines an integer choice variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:sequence>
<xs:element name="option" type="ChoiceVariableIntegerOption"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="default" use="optional" type="ty:Identifier">
<xs:annotation>
<xs:documentation>
The default value of this variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ChoiceStringVariable">
<xs:annotation>
<xs:documentation>
This type defines a string choice variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:sequence>
<xs:element name="option" type="ChoiceVariableStringOption"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="default" use="optional" type="ty:Identifier">
<xs:annotation>
<xs:documentation>
The default value of this variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DateVariable">
<xs:annotation>
<xs:documentation>
This type defines a date variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="ty:Date">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="min" use="optional" type="ty:Date">
<xs:annotation>
<xs:documentation>
The minimum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="max" use="optional" type="ty:Date">
<xs:annotation>
<xs:documentation>
The maximum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DateTimeVariable">
<xs:annotation>
<xs:documentation>
This type defines a datetime variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="ty:DateTime">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="min" use="optional" type="ty:DateTime">
<xs:annotation>
<xs:documentation>
The minimum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="max" use="optional" type="ty:DateTime">
<xs:annotation>
<xs:documentation>
The maximum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DecimalVariable">
<xs:annotation>
<xs:documentation>
This type defines a decimal variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="min" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation>
The minimum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="max" use="optional" type="xs:decimal">
<xs:annotation>
<xs:documentation>
The maximum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="IntegerVariable">
<xs:annotation>
<xs:documentation>
This type defines an integer variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="xs:long">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="min" use="optional" type="xs:long">
<xs:annotation>
<xs:documentation>
The minimum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="max" use="optional" type="xs:long">
<xs:annotation>
<xs:documentation>
The maximum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ObjectVariable">
<xs:annotation>
<xs:documentation>
This type defines an object variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" use="required" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The type of objects for this variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="StringVariable">
<xs:annotation>
<xs:documentation>
This type defines a string variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minlen" use="optional" type="xs:unsignedInt">
<xs:annotation>
<xs:documentation>
The minimum length of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maxlen" use="optional" type="xs:unsignedInt">
<xs:annotation>
<xs:documentation>
The maximum length of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="pattern" use="optional" type="ty:NonEmptyString">
<xs:annotation>
<xs:documentation>
The valid pattern for this variable. Patterns are defined using
standard XML regular expression syntax.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="TimeVariable">
<xs:annotation>
<xs:documentation>
This type defines a time variable.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:attribute name="default" use="optional" type="ty:Time">
<xs:annotation>
<xs:documentation>
The default value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="min" use="optional" type="ty:Time">
<xs:annotation>
<xs:documentation>
The minimum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="max" use="optional" type="ty:Time">
<xs:annotation>
<xs:documentation>
The maximum value of the variable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- End Variable Types -->
<xs:complexType name="Variables">
<xs:annotation>
<xs:documentation>
This node type contains variable definitions.
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="boolean " type="BooleanVariable"/>
<xs:element name="ichoice" type="ChoiceIntegerVariable"/>
<xs:element name="schoice" type="ChoiceStringVariable"/>
<xs:element name="date" type="DateVariable"/>
<xs:element name="datetime" type="DateTimeVariable"/>
<xs:element name="decimal" type="DecimalVariable"/>
<xs:element name="integer" type="IntegerVariable"/>
<xs:element name="object" type="ObjectVariable"/>
<xs:element name="string" type="StringVariable"/>
<xs:element name="time" type="TimeVariable"/>
</xs:choice>
</xs:complexType>
<!-- End Properties et.al. -->
<!-- ******************************************************************** -->
<!-- ******************************************************************** -->
<!-- Actions et.al. -->
<!--
<if test="x != 12">
<then>
... actions ...
</then>
<elseif test="x < 20">
... actions ...
</else>
<else>
... actions ...
</else>
</if>
-->
<xs:complexType name="ActionElseIf">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="ActionSequence">
<xs:attribute name="test" type="ty:ConditionExprAttr" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ActionIfThenElse">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="then" type="ActionSequence"/>
<xs:element name="elseif" type="ActionElseIf" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="else" type="ActionSequence" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="test" type="ty:ConditionExprAttr" use="required"/>
</xs:complexType>
<!--
TODO
<switch value="x">
<case value="7">
... actions ...
</case>
<case value="42,">
... actions ...
</case>
<default>
... actions ...
</default>
</switch>
-->
<!--
<xs:complexType name="ActionSwitchCase">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="ActionSequence">
<xs:attribute name="value" type="ty:NonEmptyString" use="required"/>
<xs:attribute name="split" type="ty:Char" default=""/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ActionSwitch">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="case" type="ActionSwitchCase" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="default" type="ActionSequence" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="value" type="ty:ConditionExprAttr"/>
</xs:complexType>
-->
<!--
<call action="Foo" store="x">
<param name="Bar" value="42"/>
<param name="Goo">xyz</param>
</call>
-->
<xs:complexType name="ActionCall">
<xs:annotation>
<xs:documentation>
This node conditionally calls an action.
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="IfUnlessNode">
<xs:sequence>
<xs:element name="param" type="ty:ParamWithName"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="action" type="ty:Identifier" use="required"/>
<xs:attribute name="store" type="ty:NonEmptyString" use="optional">
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<eval expr="ctx.entity.Foo()" if="condition" />
-->
<xs:complexType name="ActionEval">
<xs:annotation>
<xs:documentation>
This node conditionally evaluates an expression.
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="IfUnlessNode">
<xs:attribute name="expr" type="ty:ConditionExprAttr" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<exec cmd="app.exe -f ${foo}"
dir="@{ProgramFiles}\MyApp"
exitCode="MyExitCodeProp"
output="MyStdoutStringProp"
timeout="30">
<params>
<param value="foo"/>
<param>${foo}/bar</param>
</params>
<env inherit="false">
<param name="FOO" value="foo"/>
<param name="BAR">${foo}bar</param>
</env>
</exec>
-->
<xs:complexType name="ActionExec">
<xs:annotation>
<xs:documentation>
Execute an external command (process) and optionally get its result.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="IfUnlessNode">
<xs:all>
<xs:element name="params" minOccurs="0">
<xs:annotation>
<xs:documentation>
The set of command line parameters.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="param" type="ty:ParamNoName" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
A single command line parameter.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="env" minOccurs="0">
<xs:annotation>
<xs:documentation>
The set of environment variables.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="var" type="ty:ParamWithName" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
A single environment variable.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="inherit" type="xs:boolean" use="required">
<xs:annotation>
<xs:documentation>
True to inherit the environment of the calling process.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="cmd" type="ty:NonEmptyString" use="required">
<xs:annotation>
<xs:documentation>
The path to the executable.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dir" type="ty:NonEmptyString" use="optional">
<xs:annotation>
<xs:documentation>
The working directory for the process.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="detached" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>
True to run the process in detached mode and continue. In this
mode, exitCode and output are not available.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="exitCode" type="ty:NonEmptyString" use="optional">
<xs:annotation>
<xs:documentation>
The variable to store the exit code of the process. Does not apply
to detached processes.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="output" type="ty:NonEmptyString" use="optional">
<xs:annotation>
<xs:documentation>
The variable to store the output (stdout) of the process. Does
not apply to detached processes.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="status" type="ty:NonEmptyString" use="optional">
<xs:annotation>
<xs:documentation>
The variable to store the launch status of the process. This is
0 on successful launch, otherwise it is a Windows error code.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="timeout" type="xs:unsignedInt" use="optional">
<xs:annotation>
<xs:documentation>
The maximum number of seconds to allow the process to run. Does
not apply to detached processes.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<log level="debug" if="ctx.event">An event for ${ctx.event.customer}</log>
-->
<xs:complexType name="ActionLog">
<xs:annotation>
<xs:documentation>
This node logs a message to the workflow log.
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="IfUnlessNode">
<xs:attribute name="level" type="ty:LogLevel" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<foreach src="..." var="item" indexVar="index" keyVar="key" label="Foo">
... actions ...
</foreach>
-->
<xs:complexType name="ActionForEach">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="ActionSequence">
<xs:attribute name="src" type="ty:ConditionExprAttr" use="required"/>
<xs:attribute name="var" type="ty:Identifier" use="required"/>
<xs:attribute name="indexVar" type="ty:Identifier" use="optional"/>
<xs:attribute name="keyVar" type="ty:Identifier" use="optional"/>
<xs:attribute name="label" type="ty:Identifier" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<loop label="Foo" preTest="..." postTest="..." maxLoops="100">
... actions ...
</loop>
-->
<xs:complexType name="ActionLoop">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="ActionSequence">
<xs:attribute name="label" type="ty:Identifier" use="optional"/>
<xs:attribute name="maxLoops" type="xs:unsignedInt" use="optional"/>
<xs:attribute name="preTest" type="ty:ConditionExprAttr" use="optional"/>
<xs:attribute name="postTest" type="ty:ConditionExprAttr" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<loop label="Foo" preTest="..." postTest="..." maxLoops="100">
... actions ...
<break/>
</loop>
<loop label="Foo" preTest="..." postTest="..." maxLoops="100">
... actions ...
<loop label="Bar" preTest="..." postTest="..." maxLoops="100">
... actions ...
<break label="Foo" if="..."/>
</loop>
... actions ...
</loop>
-->
<xs:complexType name="ActionBreak">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="IfUnlessNode">
<xs:attribute name="label" type="ty:Identifier" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<loop label="Foo" preTest="..." postTest="..." maxLoops="100">
... actions ...
<continue/>
</loop>
<loop label="Foo" preTest="..." postTest="..." maxLoops="100">
... actions ...
<loop label="Bar" preTest="..." postTest="..." maxLoops="100">
... actions ...
<continue label="Foo" if="..."/>
</loop>
... actions ...
</loop>
-->
<xs:complexType name="ActionContinue">
<xs:annotation>
<xs:documentation>
@@@
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="IfUnlessNode">
<xs:attribute name="label" type="ty:Identifier" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<return/>
<return if="x == 2"/>
<return unless="x == 2"/>
<return expr="x"/>
<return>${foo}${bar}</return>
-->
<xs:complexType name="ActionReturn">
<xs:annotation>
<xs:documentation>
This returns from the current macro.
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="IfUnlessNode">
<xs:attribute name="expr" type="ty:NonEmptyString" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
<set prop="Foo" expr="x"/>
<set prop="Foo.bar" expr="null"/>
<set prop="Foo[2]">Some string ${value}</set>
-->
<xs:complexType name="ActionSetVariable" mixed="true">
<xs:annotation>
<xs:documentation>
This node conditionally sets a variable to a value.
</xs:documentation>
</xs:annotation>
<xs:complexContent mixed="true">
<xs:extension base="IfUnlessNode">
<xs:attribute name="prop" type="ty:NonEmptyString" use="required"/>
<xs:attribute name="expr" type="ty:NonEmptyString" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ActionSequence">
<xs:annotation>
<xs:documentation>
This node describes a sequence of core or "foreign" actions.
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="break" type="ActionBreak"/>
<xs:element name="call" type="ActionCall"/>
<xs:element name="continue" type="ActionContinue"/>
<xs:element name="eval" type="ActionEval"/>
<xs:element name="exec" type="ActionExec"/>
<xs:element name="foreach" type="ActionForEach"/>
<xs:element name="if" type="ActionIfThenElse"/>
<xs:element name="log" type="ActionLog"/>
<xs:element name="loop" type="ActionLoop"/>
<xs:element name="return" type="ActionReturn"/>
<xs:element name="set" type="ActionSetVariable"/>
<!-- TODO xs:element name="switch" type="Switch"/-->
<xs:any namespace="##other"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="MacroDef">
<xs:annotation>
<xs:documentation>
This type defines a workflow macro action.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedElement">
<xs:sequence>
<xs:element name="params" type="Variables" minOccurs="0" />
<xs:element name="locals" type="Variables" minOccurs="0" />
<xs:element name="body" type="ActionSequence" />
<!-- TODO: fixme -->
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="Actions">
<xs:annotation>
<xs:documentation>
This node type contains action definitions.
</xs:documentation>
</xs:annotation>
</xs:complexType>
<!-- End Actions et.al. -->
<!-- ******************************************************************** -->
<xs:complexType name="Script">
<xs:annotation>
<xs:documentation>
This node type contains a workflow definition.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="globals" type="Variables" minOccurs="0">
<xs:key name="VariableNames">
<xs:selector xpath="./*"/>
<xs:field xpath="@name"/>
</xs:key>
</xs:element>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="macro" type="MacroDef">
<xs:key name="MacroParams">
<xs:selector xpath="./scr:params/scr:*|./scr:locals/scr:*"/>
<xs:field xpath="@name"/>
</xs:key>
</xs:element>
<!-- TODO: script -->
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:element name="script" type="Script">
<xs:key name="MacroNames">
<xs:selector xpath="./scr:macro"/>
<xs:field xpath="@name"/>
</xs:key>
<xs:keyref name="MacroCalls" refer="MacroNames">
<xs:selector xpath=".//scr:call"/>
<xs:field xpath="@action"/>
</xs:keyref>
</xs:element>
</xs:schema>