<?xml version="1.0" encoding="utf-8"?>
<C4IT-M42-SchemaInstaller>
	<Variables>
		<!-- <Variable Name="USE_WF_Worker" Type="SQL" Default="0">select case when ( SELECT count([Version]) FROM [SchemaProductVersion] where [Version] > '10.1') >=1 and (select top 1 c.WorkflowEngineType from SPSGlobalConfigurationClassBase c) = 1 then 1 else 0 end as useWFWorker</Variable>  -->
		<!-- <Variable Name="WF_STATE" Type="SQL" Default="0">select case when ( SELECT count([Version]) FROM [SchemaProductVersion] where [Version] > '10.1') >=1 and (select top 1 c.WorkflowEngineType from SPSGlobalConfigurationClassBase c) = 1 then 10102 else 10101 end as wfstate</Variable>  -->
	</Variables>
  <UpdateInfo>
	<!-- objects, which will not be removed within an update installation -->
    <NoRemovement Type="PDRNavigationItemType" ID="8702a16c-cdc6-c810-b02c-08d5cb9d6f63" Ignore="true"/>  <!-- C4IT root navigation object in administration -->
    <NoRemovement Type="PDRNavigationItemType" ID="125d587d-f51e-cfd7-ca63-08d653beaaef" Ignore="true"/>  <!-- C4IT root navigation object in assets  -->
    <NoRemovement Type="PDRNavigationItemType" ID="a33503d6-160c-c2fb-9656-08d6667e6094" Ignore="true"/>  <!-- C4IT root navigation object in service catalog -->
    <NoRemovement Type="PDRNavigationItemType" ID="72aa66c3-61cd-ccf4-57e1-08d65f6d24bb" Ignore="true"/>  <!-- C4IT root navigation object in service desk -->
    <NoRemovement Type="PLSLXamlComponentType" ID="*"/>  <!-- all workflows -->
    <NoRemovement Type="PLSLWorkflowConfigurationType" ID="*"/>  <!-- all workflows Configurations -->
    <NoRemovement Type="PLBEActivationType" ID="*"/>  <!-- all engine activations -->
    <NoRemovement Type="PLSLServiceTypeWebAPI" ID="*"/>  <!-- all web services -->
    <NoRemovement Type="PLSLWebServiceOperationType" ID="*"/>  <!-- all web service operations -->
    <NoRemovement Type="SPSArticleTypeService" ID="*"/>  <!-- all services -->
    <NoRemovement Type="SVCServiceTypeBundle" ID="*"/>  <!-- all service bundles -->
    <NoRemovement Type="SVCServiceTypeConfigGroup" ID="*"/>  <!-- all service groups -->
    <NoRemovement Type="SPSArticleCategoryType" ID="*"/>  <!-- all article categories -->
    <NoRemovement Type="SVCServiceProvisioningTypeCreateWFChange" ID="*"/>  <!-- all 'Provisioning - Create WF Change' objects -->
    <NoRemovement Type="SPSActivityTemplateClassBase" ID="*"/>  <!-- all activity templates -->
	<NoRemovement Type="PLSLWorkflowAssemblyLibraryType" ID="*"/>  <!-- all activity assemblies -->
