Index: modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oaiPostFeed.wf.st
===================================================================
--- modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oaiPostFeed.wf.st	(revision 46601)
+++ modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oaiPostFeed.wf.st	(revision 46602)
@@ -6,78 +6,54 @@
 		<PARAM required="true" type="string" name="api" managedBy="system">$params.("dataprovider:interface")$</PARAM>
 	</PARAMETERS>
 	<ARCS>
-		<ARC to="setFormat"/>
+		<ARC to="prepareOAI"/>
 	</ARCS>
 </NODE>
-
-<NODE name="setFormat" type="SetFormatInfo">
-     <DESCRIPTION>Set Format Info</DESCRIPTION>
-     <PARAMETERS>
-         <PARAM managedBy="user" name="format" required="true" type="string">DMF</PARAM>
-         <PARAM managedBy="user" name="layout" required="true" type="string">store</PARAM>
-         <PARAM managedBy="user" name="interpretation" required="true" type="string">transformed</PARAM>
-         <PARAM managedBy="system" name="formatParam" required="true" type="string">oai_format</PARAM>
-         <PARAM managedBy="system" name="layoutParam" required="true" type="string">oai_layout</PARAM>
-         <PARAM managedBy="system" name="interpretationParam" required="true" type="string">oai_interpretation</PARAM>
-     </PARAMETERS>
-     <ARCS>
-         <ARC to="prepareOAI"/>
-     </ARCS>
- </NODE>
  
- <NODE name="prepareOAI" type="PrepareOaiJob">
+<NODE name="prepareOAI" type="PrepareOaiJob">
      <DESCRIPTION>Prepare oai feeding</DESCRIPTION>
      <PARAMETERS>
-         <PARAM managedBy="system" name="oaiStoreCollectionParam" required="true" type="string">oaiStoreCollection</PARAM>
-         <PARAM managedBy="user" name="oaiDBName" required="true" type="string">oaistore_dnet</PARAM>
-         <PARAM managedBy="system" name="oaiDBNameParam" required="true" type="string">oai_dbName</PARAM>
+		<PARAM managedBy="user" name="oaiDbName" required="true" type="string">oaistore_dnet</PARAM>
+		<PARAM managedBy="user" name="oaiFormat" required="true" type="string">DMF</PARAM>
+		<PARAM managedBy="user" name="oaiLayout" required="true" type="string">store</PARAM>
+		<PARAM managedBy="user" name="oaiInterpretation" required="true" type="string">transformed</PARAM>
+		<PARAM name="oaiSource" managedBy="system" type="string" required="true">$params.("dataprovider:name")$</PARAM>
      </PARAMETERS>
      <ARCS>
-         <ARC to="CompoundIndexes"/>
+		<ARC to="CompoundIndexes"/>
      </ARCS>
- </NODE>
+</NODE>
  
- <NODE name="CompoundIndexes" type="OAICreateIndex">
+<NODE name="CompoundIndexes" type="OAICreateIndex">
      <DESCRIPTION>Create composite indexes for the OAI store</DESCRIPTION>
      <PARAMETERS>
-         <PARAM managedBy="system" name="dbNameParam" required="true" type="string">oai_dbName</PARAM>
-         <PARAM managedBy="system" name="oaiStoreCollectionParam" required="true" type="string">oaiStoreCollection</PARAM>
-         <PARAM managedBy="user" name="fieldNames" required="true" type="string">set,datestamp</PARAM>
+		<PARAM managedBy="user" name="fieldNames" required="true" type="string">set,datestamp</PARAM>
      </PARAMETERS>
      <ARCS>
-         <ARC to="ConfigIndexes"/>
+		<ARC to="ConfigIndexes"/>
      </ARCS>
- </NODE>
+</NODE>
  
- <NODE name="ConfigIndexes" type="OAIEnsureIndexes">
-     <DESCRIPTION>Ensure an index exists on fields as specified in the configuration profile</DESCRIPTION>
-     <PARAMETERS>
-         <PARAM managedBy="system" name="dbNameParam" required="true" type="string">oai_dbName</PARAM>
-         <PARAM managedBy="system" name="oaiStoreCollectionParam" required="true" type="string">oaiStoreCollection</PARAM>
-     </PARAMETERS>
+<NODE name="ConfigIndexes" type="OAIEnsureIndexes">
+     <DESCRIPTION>Create indexes on fields as specified in the configuration profile</DESCRIPTION>
+     <PARAMETERS></PARAMETERS>
      <ARCS>
