<?xml version="1.0" encoding="UTF-8"?>

<!-- 
*******************************************************************************

EKM Model Schema

Copyright (c) 2013 SAS IP, Inc. All rights reserved.

This schema defines the the data model used by EKM clients and services.  From
this schema, Java and C# classes can be generated that are used to manipulate
objects and types persisted in an EKM data store.  The data store can be a
cache data store, execution service data store, simulation portal data store,
or any new EKM services that are developed in the future. Similarly, clients
that interact with EKM services can also use these classes to interact and
manipulate data retrieved from an EKM service. The package for the classes is
determined by the target namespace of the schema.  In this case, that is
com.ansys.ingress.commons.model.

*******************************************************************************
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.ansys.com/ingress/commons/serializable"
    xmlns:tns="http://www.ansys.com/ingress/commons/serializable"
    elementFormDefault="qualified">

    <!--
    ***************************************************************************
    Type: ChildSpecData
            
    Defines a child specification.
    ***************************************************************************
    -->
    <complexType name="ChildSpecData">
        <sequence>
            <element name="name" type="string" />
            <element name="occurs" type="string" />
            <element name="type" type="string" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: CustomActionData
            
    Defines a custom action that can be performed.
    ***************************************************************************
    -->
    <complexType name="CustomActionData">
        <sequence>
            <element name="icon" type="string" />
            <element name="macro" type="string" />
            <element name="name" type="string" />
            <element name="parents" type="string" minOccurs="0"
                maxOccurs="unbounded" />
            <element name="permissions" type="string" minOccurs="0"
                maxOccurs="unbounded" />
			<element name="multiSelectEnabled" type="boolean" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: CustomViewData
            
    Defines a custom view.
    ***************************************************************************
    -->
    <complexType name="CustomViewData">
        <sequence>
            <element name="name" type="string" />
            <element name="initMacro" type="string" />
        </sequence>
    </complexType>
    
    <!--
    ***************************************************************************
    Type: ExtensionData
            
    Defines an extension to a model type.
    ***************************************************************************
    -->
    <complexType name="ExtensionData">
        <sequence>
            <element name="baseTypeName" type="string" />
            <element name="mixins" type="string" minOccurs="0"
                maxOccurs="unbounded" />
            <element name="name" type="string" />
            <element name="customActions" type="tns:ModelScriptData" />
            <element name="customViews" type="tns:CustomViewsData" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: ModelSpecData
            
    Defines a persistent object type.
    ***************************************************************************
    -->
    <complexType name="ModelSpecData">
         <sequence>
             <element name="baseTypeName" type="string" />
             <element name="beta" type="boolean" />
             <element name="childSpecs" type="tns:ChildSpecData"
                 minOccurs="0" maxOccurs="unbounded" />
             <element name="dependencyTypes" type="string" minOccurs="0"
                 maxOccurs="unbounded" />            
             <element name="extensionsData" type="tns:ExtensionData"
                 minOccurs="0" maxOccurs="unbounded" />            
             <element name="internal" type="boolean" />
             <element name="label" type="string" />
             <element name="lifecycleDefinitionData"
                 type="tns:LifecycleDefinitionData" />
             <element name="mixins" type="string" minOccurs="0"
                 maxOccurs="unbounded" />            
             <element name="modelObjectClassname" type="string" />            
             <element name="modelScriptData" type="tns:ModelScriptData" />
             <element name="customViewsData" type="tns:CustomViewsData" />
             <element name="permissionsMap" type="tns:MapData" />            
             <element name="permissionLevelsMap" type="tns:MapData" />            
             <element name="propertySpecsDataMap"
                 type="tns:PropertySpecDataMap" minOccurs="1" nillable="false"/>            
             <element name="requiredChildren" type="string" minOccurs="0"
                 maxOccurs="unbounded" />            
             <element name="searchable" type="tns:Searchable" />            
             <element name="specType" type="string" />            
             <element name="statusFlags" type="string" minOccurs="0"
                 maxOccurs="unbounded" />
             <element name="typeAttributesMap" type="tns:ListMapData" />            
             <element name="typeName" type="string" />            
             <element name="version" type="string" />            
         </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: ModelObjectData
            
    Defines an object of a specific type that can be persisted in a data store.
    ***************************************************************************
    -->
    <complexType name="ModelObjectData">
        <complexContent>
            <extension base="tns:ReferenceData">
                <sequence>
                    <element name="childDataMap" type="tns:ReferenceDataMap"
                        nillable="true" />
                    <element name="dynamicPropertiesMap" type="tns:MapData"
                        nillable="true" />
                    <element name="propertiesMap" type="tns:VariantDataMap"
                        nillable="true" />
                    <element name="specData" type="tns:ModelSpecData" nillable="true" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!--
    ***************************************************************************
    Type: ModelScript
            
    Defines an executable script.
    ***************************************************************************
    -->
    <complexType name="ModelScriptData">
        <sequence>
            <element name="script" type="tns:ScriptData" />
            <element name="customActions" type="tns:CustomActionData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="removedActions" type="string"
                minOccurs="0" maxOccurs="unbounded" />    
        </sequence>
    </complexType>
    
    <!--
    ***************************************************************************
    Type: CustomViewsData
            
    Defines an executable script.
    ***************************************************************************
    -->
    <complexType name="CustomViewsData">
        <sequence>
            <element name="views" type="tns:CustomViewData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="defaultView" type="tns:CustomViewData" />
        </sequence>
    </complexType>

    <!-- ===================================================================
            Type: SerializableManifestEntry
            
            Used to serialize information about a file being added to a
            repository.
         =================================================================== -->
    <complexType name="ContentManifestEntryData">
        <sequence>
            <element name="addToVersionControl" type="boolean" />
            <element name="alerts" type="int" default="-1" />
            <element name="checkin" type="boolean" />
			<element name="checkinComments" type="string" />
            <element name="checkout" type="boolean" />
            <element name="content" type="string" />
            <element name="contentCreated" type="dateTime" nillable="true" />
            <element name="contentModified" type="dateTime" nillable="true" />
            <element name="contentType" type="tns:ModelSpecData"
                 nillable="true" />
            <element name="enableLifecycle" type="boolean" />
            <element name="folder" type="boolean" />
            <element name="overwrite" type="boolean" />
            <element name="parentPath" type="string" />
            <element name="properties" type="tns:VariantDataMap" />
            <element name="typename" type="string" nillable="true" />
            <element name="length" type="long" />
            <element name="altPath" type="string" nillable="true" />
            <element name="lock" type="boolean" />
            <element name="archiveId" type="string" nillable="true" />
            <element name="projectEntry" type="boolean" />
        </sequence>
    </complexType>

    <!-- ===================================================================
            Type: SerializableManifest
            
            Used to serialize a colleciton of SerializableManifestEntry.
         =================================================================== -->
    <complexType name="ContentManifestData">
        <sequence>
            <element name="name" type="string" />
            <element name="entries" type="tns:ContentManifestEntryData"
                minOccurs="0" maxOccurs="unbounded"/>
            <element name="totalSize" type="long" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: Searchable
            
    Defines an enumeration used to determine who can search for an object type.
    ***************************************************************************
    -->
    <simpleType name="Searchable">
        <restriction base="string">
            <enumeration value="ALL" />
            <enumeration value="ROOT" />
            <enumeration value="NONE" />
        </restriction>
    </simpleType>

    <!-- ===================================================================
            Type: SerializableSearchResult
            
            Used to serialize a single search result item.
         =================================================================== -->
    <complexType name="SearchResultData">
        <sequence>
            <element name="rank"       type="long"   />
            <element name="identifier" type="string" />
            <element name="object"     type="tns:ReferenceData" />
        </sequence>
    </complexType>

    <!-- ===================================================================
            Type: SerializableSearchResultSet
            
            Used to serialize a collection of search results.
         =================================================================== -->
    <complexType name="SearchResultDataSet">
        <sequence>
            <element name="results"  type="tns:SearchResultData"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: Layout
            
    Defines the layout of a lifecycle within EKM Studio.
    ***************************************************************************
    -->
    <complexType name="LayoutData">
        <sequence>
            <element name="locations" type="tns:LocationData"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: ListMapData
            
    Defines a map data structure where the values of the entries are lists of
    items.
    ***************************************************************************
    -->
    <complexType name="ListMapData">
        <sequence>
            <element name="entries" type="tns:ListMapDataEntry" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: ListMapDataEntry
            
    Defines a name/value pair for a map where the value is a list of
    items.
    ***************************************************************************
    -->
    <complexType name="ListMapDataEntry">
        <sequence>
            <element name="value" type="anySimpleType" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: Location
            
    Defines a location for displaying a lifecycle stage or workflow node in EKM
    Studio. 
    ***************************************************************************
    -->
    <complexType name="LocationData">
        <attribute name="name" type="string" use="optional" />
        <attribute name="x" type="int" use="optional" />
        <attribute name="y" type="int" use="optional" />
    </complexType>

    <!--
    ***************************************************************************
    Type: MapData
            
    Defines a map data structure.
    ***************************************************************************
    -->
    <complexType name="MapData">
        <sequence>
            <element name="entries" type="tns:MapDataEntry" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: MapDataEntry
            
    Defines a name/value pair for a map.
    ***************************************************************************
    -->
    <complexType name="MapDataEntry">
        <sequence>
            <element name="value" type="anySimpleType" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: PropertySpecData
            
    Describes the properties that are part of a model type.
    ***************************************************************************
    -->
    <complexType name="PropertySpecData">
         <sequence>
             <element name="category" type="string" />
             <element name="constraintsMap" type="tns:VariantDataMap"
                 nillable="true" />
             <element name="defaultValueData" type="tns:VariantData" />
             <element name="displayOrder" type="int" />
             <element name="enumerationsList" type="tns:VariantData"
                 minOccurs="0" maxOccurs="unbounded" nillable="true" />
             <element name="label" type="string" />
             <element name="multivalued" type="boolean" />
             <element name="required" type="boolean" />
             <element name="specifiedBy" type="string" />
             <element name="type" type="tns:VariantDataType" />
         </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: PropertySpecDataMap
            
    Defines a map-like structure containing name/value pairs of PropertySpecs.
    ***************************************************************************
    -->
    <complexType name="PropertySpecDataMap">
        <sequence>
            <element name="entries" type="tns:PropertySpecDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!-- 
    ***************************************************************************
    Type: PropertySpecDataMapEntry
            
    Defines a name/value pair containing a PropertySpec.
    ***************************************************************************
    -->
    <complexType name="PropertySpecDataMapEntry">
        <sequence>
            <element name="value" type="tns:PropertySpecData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: ReferenceData
            
    Lightweight reference to a persistent object. Provides only enough
    information to locate the object and determine its type.
    ***************************************************************************
    -->
    <complexType name="ReferenceData">
        <sequence>
            <element name="refName" type="string" />
            <element name="archiveId" type="string" nillable="true" />
            <element name="path" type="string" nillable="true" />
            <element name="parentRef" type="tns:ReferenceData" 
                nillable="true"/>
            <element name="typename" type="string" />
            <element name="firstChild" type="tns:ReferenceData" />
        </sequence>
        <attribute name="basicType" type="tns:ReferenceDataBasicType"
            default="MODEL"/>
    </complexType>

    <!--
    ***************************************************************************
    Type: ReferenceDataBasicType
            
    Defines an enumeration of basic types that describe a reference.
    ***************************************************************************
    -->
    <simpleType name="ReferenceDataBasicType">
        <restriction base="string">
            <enumeration value="CONTAINER" />
            <enumeration value="FILE" />
            <enumeration value="MODEL" />
        </restriction>
    </simpleType>

    <!--
    ***************************************************************************
    Type: ReferenceDataMap
            
    Defines a map-like structure containing name/value pairs of References. 
    ***************************************************************************
    -->
    <complexType name="ReferenceDataMap">
        <sequence>
            <element name="entries" type="tns:ReferenceDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: ReferenceDataMapEntry
            
    Defines a name/value pair for a map of References.
    ***************************************************************************
    -->
    <complexType name="ReferenceDataMapEntry">
        <sequence>
            <element name="value" type="tns:ReferenceData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: ScriptData
            
    Defines a script.
    ***************************************************************************
    -->
    <complexType name="ScriptData">
        <simpleContent>
            <extension base="string">
                <attribute name="lang" use="optional" default="bsh"
                    type="tns:ScriptLanguage" />
            </extension>
        </simpleContent>
    </complexType>

    <!--
    ***************************************************************************
    Type: ScriptLanguage
            
    Defines the languages that can be used for scripting.
    ***************************************************************************
    -->
    <simpleType name="ScriptLanguage">
        <restriction base="string">
            <enumeration value="bsh" />
            <enumeration value="py" />
        </restriction>
    </simpleType>

    <!--
    ***************************************************************************
    Type: VariantData
            
    Generic data storage mechanism.
    ***************************************************************************
    -->
    <complexType name="VariantData">
        <sequence>
            <element name="type" type="tns:VariantDataType" />
            <group ref="tns:VariantDataChoice" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: VariantDataChoice
            
    The data stored in a Variant. Single value Variants have their data stored
    as a single item array. The choice cannot be inlined in the actual Variant
    type as it causes serialization errors in C# on Linux.
    ***************************************************************************
    -->
    <group name="VariantDataChoice">
        <choice>
            <element name="data" type="anyType" />
            <element name="list" type="tns:VariantData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="mapValue" type="tns:VariantDataMap" />
            <element name="refValue" type="tns:ReferenceData" />
        </choice>
    </group>

    <!--
    ***************************************************************************
    Type: VariantDataType
            
    Enumeration of values that can be used to specify the type of VariantData.
    ***************************************************************************
    -->
    <simpleType name="VariantDataType">
        <restriction base="string">
            <enumeration value="LIST" />
            <enumeration value="BOOLEAN" />
            <enumeration value="DATE" />
            <enumeration value="LONG" />
            <enumeration value="DOUBLE" />
            <enumeration value="STRING" />
            <enumeration value="HARD_REFERENCE" />
            <enumeration value="SOFT_REFERENCE" />
            <enumeration value="MAP" />
            <enumeration value="UNDEFINED" />
        </restriction>
    </simpleType>

    <!--
    ***************************************************************************
    Type: VariantDataMap
            
    Defines a map-like structure containing name/value pairs of Variants. 
    ***************************************************************************
    -->
    <complexType name="VariantDataMap">
        <sequence>
            <element name="entries" type="tns:VariantDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: VariantDataMapItem
            
    Defines a name/value pair for a map of Variants.
    ***************************************************************************
    -->
    <complexType name="VariantDataMapEntry">
        <sequence>
            <element name="value" type="tns:VariantData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleDefinition
            
    Defines a lifecycle.
    ***************************************************************************
    -->
    <complexType name="LifecycleDefinitionData">
        <sequence>
            <element name="ekmVersion" type="string" />
            <element name="literal" type="boolean" />
            <element name="script" type="tns:ScriptData" />
            <element name="typesMap" type="tns:LifecycleTypeDataMap" />
            <element name="signoffWorkflowsMap" type="tns:WorkflowDefinitionDataMap" />
            <element name="stagesMap" type="tns:LifecycleStageDataMap" />
            <element name="startStage" type="tns:LifecycleStageData" />
            <element name="transitions" minOccurs="0" maxOccurs="unbounded"
                type="tns:LifecycleTransitionData" />
            <element name="layout" type="tns:LayoutData" nillable="true" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleStage
            
    Defines a lifecycle stage.
    ***************************************************************************
    -->
    <complexType name="LifecycleStageData">
        <sequence>
            <element name="permissions" type="tns:PermissionData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="inTransitions" type="tns:LifecycleTransitionData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="outTransitions" type="tns:LifecycleTransitionData"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
        <attribute name="name" type="string" use="required" />
        <attribute name="description" type="string" use="required" />
        <attribute name="demoteAllowed" type="boolean" use="optional" />
        <attribute name="expirationDays" type="int" use="optional" />
        <attribute name="x" type="int" use="optional" />
        <attribute name="y" type="int" use="optional" />
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleStageDataMap
            
    Defines a map-like structure of lifecycle stages.
    ***************************************************************************
    -->
    <complexType name="LifecycleStageDataMap">
        <sequence>
            <element name="entries" type="tns:LifecycleStageDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleStageDataMapEntry
            
    Defines the name-value pairs that make up a map of lifecycle stages.
    ***************************************************************************
    -->
    <complexType name="LifecycleStageDataMapEntry">
        <sequence>
            <element name="value" type="tns:LifecycleStageData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleTransition
            
    Defines a lifecycle transition.
    ***************************************************************************
    -->
    <complexType name="LifecycleTransitionData">
        <sequence>
            <element name="promoteSignoffs" type="tns:SignoffData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="demoteSignoffs" type="tns:SignoffData"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
        <attribute name="source" type="string" use="required" />
        <attribute name="destination" type="string"
            use="required" />
        <attribute name="promoteValidationClassName" type="string"
            use="optional" />
        <attribute name="promoteValidationMacro" type="string"
            use="optional" />
        <attribute name="promoteActionClassName" type="string"
            use="optional" />
        <attribute name="promoteActionMacro" type="string"
            use="optional" />
        <attribute name="demoteValidationClassName" type="string"
            use="optional" />
        <attribute name="demoteValidationMacro" type="string"
            use="optional" />
        <attribute name="demoteActionClassName" type="string"
            use="optional" />
        <attribute name="demoteActionMacro" type="string"
            use="optional" />
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleTypeData
            
    Defines a lifecycle type.
    ***************************************************************************
    -->
    <complexType name="LifecycleTypeData" >
        <attribute name="name" type="string" use="required" />
        <attribute name="enabledByDefault" use="required" type="boolean" />
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleTypeDataMap
            
    Defines a map of lifecycle type.
    ***************************************************************************
    -->
    <complexType name="LifecycleTypeDataMap" >
        <sequence>
            <element name="entries" type="tns:LifecycleTypeDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: LifecycleTypeDataMapEntry
            
    Defines an entry in a map of lifecycle type.
    ***************************************************************************
    -->
    <complexType name="LifecycleTypeDataMapEntry" >
        <sequence>
            <element name="value" type="tns:LifecycleTypeData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: PermissionData
            
    Defines permissions for a Lifecycle. 
    ***************************************************************************
    -->
    <complexType name="PermissionData">
        <sequence>
            <element name="type" type="tns:PermissionDataType" />
            <element name="members" type="string" minOccurs="1"
                maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: PermissionDataType
            
    Defines valid values for PermisisonData. 
    ***************************************************************************
    -->
    <simpleType name="PermissionDataType">
        <restriction base="string">
            <enumeration value="access" />
            <enumeration value="create" />
            <enumeration value="delete" />
            <enumeration value="modify" />
            <enumeration value="download" />
            <enumeration value="lifecycle" />
            <enumeration value="fullControl" />
        </restriction>
    </simpleType>

    <!--
    ***************************************************************************
    Type: Signoff
            
    Defines a signoff for a lifecyce.
    ***************************************************************************
    -->
    <complexType name="SignoffData">
        <sequence>
            <element name="members" type="string" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
        <attribute name="level" type="string" use="required" />
        <attribute name="inclusive" use="optional" type="boolean"
            default="true"/>
        <attribute name="dueDays" use="optional" type="int" default="7"/>
    </complexType>

    <!--
    ***************************************************************************
    Type: ApprovalNodeData
            
    Defines an approval node in a workflow.
    ***************************************************************************
    -->
    <complexType name="ApprovalNodeData">
        <complexContent>
            <extension base="tns:NodeData">
                <sequence>
                    <element name="members" type="string"
                        maxOccurs="unbounded" minOccurs="0" />
                    <element name="inclusive" type="boolean" />
                    <element name="dueDays" type="int" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!--
    ***************************************************************************
    Type: AutoNodeData
            
    Defines an auto node in a workflow.
    ***************************************************************************
    -->
    <complexType name="AutoNodeData">
        <complexContent>
            <extension base="tns:NodeData">
                <sequence>
                    <element name="macro" type="string" />
                    <element name="nodeProcessorClassName" type="string" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!--
    ***************************************************************************
    Type: NodeData
            
    Defines a Node in a workflow.
    ***************************************************************************
    -->
    <complexType name="NodeData">
         <sequence>
             <element name="inputVarsMap" type="tns:MapData" />
             <element name="outputVarsMap"
                 type="tns:OutputVariableDataMap" />
             <element name="validationExpressionsData" minOccurs="0"
                 maxOccurs="unbounded" type="tns:ValidationExpressionData" />
             <!-- Additional data defined by Node class -->
             <element name="resource" type="string" />
             <element name="x" type="int" />
             <element name="y" type="int" />
             <element name="incomingTransitionsData" minOccurs="0"
                 maxOccurs="unbounded" type="tns:TransitionData" />
             <element name="outgoingTransitionsData" minOccurs="0"
                 maxOccurs="unbounded" type="tns:TransitionData" />
             <element name="completionBeanClassName" type="string" />
             <element name="batchNode" type="boolean" />
             <element name="doeNode" type="boolean" />
         </sequence>
         <attribute name="name" type="string" />
         <attribute name="description" type="string" />
         <attribute name="assignee" type="string" use="optional" />
         <attribute name="completionMacro" type="string" />
         <attribute name="className" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: NodeDataMap
            
    Defines a map-like structure of NodeData.
    ***************************************************************************
    -->
    <complexType name="NodeDataMap">
        <sequence>
            <element name="entries" type="tns:NodeDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: NodeDataMapEntry
            
    Defines a name/value pair stored in a NodeDataMap.
    ***************************************************************************
    -->
    <complexType name="NodeDataMapEntry">
        <sequence>
            <element name="value" type="tns:NodeData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: OutputVariableData
            
    Defines an output variable in a workflow.
    ***************************************************************************
    -->
    <complexType name="OutputVariableData">
        <sequence>
            <element name="itemVar" type="string" />
            <element name="processVar" type="string" />
        </sequence>
        <attribute name="displayOrder" type="int" />
    </complexType>

    <!--
    ***************************************************************************
    Type: OutputVariableDataMap
            
    Defines a map-like structure of output variables. 
    ***************************************************************************
    -->
    <complexType name="OutputVariableDataMap">
        <sequence>
            <element name="entries" type="tns:OutputVariableDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: OutputVariableDataMapEntry
            
    Defines a name/value pair in an OutputVariableDataMap. 
    ***************************************************************************
    -->
    <complexType name="OutputVariableDataMapEntry">
        <sequence>
            <element name="value" type="tns:OutputVariableData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: TransitionData
            
    Defines a workflow transition. 
    ***************************************************************************
    -->
    <complexType name="TransitionData">
        <sequence>
            <element name="name" type="string" />
            <element name="source" type="string" />
            <element name="destination" type="string" />
            <element name="triggerExpression" type="string" nillable="true" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: TransitionData
            
    Defines a map-like strucure of TransationData. 
    ***************************************************************************
    -->
    <complexType name="TransitionDataMap">
        <sequence>
            <element name="entries" type="tns:TransitionDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: TransitionDataMapEntry
            
    Defines a name/value pair in a TranstionDataMap. 
    ***************************************************************************
    -->
    <complexType name="TransitionDataMapEntry">
        <sequence>
            <element name="value" type="tns:TransitionData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: UpdateAnalysisProjectNodeData
            
    Defines a update analysis project node. 
    ***************************************************************************
    -->
    <complexType name="UpdateAnalysisProjectNodeData">
        <complexContent>
            <extension base="tns:AutoNodeData">
                <sequence>
                    <element name="analysisProjectVar" type="string" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!--
    ***************************************************************************
    Type: ValidationExpressionData
            
    Defines a workflow validation expression.
    ***************************************************************************
    -->
    <complexType name="ValidationExpressionData">
        <sequence>
            <element name="expression" type="string" />
            <element name="errorMessage" type="string" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: VariableData
            
    Defines a workflow variable.
    ***************************************************************************
    -->
    <complexType name="VariableData">
        <sequence>
            <element name="spec" type="tns:PropertySpecData" />
        </sequence>
        <attribute name="description" type="string" />
        <attribute name="id" type="string" />
        <attribute name="name" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: VariableDataMap
            
    Defines a map of workflow variables.
    ***************************************************************************
    -->
    <complexType name="VariableDataMap">
        <sequence>
            <element name="entries" type="tns:VariableDataMapEntry" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: VariableDataMapEntry
            
    Defines a name/value pair in a map of workflow variables.
    ***************************************************************************
    -->
    <complexType name="VariableDataMapEntry">
        <sequence>
            <element name="value" type="tns:VariableData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowBlockData
            
    Defines a workflow block. 
    ***************************************************************************
    -->
    <complexType name="WorkflowBlockData">
        <sequence>
            <element name="blocksMap" type="tns:WorkflowBlockDataMap"
                nillable="true"/>
            <element name="nodesMap" type="tns:NodeDataMap"
                nillable="true"/>
            <element name="transitionsMap" type="tns:TransitionDataMap"
                nillable="true"/>
            <element name="startNodeData" type="tns:NodeData"
                nillable="true"/>
            <element name="endNodeData" type="tns:NodeData"
                nillable="true"/>
            <element name="parentNodeData" type="tns:NodeData"
                nillable="true"/>
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowBlockDataMap
            
    Defines a map-like structure of workflow blocks. 
    ***************************************************************************
    -->
    <complexType name="WorkflowBlockDataMap">
        <sequence>
            <element name="entries" type="tns:WorkflowBlockDataMapEntry"
                minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowBlockDataMapEntry
            
    Defines a name/value pair in a WorkflowBlockDataMap. 
    ***************************************************************************
    -->
    <complexType name="WorkflowBlockDataMapEntry">
        <sequence>
            <element name="value" type="tns:WorkflowBlockData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowDefinition
            
    Defines a workflow.
    ***************************************************************************
    -->
    <complexType name="WorkflowDefinitionData">
