Project

General

Profile

« Previous | Next » 

Revision 52120

xqueries to turn all aggregation workflow with incremental transformation

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/patch-db/incrementalTransformation_migration.xqueries
1
#1. Take all transformation workflows and change the arc to select the currently non existing node "selectIncrementalTransformation"
2

  
3
for $x in collection('/db/DRIVER/WorkflowDSResources/WorkflowDSResourceType')
4
let $arc := $x[.//WORKFLOW_NAME='transform']/RESOURCE_PROFILE/BODY/CONFIGURATION/NODE[./@type='SetProviderInfo' and ./@isStart='true']/ARCS/ARC[./@to ='fetchOriginals']
5
return update value $arc/@to with 'selectIncrementalTransformation'
6

  
7
#2. Now we add the missing node just after the start node
8

  
9
for $x in collection('/db/DRIVER/WorkflowDSResources/WorkflowDSResourceType')
10
let $startnode := $x[.//WORKFLOW_NAME='transform']/RESOURCE_PROFILE/BODY/CONFIGURATION/NODE[./@type='SetProviderInfo' and ./@isStart='true']
11
return update insert
12
<NODE name="selectIncrementalTransformation" type="IncrementalTransformation">
13
	<DESCRIPTION>Decide REFRESH/INCREMENTAL transformation</DESCRIPTION>
14
	<PARAMETERS>
15
		<PARAM required="true" type="string" name="transformationType" managedBy="user" function="validValues(['REFRESH','INCREMENTAL'])">INCREMENTAL</PARAM>
16
	</PARAMETERS>
17
	<ARCS>
18
		<ARC to="fetchOriginals"/>
19
	</ARCS>
20
</NODE>
21
following $startnode

Also available in: Unified diff