-         <ARC to="SetsCount"/>
+		<ARC to="RefreshConfig"/>
      </ARCS>
+</NODE>
+<NODE name="RefreshConfig" type="OAIRefreshConfiguration">
+	<DESCRIPTION>Reads the current OAI configuration and updates the OAI sets accordingly</DESCRIPTION>
+		<PARAMETERS></PARAMETERS>
+		<ARCS>
+			<ARC to="SetsCount" />
+		</ARCS>
  </NODE>
- 
- <NODE name="SetsCount" type="OAISetsCountUpdate">
+<NODE name="SetsCount" type="OAISetsCountUpdate">
      <DESCRIPTION>Count records in each OAI set, for each exported metadata format linked to the given oai collection</DESCRIPTION>
      <PARAMETERS>
-         <PARAM managedBy="system" name="dbNameParam" required="true" type="string">oai_dbName</PARAM>
-         <PARAM managedBy="system" name="oaiStoreCollectionParam" required="true" type="string">oaiStoreCollection</PARAM>
-         <PARAM managedBy="user" name="configuredOnly" required="true" type="boolean">false</PARAM>
+		<PARAM managedBy="system" name="configuredOnly" required="true" type="boolean">true</PARAM>
      </PARAMETERS>
      <ARCS>
-         <ARC to="ConfigSets"/>
+		<ARC to="success"/>
      </ARCS>
- </NODE>
- 
- <NODE name="ConfigSets" type="RefreshSetsFromConfig">
-     <DESCRIPTION>Reads the current OAI configuration and upsert OAI sets accordingly (counts are updated as well)</DESCRIPTION>
-     <PARAMETERS>
-         <PARAM managedBy="system" name="dbNameParam" required="true" type="string">oai_dbName</PARAM>
-     </PARAMETERS>
-     <ARCS>
-         <ARC to="success"/>
-     </ARCS>
- </NODE>
\ No newline at end of file
+</NODE>
\ No newline at end of file
Index: modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/repobye.wf.st
===================================================================
--- modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/repobye.wf.st	(revision 46601)
+++ modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/repobye.wf.st	(revision 46602)
@@ -46,6 +46,44 @@
 		<PARAM required="true" type="string" name="indexId" managedBy="system">$params.("index_id")$</PARAM>
 	</PARAMETERS>
 	<ARCS>
+		<ARC to="prepareOAI"/>
+	</ARCS>
+</NODE>
+
+<NODE name="prepareOAI" type="PrepareOaiJob">
+     <DESCRIPTION>Prepare oai feeding</DESCRIPTION>
+     <PARAMETERS>
+		<PARAM managedBy="user" name="oaiDbName" required="true" type="string">oaistore_dnet</PARAM>
+		<PARAM managedBy="user" name="oaiFormat" required="true" type="string">DMF</PARAM>
+		<PARAM managedBy="user" name="oaiLayout" required="true" type="string">store</PARAM>
+		<PARAM managedBy="user" name="oaiInterpretation" required="true" type="string">transformed</PARAM>
+		<PARAM name="oaiSource" managedBy="system" type="string" required="true">$params.("dataprovider:name")$</PARAM>
+     </PARAMETERS>
+     <ARCS>
+		<ARC to="DropOAIStore"/>
+     </ARCS>
+</NODE>
+
+<NODE name="DropOAIStore" type="OAIDropStore">
+	<DESCRIPTION>Delete the OAI store for this repo</DESCRIPTION>
+	<PARAMETERS>
+		<PARAM managedBy="user" name="oaiDbName" required="true" type="string">oaistore_dnet</PARAM>
+        <PARAM managedBy="user" name="oaiFormat" required="true" type="string">DMF</PARAM>
+        <PARAM managedBy="user" name="oaiLayout" required="true" type="string">store</PARAM>
+        <PARAM managedBy="user" name="oaiInterpretation" required="true" type="string">transformed</PARAM>
+        <PARAM name="oaiSource" managedBy="system" type="string" required="true">$params.("dataprovider:name")$</PARAM>
+	</PARAMETERS>
+	<ARCS>
+		<ARC to="OAISetsCountUpdate"/>
+	</ARCS>
+</NODE>
+
+<NODE name="OAISetsCountUpdate" type="OAISetsCountUpdate">
+	<DESCRIPTION>Update counts on OAI configuration sets</DESCRIPTION>
+	<PARAMETERS>
+		<PARAM managedBy="user" name="configuredOnly" required="true" type="boolean">true</PARAM>
+	</PARAMETERS>
+	<ARCS>
 		<ARC to="RemoveApiExtraFields"/>
 	</ARCS>
 </NODE>