<!--    <complexContent>
            <extension base="tns:WorkflowBlockData"> -->
                <sequence>
                    <element name="ekmVersion" type="string" />
<!--                <element name="scriptData" type="tns:ScriptData" />
                    <element name="variablesMap" type="tns:VariableDataMap" />
                    <element name="layout" type="tns:LayoutData" />
                    <element name="requiredVarsList" type="string" minOccurs="0"
                        maxOccurs="unbounded" />
                    <element name="validationExpressionsList" minOccurs="0"
                        maxOccurs="unbounded" type="tns:ValidationExpressionData" />
                    <element name="scriptEngineEnabled" type="boolean" /> -->
                </sequence>
                <attribute name="name" type="string" />
                <attribute name="description" type="string" />
<!--        </extension>
        </complexContent> -->
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowDefinitionMap
            
    Defines a map data structure of WorkflowDefinitions.
    ***************************************************************************
    -->
    <complexType name="WorkflowDefinitionDataMap">
        <sequence>
            <element name="entries" type="tns:WorkflowDefinitionDataMapEntry"
                minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <!--
    ***************************************************************************
    Type: WorkflowDefinitionMapEntry
            
    Defines a name/value pair for a map of WorkflowDefinitions.
    ***************************************************************************
    -->
    <complexType name="WorkflowDefinitionDataMapEntry">
        <sequence>
            <element name="value" type="tns:WorkflowDefinitionData" />
        </sequence>
        <attribute name="key" type="string" />
    </complexType>

    <!--
    ***************************************************************************

    Elements

    ***************************************************************************
    -->

    <element name="nodeData" type="tns:NodeData"/>

    <element name="nodeDataMap" type="tns:NodeDataMap"/>

    <element name="nodeDataMapEntry" type="tns:NodeDataMapEntry"/>

    <element name="outputVariableData" type="tns:OutputVariableData"/>

    <element name="outputVariableDataMap" type="tns:OutputVariableDataMap"/>

    <element name="outputVariableDataMapEntry" type="tns:OutputVariableDataMapEntry"/>

    <element name="transitionData" type="tns:TransitionData"/>

    <element name="transitionDataMap" type="tns:TransitionDataMap"/>

    <element name="transitionDataMapEntry" type="tns:TransitionDataMapEntry"/>

    <element name="validationExpressionData" type="tns:ValidationExpressionData"/>

    <element name="variableData" type="tns:VariableData"/>

    <element name="variableDataMap" type="tns:VariableDataMap"/>

    <element name="variableDataMapEntry" type="tns:VariableDataMapEntry"/>

    <element name="workflowBlockData" type="tns:WorkflowBlockData"/>

    <element name="workflowBlockDataMap" type="tns:WorkflowBlockDataMap"/>

    <element name="workflowBlockDataMapEntry" type="tns:WorkflowBlockDataMapEntry"/>

    <element name="workflowDefinitionData"/>

    <element name="workflowDefinitionDataMap" type="tns:WorkflowDefinitionDataMap"/>

    <element name="workflowDefinitionDataMapEntry" type="tns:WorkflowDefinitionDataMapEntry"/>

    <complexType name="BatchNodeData">
        <complexContent>
            <extension base="tns:NodeData">
                <sequence>
                    <element name="batchVars"
                        type="tns:BatchNodeVarData"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="batchValidationExpressions"
                        type="tns:ValidationExpressionData"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="appKey"
                        type="tns:BatchNodeVarData">
                    </element>
                    <element name="params" type="tns:BatchNodeVarData"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="exportFiles"
                        type="tns:BatchNodeExportFileData"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="outputFolder"
                        type="tns:BatchNodeVarData">
                    </element>
                    <element name="nativeOptions"
                        type="tns:BatchNodeVarData">
                    </element>
                    <element name="transcript"
                        type="tns:BatchNodeVarData">
                    </element>
                    <element name="importFiles"
                        type="tns:BatchNodeImportFileData"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="importedFileTypes" type="tns:BatchNodeImportedFileTypeData" maxOccurs="unbounded" minOccurs="0"></element>
                </sequence>
                <attribute name="batchMacro" type="string"
                    use="optional">
                </attribute>
                <attribute name="batchProcessorClassName" type="string"
                    use="optional">
                </attribute>
            </extension>
        </complexContent>
    </complexType>
    
    <complexType name="BatchNodeVarData">
        <sequence>
            <element name="value" type="string"></element>
            <element name="literal" type="boolean"></element>
        </sequence>
    </complexType>

    <complexType name="BatchNodeExportFileData">
        <complexContent>
            <extension base="tns:BatchNodeFileData">
                <sequence>
                    <element name="templateVars" type="tns:VariableDataMap"></element>
                </sequence>
                <attribute name="exportedFileName" type="string"
                    use="optional">
                </attribute>
                <attribute name="literalExportedFileName"
                    type="boolean">
                </attribute>
                <attribute name="template" type="boolean"></attribute>
                <attribute name="nonEkmFile" type="boolean"></attribute>
                <attribute name="temporary" type="boolean"></attribute>
            </extension>
        </complexContent>
    </complexType>

    <complexType name="BatchNodeFileData">
        <complexContent>
            <extension base="tns:BatchNodeVarData">
                <sequence>
                    <element name="includes" type="string"
                        maxOccurs="unbounded" minOccurs="0">
                    </element>
                    <element name="excludes" type="string" maxOccurs="unbounded" minOccurs="0"></element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <complexType name="BatchNodeImportFileData">
        <complexContent>
            <extension base="tns:BatchNodeFileData">
                <attribute name="retrieveOnFailure" type="boolean"></attribute>
            </extension>
        </complexContent>
    </complexType>

    <complexType name="BatchNodeImportedFileTypeData">
        <attribute name="pattern" type="string"></attribute>
        <attribute name="type" type="string"></attribute>
    </complexType>

    <complexType name="IterationNodeData">
        <complexContent>
            <extension base="tns:NodeData">
                <sequence>
                    <element name="iterationBlock" type="tns:WorkflowBlockData"></element>
                </sequence>
                <attribute name="iterationExpression" type="string"></attribute>
                <attribute name="iterationBlockName" type="string"></attribute>
            </extension>
        </complexContent>
    </complexType>

    <complexType name="MonitorNodeData">
        <complexContent>
            <extension base="tns:NodeData">
                <attribute name="monitoredProcessVar" type="string"></attribute>
            </extension>
        </complexContent>
    </complexType>


    <!--
    ***************************************************************************
    Type: TransferErrorData
            
    Defines the persistent data for an error that occurs during a staged
    transfer.
    ***************************************************************************
    -->
    <complexType name="TransferErrorData">
        <sequence>
            <element name="exceptionClass"   type="string" />
            <element name="exceptionMessage" type="string" />
            <element name="failedItem" type="tns:ContentManifestEntryData" />
        </sequence>
    </complexType>


    <!--
    ***************************************************************************
    Type: StagedTransferData
            
    Defines the persistent data for a StagedTransfer instance.
    ***************************************************************************
    -->
    <complexType name="StagedTransferData">
        <sequence>
            <!-- Job fields -->
            <element name="description" type="string" nillable="true" />
            <element name="endTime" type="dateTime" nillable="true" />
            <element name="exceptionClass" type="string" nillable="true" />
            <element name="exceptionMsg" type="string" nillable="true" />
            <element name="startTime" type="dateTime" />
            <element name="status" type="int" />
            <!-- StagedTransfer fields -->
            <element name="credentials" type="tns:MapData" />
            <element name="destination" type="string" />
            <element name="errors" type="tns:TransferErrorData" minOccurs="0"
                maxOccurs="unbounded" />
            <element name="filesTransferred" type="int" />
            <element name="foldersCreated" type="int" />
            <element name="items" type="tns:ContentManifestEntryData"
                minOccurs="0" maxOccurs="unbounded" />
            <element name="itemsProcessed" type="int" />
            <element name="server" type="string" />
            <element name="servletPath" type="string" />
            <element name="totalBytes" type="long" />
            <element name="totalItems" type="int" />
            <element name="transferClass" type="string" />
            <element name="transferId" type="string" />
            <element name="usingCache" type="boolean" />
            <element name="properties" type="tns:MapData" nillable="true" />
            <element name="projects" type="tns:ProjectData" minOccurs="0"
                maxOccurs="unbounded" nillable="true" />
        </sequence>
    </complexType>
    
    
    <complexType name="JobEventData">
        <sequence>
            <element name="taskIndeterminate" type="boolean" />
            <element name="ended" type="dateTime" nillable="true"/>
            <element name="started" type="dateTime" />
            <element name="exceptionClass" type="string" nillable="true" />
            <element name="exceptionMsg" type="string" nillable="true" />
            <element name="reason" type="int" />
            <element name="totalTasks" type="int" />
            <element name="taskAmountCompleted" type="long" />
            <element name="taskLength" type="long" />
            <element name="jobName" type="string" />
            <element name="taskName" type="string" />
            <element name="jobId" type="string" />
            <element name="taskProperties" type="tns:MapData" />
            <element name="errorCount" type="int" />
            <element name="errors" type="tns:TransferErrorData" minOccurs="0"
                maxOccurs="unbounded" />
        </sequence>
    </complexType>

    <complexType name="ProjectData">
        <sequence>
            <element name="name" type="string" />
            <element name="parentPath" type="string" />
            <element name="addToVersionControl" type="boolean" />
            <element name="alerts" type="int" default="-1" />
            <element name="checkin" type="boolean" />
            <element name="checkinComments" type="string" />
            <element name="checkout" type="boolean" />
            <element name="enableLifecycle" type="boolean" />
            <element name="overwrite" type="boolean" />
            <element name="lock" type="boolean" />
            <element name="description" type="string" />
            <element name="content" type="tns:ContentManifestEntryData"
                minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
    </complexType>

    <!--
    ***************************************************************************

    Elements

    ***************************************************************************
    -->

    <element name="childSpecData" type="tns:ChildSpecData"/>

    <element name="customActionData" type="tns:CustomActionData"/>

    <element name="customViewData" type="tns:CustomViewData"/>

    <element name="extensionData" type="tns:ExtensionData"/>

    <element name="modelSpecData" type="tns:ModelSpecData" />

    <element name="modelObjectData" type="tns:ModelObjectData"/>

    <element name="modelScriptData" type="tns:ModelScriptData"/>

    <element name="customViewsData" type="tns:CustomViewsData"/>

    <element name="searchable" type="tns:Searchable"/>

    <element name="searchResultData" type="tns:SearchResultData"/>

    <element name="searchResultDataSet" type="tns:SearchResultDataSet"/>

    <element name="contentManifestData" type="tns:ContentManifestData"/>

    <element name="layoutData" type="tns:LayoutData"/>

    <element name="listMap" type="tns:ListMapData"/>

    <element name="listMapEntry" type="tns:ListMapDataEntry"/>

    <element name="locationData" type="tns:LocationData"/>

    <element name="mapData" type="tns:MapData"/>

    <element name="mapDataEntry" type="tns:MapDataEntry"/>

    <element name="propertySpecData" type="tns:PropertySpecData" />

    <element name="propertySpecDataMap" type="tns:PropertySpecDataMap"/>

    <element name="propertySpecDataMapEntry" type="tns:PropertySpecDataMapEntry"/>

    <element name="reference" type="tns:ReferenceData"/>

    <element name="referenceDataMap" type="tns:ReferenceDataMap"/>

    <element name="referenceDataMapEntry" type="tns:ReferenceDataMapEntry"/>

    <element name="scriptData" type="tns:ScriptData"/>

    <element name="variant" type="tns:VariantData"/>

    <element name="variantDataMap" type="tns:VariantDataMap"/>

    <element name="variantDataMapEntry" type="tns:VariantDataMapEntry"/>

    <element name="lifecycleDefinitionData" type="tns:LifecycleDefinitionData"/>

    <element name="lifecycleStageData" type="tns:LifecycleStageData"/>

    <element name="lifecycleTransitionData" type="tns:LifecycleTransitionData"/>

    <element name="lifecycleTypeData" type="tns:LifecycleTypeData"/>

    <element name="permissionData" type="tns:PermissionData"/>

    <element name="signoff" type="tns:SignoffData"/>

    <element name="transferError" type="tns:TransferErrorData" />

    <element name="stagedTransfer" type="tns:StagedTransferData" />
    
    <element name="jobEvent" type="tns:JobEventData" />

    <element name="projectData" type="tns:ProjectData" />

</schema>
