Project

General

Profile

1
#0. READ EVERYTHING BEFORE RUNNING ANY XUPDATE
2
#1. Take all transformation workflows and change the arc to select the currently non existing node "selectIncrementalTransformation"
3

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

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

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

    
24
with the current commit, we must update the param 'transformationType' to 'operationType'.
25
This can be done with this xquery (for BETA):
26

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

    
32

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

    
35
NOTE: if there are already incremental workflows, the xupdate in #2. will screw them up
36
creating a duplicate IncrementalTransformation node that must be deleted.
(1-1/16)