Index: modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oai.wf.st
===================================================================
--- modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oai.wf.st	(revision 46601)
+++ modules/dnet-aggregative-basic-workflows/trunk/src/main/resources/eu/dnetlib/msro/aggregative/workflows/repo/oai.wf.st	(revision 46602)
@@ -6,19 +6,15 @@
 		<PARAM required="true" type="string" name="api" managedBy="system">$params.("dataprovider:interface")$</PARAM>
 	</PARAMETERS>
 	<ARCS>
-		<ARC to="readMDStore"/>
+		<ARC to="fetchMDStore"/>
 	</ARCS>
 </NODE>
 
-<NODE name="readMDStore" type="ReadMDStore">
+<NODE name="fetchMDStore" type="FetchMDStoreRecords">
 	<DESCRIPTION>Read from mdstore</DESCRIPTION>
 	<PARAMETERS>
 		<PARAM name="eprParam" managedBy="system" type="string" required="true">oai_epr</PARAM>
-		<PARAM name="mdFormatName" managedBy="system" type="string" required="true">$params.("tran_format")$</PARAM>
-		<PARAM name="mdFormatLayout" managedBy="system" type="string" required="true">$params.("tran_layout")$</PARAM>
-		<PARAM name="mdFormatInterpretation" managedBy="system" type="string" required="true">$params.("tran_interpretation")$</PARAM>
-		<PARAM name="datasource" managedBy="system" type="string" required="true">$params.("dataprovider:id")$</PARAM>
-		<PARAM name="mdstoreId" managedBy="system" type="string" required="true">$params.("tran_id")$</PARAM>
+		<PARAM name="mdId" managedBy="system" type="string" required="true">$params.("tran_id")$</PARAM>
 	</PARAMETERS>
 	<ARCS>
 		<ARC to="oaiSync" />
@@ -29,10 +25,11 @@
 	<DESCRIPTION>Synchronizes OAI stores</DESCRIPTION>
 	<PARAMETERS>
 		<PARAM name="eprParam" managedBy="system" type="string" required="true">oai_epr</PARAM>
-		<PARAM name="oai_dbName" managedBy="user" type="string" required="true">oaistore_dnet</PARAM>
-		<PARAM name="formatParam" managedBy="user" type="string" required="true">oai_formatName</PARAM>
-		<PARAM name="layoutParam" managedBy="user" type="string" required="true">oai_formatLayout</PARAM>
-		<PARAM name="interpretationParam" managedBy="user" type="string" required="true">oai_formatInterpretation</PARAM>
+		<PARAM name="oaiSource" managedBy="system" type="string" required="true">$params.("dataprovider:name")$</PARAM>
+		<PARAM name="oaiDbName" managedBy="user" type="string" required="true">oaistore_dnet</PARAM>
+		<PARAM name="oaiFormat" managedBy="user" type="string" required="true">$params.("tran_format")$</PARAM>
+		<PARAM name="oaiLayout" managedBy="user" type="string" required="true">$params.("tran_layout")$</PARAM>
+		<PARAM name="oaiInterpretation" managedBy="user" type="string" required="true">$params.("tran_interpretation")$</PARAM>
 	</PARAMETERS>
 	<ARCS>
 		<ARC to="success" />