</UpdateInfo>
  <Removements>
    <!-- removement of unnecessary, disturbing content -->
    <Remove>Data/SPSContentClassObjectDialogTab/PublishingUser</Remove>
    <Remove>NewDataSet/PDRContentWidgetTemplateView/Owner</Remove>
    <Remove>NewDataSet/PDRContentWidgetTemplateCustom/Owner</Remove>
    <Remove>NewDataSet/PDRContentWidgetTemplateClassViewCustom/Owner</Remove>
    <Remove>NewDataSet/PLSLComponentClassBase/CreatedBy</Remove>
    <Remove>NewDataSet/PLSLComponentClassBase/LockedBy</Remove>
    <Remove>NewDataSet/PLSLXamlComponentClassVersion/CreatedBy</Remove>
    <Remove>NewDataSet/PLSLXamlComponentClassVersion/PublishedBy</Remove>
    <Remove>NewDataSet/PLSLXamlComponentClassVersion/PublishedDate</Remove>
    <Remove>NewDataSet/GDIEImportClassBase/LastResult</Remove>
    <Remove>NewDataSet/GDIEImportClassBase/LastAccessed</Remove>
    <Remove>NewDataSet/SchemaRelation-PLSLXamlComponentClassVersion2PLSLComponentClassBase</Remove>
    <Remove>NewDataSet/CUSTLM42WizardChangeObjectValueClassBase</Remove>

    <!-- version dependend corrections -->
    <Remove>NewDataSet/PDRContentWidgetClassBase/Tag</Remove>
    <Remove>NewDataSet/PDRDataQueryClassBase/Tag</Remove>
    <Remove>NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element/xs:complexType/xs:sequence/xs:element[@name='Tag']</Remove>
    <Remove>NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='SPSAssetClassBase']/xs:complexType/xs:sequence/xs:element[@name='UsedInTypeSPSAssetTypeLicenseOEM']</Remove>
    <Remove>NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='SPSAssetClassOrder']/xs:complexType/xs:sequence/xs:element[@name='UsedInTypeSPSAssetTypeLicenseOEM']</Remove>
    <Remove>NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='SPSAssetClassBase']/xs:complexType/xs:sequence/xs:element[@name='UsedInTypeSPSAssetTypeLicenseUpdate']</Remove>
    <Remove>NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='SPSAssetClassOrder']/xs:complexType/xs:sequence/xs:element[@name='UsedInTypeSPSAssetTypeLicenseUpdate']</Remove>
	<!-- Attributes only available in v10 -->
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/PLSLXamlComponentClassBase/UseWorkflowWorker
	</Remove>
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='PLSLXamlComponentClassBase']/xs:complexType/xs:sequence/xs:element[@name='UseWorkflowWorker']
	</Remove>
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/PLSLXamlComponentClassBase/AllowCloudWorker
	</Remove>
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/PLSLXamlComponentClassBase/MonitoringLevel
	</Remove>
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='PLSLXamlComponentClassBase']/xs:complexType/xs:sequence/xs:element[@name='AllowCloudWorker']
	</Remove>
	<Remove>
		<VersionRange From="*.*.*.*" To="9.1.3.2754"/>
		NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element[@name='PLSLXamlComponentClassBase']/xs:complexType/xs:sequence/xs:element[@name='MonitoringLevel']
	</Remove>
    <Remove>
      <VersionRange From="9.0.3.0" To="*.*.*.*"/>
      NewDataSet/PDRContentWidgetTemplateClassViewCustom/OriginalBase
    </Remove>
    <Remove>
      <VersionRange From="9.0.3.0" To="*.*.*.*"/>
      NewDataSet/xs:schema/xs:element/xs:complexType/xs:choice/xs:element/xs:complexType/xs:sequence/xs:element[@name='OriginalBase']
    </Remove>
    <Remove>
      <VersionRange From="*.*.*.*" To="12.0.0.*"/>
		//PDRAudienceClass[UsedInTypePDRDataQueryType] | //SchemaRelation-PDRAudienceClass2SPSUserClassBase[Users = //PDRAudienceClass[UsedInTypePDRDataQueryType]/ID] | //SchemaRelation-PDRAudienceClass2SPSSecurityClassRole[Roles = //PDRAudienceClass[UsedInTypePDRDataQueryType]/ID] | //SchemaRelation-PDRAudienceClass2SPSOrgUnitClassBase[OUs = //PDRAudienceClass[UsedInTypePDRDataQueryType]/ID] | //SchemaRelation-PDRAudienceClass2SPSLocationClassBase[Locations = //PDRAudienceClass[UsedInTypePDRDataQueryType]/ID] | //SchemaRelation-PDRAudienceClass2PDRAudienceClass[ApplyTo = //PDRAudienceClass[UsedInTypePDRDataQueryType]/ID]
    </Remove>
    <Remove>
      <VersionRange From="*.*.*.*" To="12.0.0.*"/>
		//PDRDataQueryClassBase/Priority
    </Remove>
    <Remove>
      <VersionRange From="*.*.*.*" To="12.0.0.*"/>
		//xs:element[@name='PDRDataQueryClassBase']//xs:element[@name='Priority']
    </Remove>
    <Remove>
      <VersionRange From="*.*.*.*" To="12.0.0.*"/>
		//xs:element[@name='PDRAudienceClass']//xs:element[@name='UsedInTypePDRDataQueryType']
    </Remove>
    <Remove>
      <VersionRange From="*.*.*.*" To="12.0.1.1123"/>
		NewDataSet/PDRActionClassBase/ReloadPageOnSuccess
    </Remove>
    <!-- removement of object ids -->
    <Remove>NewDataSet/SPSArticleClassBase/ArticleID</Remove>
    <Remove>NewDataSet/SPSOrgUnitClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSCostCenterClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSLocationClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSSupplierClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSStockKeepingUnitClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSAssetClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SVCServiceProvisioningClassBaseCreateWFChange/ConfigurationID</Remove>
    <Remove>NewDataSet/SPSActivityTemplateClassBase/ObjectId</Remove>
    <Remove>NewDataSet/SPSArticleCategoryClassBase/ObjectId</Remove>

    <!-- set all new installed workflows to state 'new' (10101) -->
	<Replace Value="1">/NewDataSet/PLSLXamlComponentClassBase/UseWorkflowWorker</Replace>
	<Replace Value="10102">NewDataSet/SPSCommonClassBase[TypeID='b11c6ae9-3d91-e111-489e-6cf049029115']/State</Replace>

    <!-- set all new installed compliance rules to state 'inactive' (2036) -->
    <Replace Value="2036">NewDataSet/SPSCommonClassBase[TypeID='4083df94-6f60-4cf9-a80c-11522313eebe']/State</Replace>
	<Replace Value="%M42ServerInfo_SqlDatabase%">/NewDataSet/GDIEImportClassDatabase/Database</Replace>
	<Replace Value="%M42ServerInfo_SqlServer%">/NewDataSet/GDIEImportClassDatabase/Server</Replace>
	<!-- set all new installed workflow monitoring level to 0 -->
    <Replace Value="0">NewDataSet/PLSLXamlComponentClassBase/MonitoringLevel</Replace>
    <!-- set all new installed workflow debug mode to 0 -->
    <Replace Value="0">NewDataSet/PLSLXamlComponentClassBase/DebugMode</Replace>
  </Removements>
</C4IT-M42-SchemaInstaller>
