blob: e4479452ac077d39e373d56818db16dba56dcfcd [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="service-eca">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="eca"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="eca">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="condition"/>
<xs:element ref="condition-field"/>
<xs:element ref="condition-service"/>
</xs:choice>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="set"/>
<xs:element ref="action"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="attlist.eca"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.eca">
<xs:attribute type="xs:string" name="service" use="required"/>
<xs:attribute name="event" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="global-commit"><xs:annotation><xs:documentation>Runs when the transaction the service is running in is successfully committed.</xs:documentation></xs:annotation></xs:enumeration>
<xs:enumeration value="global-commit-post-run"><xs:annotation><xs:documentation>Like global-commit, but gets its context post/after the run of the service and all non-global ECA rules.</xs:documentation></xs:annotation></xs:enumeration>
<xs:enumeration value="global-rollback"><xs:annotation><xs:documentation>Runs when the transaction the service is running in is rolled back.</xs:documentation></xs:annotation></xs:enumeration>
<xs:enumeration value="auth"><xs:annotation><xs:documentation>Runs before the user is authenticated. Note that when the service to which the eca is associated is executed asynchronously this event occurs at least two times (at the time of the call and at the time of the execution). For this reason it is only safe to use this event to call services that don't change the status of any system.</xs:documentation></xs:annotation></xs:enumeration>
<xs:enumeration value="in-validate"><xs:annotation><xs:documentation>Runs before the input parameters are validated. Note that when the service to which the eca is associated is executed asynchronously this event occurs at least two times (at the time of the call and at the time of the execution). For this reason it is only safe to use this event to call services that don't change the status of any system.</xs:documentation></xs:annotation></xs:enumeration>
<xs:enumeration value="out-validate"/>
<xs:enumeration value="invoke"/>
<xs:enumeration value="commit"/>
<xs:enumeration value="return"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="run-on-failure" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="run-on-error" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="condition">
<xs:complexType>
<xs:attributeGroup ref="attlist.condition"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.condition">
<xs:attribute type="xs:string" name="map-name"/>
<xs:attribute type="xs:string" name="field-name" use="required"/>
<xs:attribute name="operator" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="less"/>
<xs:enumeration value="greater"/>
<xs:enumeration value="less-equals"/>
<xs:enumeration value="greater-equals"/>
<xs:enumeration value="equals"/>
<xs:enumeration value="not-equals"/>
<xs:enumeration value="is-empty"/>
<xs:enumeration value="is-not-empty"/>
<xs:enumeration value="contains"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:string" name="value"/>
<xs:attribute name="type" default="String">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="PlainString"/>
<xs:enumeration value="String"/>
<xs:enumeration value="BigDecimal"/>
<xs:enumeration value="Double"/>
<xs:enumeration value="Float"/>
<xs:enumeration value="Long"/>
<xs:enumeration value="Integer"/>
<xs:enumeration value="Date"/>
<xs:enumeration value="Time"/>
<xs:enumeration value="Timestamp"/>
<xs:enumeration value="Boolean"/>
<xs:enumeration value="Object"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:string" name="format"/>
</xs:attributeGroup>
<xs:element name="set">
<xs:complexType>
<xs:attributeGroup ref="attlist.set"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.set">
<xs:attribute type="xs:string" name="field-name" use="required"/>
<xs:attribute type="xs:string" name="env-name"/>
<xs:attribute type="xs:string" name="value"/>
<xs:attribute name="format">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="append"/>
<xs:enumeration value="to-upper"/>
<xs:enumeration value="to-lower"/>
<xs:enumeration value="hash-code"/>
<xs:enumeration value="long"/>
<xs:enumeration value="double"/>
<xs:enumeration value="upper-first-char"/>
<xs:enumeration value="lower-first-char"/>
<xs:enumeration value="db-to-java"/>
<xs:enumeration value="java-to-db"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="condition-field">
<xs:complexType>
<xs:attributeGroup ref="attlist.condition-field"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.condition-field">
<xs:attribute type="xs:string" name="map-name"/>
<xs:attribute type="xs:string" name="field-name" use="required"/>
<xs:attribute name="operator" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="less"/>
<xs:enumeration value="greater"/>
<xs:enumeration value="less-equals"/>
<xs:enumeration value="greater-equals"/>
<xs:enumeration value="equals"/>
<xs:enumeration value="not-equals"/>
<xs:enumeration value="contains"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:string" name="to-map-name"/>
<xs:attribute type="xs:string" name="to-field-name"/>
<xs:attribute name="type" default="String">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="PlainString"/>
<xs:enumeration value="String"/>
<xs:enumeration value="BigDecimal"/>
<xs:enumeration value="Double"/>
<xs:enumeration value="Float"/>
<xs:enumeration value="Long"/>
<xs:enumeration value="Integer"/>
<xs:enumeration value="Date"/>
<xs:enumeration value="Time"/>
<xs:enumeration value="Timestamp"/>
<xs:enumeration value="Boolean"/>
<xs:enumeration value="Object"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:string" name="format"/>
</xs:attributeGroup>
<xs:element name="condition-service">
<xs:complexType>
<xs:attributeGroup ref="attlist.condition-service"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.condition-service">
<xs:attribute type="xs:string" name="service-name"/>
</xs:attributeGroup>
<xs:element name="action">
<xs:complexType>
<xs:attributeGroup ref="attlist.action"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.action">
<xs:attribute type="xs:string" name="service" use="required"/>
<xs:attribute name="mode" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="sync"/>
<xs:enumeration value="async"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute type="xs:string" name="run-as-user"/>
<xs:attribute type="xs:string" name="result-map-name"/>
<xs:attribute name="new-transaction" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="result-to-context" default="true">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="result-to-result" default="false">
<xs:annotation><xs:documentation>If true, copies the action's result Map into the service's result Map.</xs:documentation></xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ignore-failure" default="true">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ignore-error" default="true">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="persist" default="false">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>