An XML schema describing the policy specification is provided as a static resource named RetentionPolicySchema.

The policy specification contains filters and retention rules. The filters are used to constrain the set of agreements to which the policy applies. The retention rule specifies how to compute the retention date based on existing date fields in the agreement. The sequence field may be used to establish the order in which the policies should be applied. Here is the schema for the retention policy:



<-- Description:
    Defines schema RetentionPolicy
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xs:element name="RetentionPolicy" type="RetentionPolicyType">
		<xs:annotation>
			<xs:documentation>Retention Policy</xs:documentation>
		</xs:annotation>
	</xs:element>
	<!-- retention policy -->
	<xs:complexType name="RetentionPolicyType">
		<xs:sequence>
			<xs:element name="Filter" type="FilterType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>The record filter</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Rule" type="RuleType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>The retention rule</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- filter -->
	<xs:complexType name="FilterType">
		<xs:sequence>
			<xs:element name="Predicates" type="PredicateCollType">
				<xs:annotation>
					<xs:documentation>The filter predicates</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ConditionExpr" type="xs:string">
				<xs:annotation>
					<xs:documentation>The filter expression</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- rule type -->
	<xs:complexType name="RuleType">
		<xs:sequence>
			<xs:element name="RetainForever" type="xs:boolean">
				<xs:annotation>
					<xs:documentation>Retain forever indicator</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="RetainFor" type="RetainForType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Retain for</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- retain for -->
	<xs:complexType name="RetainForType">
		<xs:sequence>
			<xs:element name="Period" type="RetentionPeriodType">
				<xs:annotation>
					<xs:documentation>The retention period</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="AfterDate" type="AfterDateType">
				<xs:annotation>
					<xs:documentation>The after date</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- retention period -->
	<xs:complexType name="RetentionPeriodType">
		<xs:simpleContent>
			<xs:extension base="xs:nonNegativeInteger">
				<xs:attribute name="uom" type="PeriodUOMType">
					<xs:annotation>
						<xs:documentation>Retention period</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<!-- after date -->
	<xs:complexType name="AfterDateType">
		<xs:sequence>
			<xs:element name="FieldName" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field name</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="FieldLabel" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field label</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- predicate collection -->
	<xs:complexType name="PredicateCollType">
		<xs:sequence>
			<xs:element name="Predicate" type="PredicateType" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The predicate</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- predicate -->
	<xs:complexType name="PredicateType">
		<xs:sequence>
			<xs:element name="RowNum" type="xs:positiveInteger">
				<xs:annotation>
					<xs:documentation>Row number</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="FieldName" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field name</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="FieldLabel" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field label</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="FieldType" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field type</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CompOper" type="xs:string">
				<xs:annotation>
					<xs:documentation>Comparison operator</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="FieldValue" type="xs:string">
				<xs:annotation>
					<xs:documentation>Field value</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="BoolOper" type="xs:string">
				<xs:annotation>
					<xs:documentation>Boolean operator</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- period uom -->
	<xs:simpleType name="PeriodUOMType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Days"/>
			<xs:enumeration value="Months"/>
			<xs:enumeration value="Years"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
CODE