<?xml version="1.0" encoding="UTF-8"?>
<RESOURCE_PROFILE>
	<HEADER>
		<RESOURCE_IDENTIFIER value="b54ff264-ed25-46a5-86df-dfbefb0b22be_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ=="/>
		<RESOURCE_TYPE value="WorkflowTemplateDSResourceType"/>
		<RESOURCE_KIND value="WorkflowTemplateDSResources"/>
		<RESOURCE_URI value=""/>
		<DATE_OF_CREATION value="2016-09-20T12:00:00.0Z"/>
	</HEADER>
	<BODY>
		<CONFIGURATION>
			<PARAMETERS>
				<PARAM name="dsId" description="Datasource Id" required="true" type="string"/>
				<PARAM name="dsName" description="Datasource Name" required="true" type="string"/>
				<PARAM name="interface" description="Datasource Interface" required="true" type="string"/>
				<PARAM name="collMdstoreId" description="Store for collected records" required="true" type="string"/>
				<PARAM name="cleanMdstoreId" description="Store for transformed records" required="true" type="string"/>
				<PARAM name="indexId" description="Index Identifier" required="true" type="string"/>
				<PARAM name="OAIFormat" description="OAI Format" required="true" type="string"/>
				<PARAM name="OAILayout" description="OAI Layout" required="true" type="string"/>
				<PARAM name="OAIInterpretation" description="OAI Interpretation" required="true" type="string"/>
				<PARAM name="OAIDBName" description="OAI Database Name" required="true" type="string"/>
			</PARAMETERS>
			<WORKFLOW>
				<NODE name="deleteCollMdStore" type="DeleteMDStore" isStart="true">
					<DESCRIPTION>Delete the mdstore of collected records</DESCRIPTION>
					<PARAMETERS>
						<PARAM name="mdstoreId" ref="collMdstoreId"/>
					</PARAMETERS>
					<ARCS>
						<ARC to="deleteCleanMdStore"/>
					</ARCS>
				</NODE>
				<NODE name="deleteCleanMdStore" type="DeleteMDStore">
					<DESCRIPTION>Delete the mdstore of cleaned records</DESCRIPTION>
					<PARAMETERS>
						<PARAM name="mdstoreId" ref="cleanMdstoreId"/>
					</PARAMETERS>
					<ARCS>
						<ARC to="deleteIndex"/>
					</ARCS>
				</NODE>
				<NODE name="deleteIndex" type="DeleteIndex">
					<DESCRIPTION>Delete the index</DESCRIPTION>
					<PARAMETERS>
						<PARAM name="indexId" ref="indexId"/>
					</PARAMETERS>
					<ARCS>
						<ARC to="removeApiExtraFields"/>
					</ARCS>
				</NODE>
				<NODE name="removeApiExtraFields" type="RemoveApiExtraFields">
					<DESCRIPTION>Reset the extrafields of the api</DESCRIPTION>
					<PARAMETERS>
						<PARAM name="datasourceId" ref="dsId"/>
						<PARAM name="datasourceInterface" ref="interface"/>
						<PARAM name="fields">
							<LIST>
								<ITEM value="last_collection_total"/>
								<ITEM value="last_collection_date"/>
								<ITEM value="last_collection_mdId"/>
								<ITEM value="last_aggregation_total"/>
								<ITEM value="last_aggregation_date"/>
								<ITEM value="last_aggregation_mdId"/>
							</LIST>
						</PARAM>
					</PARAMETERS>
					<ARCS>
						<ARC to="dropOAIStore"/>
					</ARCS>
				</NODE>
				<NODE name="dropOAIStore" type="OAIDropStore">
					<DESCRIPTION>Delete from OAI-PMH</DESCRIPTION>
					<PARAMETERS>
						<PARAM name="oaiFormat" ref="OAIFormat"/>
						<PARAM name="oaiLayout" ref="OAILayout"/>
						<PARAM name="oaiInterpretation" ref="OAIInterpretation"/>
						<PARAM name="oaiDbName" ref="OAIDBName"/>
					</PARAMETERS>
					<ARCS>
						<ARC to="success"/>
					</ARCS>
				</NODE>
			</WORKFLOW>
		</CONFIGURATION>
	</BODY>
</RESOURCE_PROFILE>
