Project

General

Profile

« Previous | Next » 

Revision 52390

Updated instructions to migrate to incremental transformation

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/patch-db/incrementalTransformation_migration.xqueries
13 13
<NODE name="selectIncrementalTransformation" type="IncrementalTransformation">
14 14
	<DESCRIPTION>Decide REFRESH/INCREMENTAL transformation</DESCRIPTION>
15 15
	<PARAMETERS>
16
		<PARAM required="true" type="string" name="transformationType" managedBy="user" function="validValues(['REFRESH','INCREMENTAL'])">INCREMENTAL</PARAM>
16
		<PARAM required="true" type="string" name="operationType" managedBy="user" function="validValues(['REFRESH','INCREMENTAL'])">INCREMENTAL</PARAM>
17 17
	</PARAMETERS>
18 18
	<ARCS>
19 19
		<ARC to="fetchOriginals"/>
......
21 21
</NODE>
22 22
following $startnode
23 23

  
24
with the current commit, we must update the param 'transformationType' to 'operationType'.
25
This can be done with this xquery (for BETA):
24
In case there are nodes with the wrong parameter name (transformationType instead of operationType), do not worry.
25
It is a left over from previous migration and you can fix it running this xquery:
26 26

  
27 27
for $x in collection('/db/DRIVER/WorkflowDSResources/WorkflowDSResourceType')
28 28
let $transNode := $x[.//WORKFLOW_NAME='transform']/RESOURCE_PROFILE/BODY/CONFIGURATION/NODE[./@type='IncrementalTransformation']
29 29
let $param := $transNode/PARAMETERS/PARAM[@name='transformationType']
30 30
return update value $param/@name with 'operationType'
31 31

  
32

  
33
When migrating to PRODUCTION, you just need to update the query in #2. with operationType.
34

  
35 32
NOTE: if there are already incremental workflows, the xupdate in #2. will screw them up
36 33
creating a duplicate IncrementalTransformation node that must be deleted.
34
You can look for this workflows with the following xquery:
35

  
36
for $x in collection('/db/DRIVER/WorkflowDSResources/WorkflowDSResourceType')
37
where (count($x[.//NODE/@name='selectIncrementalTransformation']) > 1) return $x

Also available in: Unified diff