gd_bam 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,94 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="fluke" created="Tue Feb 05 15:38:24 PST 2013" guiVersion="3.3.1" id="1360179808937" licenseType="Commercial" modified="Wed Feb 27 14:46:54 PST 2013" modifiedBy="fluke" name="process_name" revision="1.16" showComponentDetails="true">
3
+ <Global>
4
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_in.xml" id="Metadata1"/>
5
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_out.xml" id="Metadata3"/>
6
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_in.xml" id="Metadata2"/>
7
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_out.xml" id="Metadata4"/>
8
+ <MetadataGroup id="ComponentGroup0" name="metadata"/>
9
+ <Property fileURL="params.txt" id="GraphParameter0"/>
10
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
11
+ <LookupTable charset="ISO-8859-1" id="LookupTable0" initialSize="512" key="MasterLabel" metadata="Metadata4" name="StageLookup" type="simpleLookup"/>
12
+ <Dictionary/>
13
+ </Global>
14
+ <Phase number="0">
15
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/stage.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="139" guiY="26" id="DATA_READER3" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
16
+ <Node enabled="enabled" guiHeight="65" guiName="LookupTableReaderWriter" guiWidth="177" guiX="528" guiY="26" id="LOOKUP_TABLE_READER_WRITER0" lookupTable="LookupTable0" type="LOOKUP_TABLE_READER_WRITER"/>
17
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="330" guiY="26" id="REFORMAT2" type="REFORMAT">
18
+ <attr name="transform"><![CDATA[//#CTL2
19
+ long m_count = 0;
20
+ // Transforms input record into output record.
21
+ function integer transform() {
22
+ $out.0.* = $in.0.*;
23
+ return ALL;
24
+ }
25
+
26
+ // Called during component initialization.
27
+ // function boolean init() {}
28
+
29
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
30
+ // required by the transform. All resources allocated within this method should be released
31
+ // by the postExecute() method.
32
+ // function void preExecute() {}
33
+
34
+ // Called only if transform() throws an exception.
35
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
36
+
37
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
38
+ // allocated within the preExecute() method.
39
+ // function void postExecute() {}
40
+
41
+ // Called to return a user-defined error message when an error occurs.
42
+ // function string getMessage() {}
43
+ ]]></attr>
44
+ </Node>
45
+ <Edge fromNode="DATA_READER3:0" guiBendpoints="" guiRouter="Manhattan" id="Edge23" inPort="Port 0 (in)" metadata="Metadata2" outPort="Port 0 (output)" toNode="REFORMAT2:0"/>
46
+ <Edge fromNode="REFORMAT2:0" guiBendpoints="" guiRouter="Manhattan" id="Edge14" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="LOOKUP_TABLE_READER_WRITER0:0"/>
47
+ </Phase>
48
+ <Phase number="1">
49
+ <Node enabled="enabled" fileURL="${PROJECT}/data/opportunitysnapshot.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="127" guiY="205" id="DATA_READER0" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
50
+ <Node enabled="enabled" fileURL="${PROJECT}/data/opportunitysnapshot_out.csv" guiHeight="89" guiName="CSV Writer" guiWidth="128" guiX="612" guiY="205" id="DATA_WRITER0" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
51
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="368" guiY="211" id="REFORMAT0" type="REFORMAT">
52
+ <attr name="transform"><![CDATA[//#CTL2
53
+
54
+ // Transforms input record into output record.
55
+ function integer transform() {
56
+ in_2 myRecord;
57
+ myRecord = lookup(StageLookup).get($in.0.StageName);
58
+ string status = (myRecord.IsClosed=='false')?'Open':(myRecord.IsWon=='true')?'Won':'Lost';
59
+
60
+
61
+ $out.0.* = $in.0.*;
62
+ $out.0.snapshot = date2str(str2date("2011-01-01","yyyy-MM-dd"), "yyyy-MM-dd");
63
+ $out.0.CreatedDate = date2str(str2date($in.0.CreatedDate,"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"), "yyyy-MM-dd");
64
+
65
+ // $out.0.days_to_close = status == "Open" ? toString(abs(dateDiff(str2date($in.0.CloseDate, 'yyyy-MM-dd'), today(), day))) : "0";
66
+ // $out.0.snapshot = date2str(dateAdd(str2date('1900-01-01', 'yyyy-MM-dd'), str2long($in.0.snapshot) - 1, day), "yyyy-MM-dd");
67
+
68
+ return ALL;
69
+ }
70
+
71
+
72
+ // Called during component initialization.
73
+ // function boolean init() {}
74
+
75
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
76
+ // required by the transform. All resources allocated within this method should be released
77
+ // by the postExecute() method.
78
+ // function void preExecute() {}
79
+
80
+ // Called only if transform() throws an exception.
81
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
82
+
83
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
84
+ // allocated within the preExecute() method.
85
+ // function void postExecute() {}
86
+
87
+ // Called to return a user-defined error message when an error occurs.
88
+ // function string getMessage() {}
89
+ ]]></attr>
90
+ </Node>
91
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
92
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata3" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
93
+ </Phase>
94
+ </Graph>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="fluke" created="Tue Feb 05 15:38:24 PST 2013" guiVersion="3.3.1" id="1360179808937" licenseType="Commercial" modified="Thu Feb 21 23:29:16 PST 2013" modifiedBy="fluke" name="process_name" revision="1.11" showComponentDetails="true">
3
+ <Global>
4
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_in.xml" id="Metadata0"/>
5
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_out.xml" id="Metadata1"/>
6
+ <MetadataGroup id="ComponentGroup0" name="metadata"/>
7
+ <Property fileURL="params.txt" id="GraphParameter0"/>
8
+ <Property fileURL="workspace.prm" id="GraphParameter1"/>
9
+ <Dictionary/>
10
+ </Global>
11
+ <Phase number="0">
12
+ <Node enabled="enabled" fileURL="data/1_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="124" guiY="169" id="DATA_READER0" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
13
+ <Node enabled="enabled" fileURL="data/out.csv" guiHeight="77" guiName="CSV Writer" guiWidth="128" guiX="609" guiY="169" id="DATA_WRITER0" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
14
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="365" guiY="175" id="REFORMAT0" type="REFORMAT">
15
+ <attr name="transform"><![CDATA[//#CTL2
16
+
17
+ // Transforms input record into output record.
18
+ function integer transform() {
19
+ $out.0.* = $in.0.*;
20
+ $out.0.Name = $in.0.FirstName + " " + $in.0.LastName;
21
+ $out.0.Url = '${SF_SERVER_FOR_LINKS}' + $in.0.Id;
22
+
23
+ return OK;
24
+ }
25
+
26
+ // Called during component initialization.
27
+ // function boolean init() {}
28
+
29
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
30
+ // required by the transform. All resources allocated within this method should be released
31
+ // by the postExecute() method.
32
+ // function void preExecute() {}
33
+
34
+ // Called only if transform() throws an exception.
35
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
36
+
37
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
38
+ // allocated within the preExecute() method.
39
+ // function void postExecute() {}
40
+
41
+ // Called to return a user-defined error message when an error occurs.
42
+ // function string getMessage() {}
43
+ ]]></attr>
44
+ </Node>
45
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
46
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
47
+ </Phase>
48
+ </Graph>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="fluke" created="Tue Feb 05 15:38:24 PST 2013" guiVersion="3.3.1" id="1360179808937" licenseType="Commercial" modified="Fri Feb 22 13:36:18 PST 2013" modifiedBy="fluke" name="process_name" revision="1.12" showComponentDetails="true">
3
+ <Global>
4
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_in.xml" id="Metadata0"/>
5
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_out.xml" id="Metadata1"/>
6
+ <MetadataGroup id="ComponentGroup0" name="metadata"/>
7
+ <Property fileURL="params.txt" id="GraphParameter0"/>
8
+ <Property fileURL="workspace.prm" id="GraphParameter1"/>
9
+ <Dictionary/>
10
+ </Global>
11
+ <Phase number="0">
12
+ <Node enabled="enabled" fileURL="data/1_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="124" guiY="169" id="DATA_READER0" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
13
+ <Node enabled="enabled" fileURL="data/out.csv" guiHeight="77" guiName="CSV Writer" guiWidth="128" guiX="609" guiY="169" id="DATA_WRITER0" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
14
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="365" guiY="175" id="REFORMAT0" type="REFORMAT">
15
+ <attr name="transform"><![CDATA[//#CTL2
16
+
17
+ // Transforms input record into output record.
18
+ function integer transform() {
19
+ string status = ($in.0.IsClosed=='false')?'Open':($in.0.IsWon=='true')?'Won':'Lost';
20
+
21
+ $out.0.* = $in.0.*;
22
+ $out.0.status = status;
23
+ $out.0.SortOrder = "0";
24
+ $out.0.label = $in.0.Id;
25
+
26
+ return ALL;
27
+ }
28
+
29
+ // Called during component initialization.
30
+ // function boolean init() {}
31
+
32
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
33
+ // required by the transform. All resources allocated within this method should be released
34
+ // by the postExecute() method.
35
+ // function void preExecute() {}
36
+
37
+ // Called only if transform() throws an exception.
38
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
39
+
40
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
41
+ // allocated within the preExecute() method.
42
+ // function void postExecute() {}
43
+
44
+ // Called to return a user-defined error message when an error occurs.
45
+ // function string getMessage() {}
46
+ ]]></attr>
47
+ </Node>
48
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
49
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
50
+ </Phase>
51
+ </Graph>
@@ -0,0 +1,184 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="gdc-defectivedisplay" created="Thu Mar 07 20:20:14 PST 2013" guiVersion="3.3.2" id="1362726965567" licenseCode="CLP1DGOODD71636137BY" licenseType="Commercial" modified="Sun Mar 17 16:54:19 PDT 2013" modifiedBy="gdc-defectivedisplay" name="process_opportunity_line_item" revision="1.23" showComponentDetails="true">
3
+ <Global>
4
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_in.xml" id="Metadata0"/>
5
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_out.xml" id="Metadata1"/>
6
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_in.xml" id="Metadata2"/>
7
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_out.xml" id="Metadata3"/>
8
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/3_in.xml" id="Metadata4"/>
9
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/3_out.xml" id="Metadata5"/>
10
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/4_in.xml" id="Metadata6"/>
11
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/4_out.xml" id="Metadata7"/>
12
+ <Property fileURL="params.txt" id="GraphParameter0"/>
13
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
14
+ <Dictionary/>
15
+ </Global>
16
+ <Phase number="0">
17
+ <Node enabled="enabled" fileURL="data/1_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="74" guiY="51" id="DATA_READER0" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
18
+ <Node enabled="enabled" fileURL="data/2_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="74" guiY="153" id="DATA_READER1" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
19
+ <Node enabled="enabled" fileURL="data/3_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="74" guiY="388" id="DATA_READER2" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
20
+ <Node enabled="enabled" fileURL="data/4_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="60" guiY="539" id="DATA_READER3" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
21
+ <Node enabled="enabled" fileURL="data/out.csv" guiHeight="77" guiName="CSV Writer" guiWidth="128" guiX="1142" guiY="533" id="DATA_WRITER0" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
22
+ <Node enabled="enabled" guiHeight="89" guiName="ExtMergeJoin" guiWidth="128" guiX="488" guiY="113" id="EXT_MERGE_JOIN0" joinKey="$PricebookEntryId(a)#$Id(a);" joinType="leftOuter" type="EXT_MERGE_JOIN">
23
+ <attr name="transform"><![CDATA[//#CTL2
24
+
25
+ // Transforms input record into output record.
26
+ function integer transform() {
27
+ $out.0.* = $in.0.*;
28
+
29
+ $out.0.PricebookEntryId = $in.1.Product2Id;
30
+
31
+ return ALL;
32
+ }
33
+
34
+ // Called during component initialization.
35
+ // function boolean init() {}
36
+
37
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
38
+ // required by the transform. All resources allocated within this method should be released
39
+ // by the postExecute() method.
40
+ // function void preExecute() {}
41
+
42
+ // Called only if transform() throws an exception.
43
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
44
+
45
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
46
+ // allocated within the preExecute() method.
47
+ // function void postExecute() {}
48
+
49
+ // Called to return a user-defined error message when an error occurs.
50
+ // function string getMessage() {}
51
+ ]]></attr>
52
+ </Node>
53
+ <Node enabled="enabled" guiHeight="89" guiName="ExtMergeJoin" guiWidth="128" guiX="609" guiY="385" id="EXT_MERGE_JOIN1" joinKey="$Id(a)#$OpportunityId(a);" joinType="leftOuter" slaveDuplicates="true" type="EXT_MERGE_JOIN">
54
+ <attr name="transform"><![CDATA[//#CTL2
55
+
56
+ // Transforms input record into output record.
57
+ function integer transform() {
58
+
59
+ $out.0.* = $in.0.*;
60
+ $out.0.Product = $in.1.PricebookEntryId;
61
+
62
+ return ALL;
63
+ }
64
+
65
+ // Called during component initialization.
66
+ // function boolean init() {}
67
+
68
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
69
+ // required by the transform. All resources allocated within this method should be released
70
+ // by the postExecute() method.
71
+ // function void preExecute() {}
72
+
73
+ // Called only if transform() throws an exception.
74
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
75
+
76
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
77
+ // allocated within the preExecute() method.
78
+ // function void postExecute() {}
79
+
80
+ // Called to return a user-defined error message when an error occurs.
81
+ // function string getMessage() {}
82
+ ]]></attr>
83
+ </Node>
84
+ <Node enabled="enabled" guiHeight="89" guiName="ExtMergeJoin" guiWidth="128" guiX="809" guiY="533" id="EXT_MERGE_JOIN2" joinKey="$StageName(a)#$MasterLabel(a);" joinType="leftOuter" slaveDuplicates="true" type="EXT_MERGE_JOIN">
85
+ <attr name="transform"><![CDATA[//#CTL2
86
+
87
+ // Transforms input record into output record.
88
+ function integer transform() {
89
+
90
+ $out.0.* = $in.0.*;
91
+
92
+ $out.0.IsClosed = $in.1.IsClosed;
93
+ $out.0.IsWon = $in.1.IsWon;
94
+
95
+ return ALL;
96
+ }
97
+
98
+ // Called during component initialization.
99
+ // function boolean init() {}
100
+
101
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
102
+ // required by the transform. All resources allocated within this method should be released
103
+ // by the postExecute() method.
104
+ // function void preExecute() {}
105
+
106
+ // Called only if transform() throws an exception.
107
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
108
+
109
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
110
+ // allocated within the preExecute() method.
111
+ // function void postExecute() {}
112
+
113
+ // Called to return a user-defined error message when an error occurs.
114
+ // function string getMessage() {}
115
+ ]]></attr>
116
+ </Node>
117
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="252" guiY="51" id="EXT_SORT0" sortKey="PricebookEntryId(a)" type="EXT_SORT"/>
118
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="252" guiY="153" id="EXT_SORT1" sortKey="Id" type="EXT_SORT"/>
119
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="252" guiY="388" id="EXT_SORT2" sortKey="Id(a)" type="EXT_SORT"/>
120
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="482" guiY="236" id="EXT_SORT3" sortKey="OpportunityId(a)" type="EXT_SORT"/>
121
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="283" guiY="539" id="EXT_SORT4" sortKey="MasterLabel(a)" type="EXT_SORT"/>
122
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="790" guiY="385" id="EXT_SORT5" sortKey="StageName(a)" type="EXT_SORT"/>
123
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="989" guiY="533" id="REFORMAT0" type="REFORMAT">
124
+ <attr name="transform"><![CDATA[//#CTL2
125
+
126
+ // Transforms input record into output record.
127
+ function integer transform() {
128
+ $out.0.* = $in.0.*;
129
+
130
+ // if ($in.0.Snapshot == "" || $in.0.Snapshot == null) {
131
+ // $out.0.Snapshot = '2013-01-08';
132
+ // }
133
+
134
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) < "1950") {
135
+ $out.0.CloseDate = '1950-01-01';
136
+ }
137
+
138
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) > "2049") {
139
+ $out.0.CloseDate = '2049-01-01';
140
+ }
141
+
142
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "") {
143
+ $out.0.CreatedDate = left($in.0.CreatedDate, 10);
144
+ }
145
+
146
+
147
+ return ALL;
148
+ }
149
+
150
+ // Called during component initialization.
151
+ // function boolean init() {}
152
+
153
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
154
+ // required by the transform. All resources allocated within this method should be released
155
+ // by the postExecute() method.
156
+ // function void preExecute() {}
157
+
158
+ // Called only if transform() throws an exception.
159
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
160
+
161
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
162
+ // allocated within the preExecute() method.
163
+ // function void postExecute() {}
164
+
165
+ // Called to return a user-defined error message when an error occurs.
166
+ // function string getMessage() {}
167
+ ]]></attr>
168
+ </Node>
169
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="EXT_SORT0:0"/>
170
+ <Edge fromNode="DATA_READER1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge2" inPort="Port 0 (in)" metadata="Metadata2" outPort="Port 0 (output)" toNode="EXT_SORT1:0"/>
171
+ <Edge fromNode="DATA_READER2:0" guiBendpoints="" guiRouter="Manhattan" id="Edge5" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (output)" toNode="EXT_SORT2:0"/>
172
+ <Edge fromNode="DATA_READER3:0" guiBendpoints="" guiRouter="Manhattan" id="Edge10" inPort="Port 0 (in)" metadata="Metadata6" outPort="Port 0 (output)" toNode="EXT_SORT4:0"/>
173
+ <Edge debugMode="true" fromNode="EXT_MERGE_JOIN0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge8" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="EXT_SORT3:0"/>
174
+ <Edge fromNode="EXT_MERGE_JOIN1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge13" inPort="Port 0 (in)" metadata="Metadata5" outPort="Port 0 (out)" toNode="EXT_SORT5:0"/>
175
+ <Edge debugMode="false" fromNode="EXT_MERGE_JOIN2:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata5" outPort="Port 0 (out)" toNode="REFORMAT0:0"/>
176
+ <Edge debugMode="false" fromNode="EXT_SORT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge3" inPort="Port 0 (driver)" metadata="Metadata0" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN0:0"/>
177
+ <Edge debugMode="false" fromNode="EXT_SORT1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge4" inPort="Port 1 (slave)" metadata="Metadata2" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN0:1"/>
178
+ <Edge debugMode="false" fromNode="EXT_SORT2:0" guiBendpoints="" guiRouter="Manhattan" id="Edge7" inPort="Port 0 (driver)" metadata="Metadata4" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN1:0"/>
179
+ <Edge fromNode="EXT_SORT3:0" guiBendpoints="" guiRouter="Manhattan" id="Edge9" inPort="Port 1 (slave)" metadata="Metadata1" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN1:1"/>
180
+ <Edge fromNode="EXT_SORT4:0" guiBendpoints="" guiRouter="Manhattan" id="Edge11" inPort="Port 1 (slave)" metadata="Metadata6" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN2:1"/>
181
+ <Edge fromNode="EXT_SORT5:0" guiBendpoints="" guiRouter="Manhattan" id="Edge12" inPort="Port 0 (driver)" metadata="Metadata5" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN2:0"/>
182
+ <Edge debugMode="false" fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge6" inPort="Port 0 (in)" metadata="Metadata5" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
183
+ </Phase>
184
+ </Graph>
@@ -0,0 +1,140 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="gdc-defectivedisplay" created="Sat Mar 16 12:07:29 PDT 2013" guiVersion="3.3.2" id="1363463772522" licenseCode="CLP1DGOODD71636137BY" licenseType="Commercial" modified="Mon Mar 18 14:06:35 PDT 2013" modifiedBy="gdc-defectivedisplay" name="velocity" revision="1.44" showComponentDetails="true">
3
+ <Global>
4
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_in.xml" id="Metadata0"/>
5
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/1_out.xml" id="Metadata2"/>
6
+ <Metadata id="Metadata1" previewAttachmentCharset="ISO-8859-1">
7
+ <Record fieldDelimiter="," name="recordName2" previewAttachmentCharset="ISO-8859-1" recordDelimiter="\n" type="delimited">
8
+ <Field containerType="list" name="dates" nullable="false" type="string"/>
9
+ <Field name="Id" type="string"/>
10
+ <Field name="size" type="number"/>
11
+ <Field containerType="list" name="stages" nullable="false" type="string"/>
12
+ <Field containerType="list" name="sortOrders" nullable="false" type="string"/>
13
+ </Record>
14
+ </Metadata>
15
+ <Property fileURL="params.txt" id="GraphParameter0"/>
16
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
17
+ <Dictionary/>
18
+ </Global>
19
+ <Phase number="0">
20
+ <Node enabled="enabled" fileURL="${PROJECT}/data/1_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="13" guiY="119" id="DATA_READER0" quotedStrings="true" skipRows="1" type="DATA_READER"/>
21
+ <Node enabled="enabled" fileURL="${PROJECT}/data/out.csv" guiHeight="89" guiName="CSV Writer" guiWidth="128" guiX="649" guiY="119" id="DATA_WRITER0" outputFieldNames="true" quotedStrings="true" type="DATA_WRITER"/>
22
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="211" guiY="119" id="EXT_SORT0" sortKey="Id(a);Snapshot(a)" type="EXT_SORT"/>
23
+ <Node enabled="enabled" groupAccumulatorMetadataId="Metadata1" groupKeyFields="Id" guiHeight="65" guiName="Rollup" guiWidth="128" guiX="390" guiY="119" id="ROLLUP0" inputSorted="true" type="ROLLUP">
24
+ <attr name="transform"><![CDATA[//#CTL2
25
+
26
+ //string date_template = "joda:yyyy-MM-dd'T'HH:mm:ss.SSSZZ";
27
+ string date_template = "joda:yyyy-MM-dd";
28
+
29
+ // Called for the first data record in a new group. Starts the parsing of the new group.
30
+ function void initGroup(recordName2 groupAccumulator) {
31
+ groupAccumulator.Id = $0.Id;
32
+ groupAccumulator.size = 0;
33
+ }
34
+
35
+ // Called for each data record in the group (including the first one and the last one).
36
+ // Implicitly returns false => updateTransform() is not called. When returns true, calls updateTransform().
37
+ function boolean updateGroup(recordName2 groupAccumulator) {
38
+ append(groupAccumulator.dates, $0.Snapshot);
39
+ append(groupAccumulator.stages, $0.StageName);
40
+ groupAccumulator.size++;
41
+ return false;
42
+ }
43
+
44
+ // Called for the last data records in all groups sequentially, but only after all incoming data records have been parsed.
45
+ // Implicitly returns true => transform() is called for the whole group.
46
+ function boolean finishGroup(recordName2 groupAccumulator) {
47
+ return true;
48
+ }
49
+
50
+ // Called to transform data records that have been parsed so far into user-specified number of output data record(s).
51
+ // Counter (incremented by 1 starting from 0) stores the number of previous calls to this method for the current group update.
52
+ // Group accumulator can optionally be used.
53
+ // Function implicitly returns SKIP to skip sending any data records to output.
54
+ // Returning ALL causes each data record to be sent to all output port(s).
55
+ // Can also return a number of the output port to which individual data record should be sent.
56
+ function integer updateTransform(integer counter, VoidMetadata groupAccumulator) {
57
+ raiseError("Function not implemented!");
58
+ }
59
+
60
+ // Called to transform the whole group of incoming data record(s) into user-specified number of output data record(s).
61
+ // Counter (incremented by 1 starting from 0) stores the number of previous calls to this method for the current group update.
62
+ // Group accumulator can optionally be used.
63
+ // Function implicitly returns SKIP to skip sending any data records to output.
64
+ // Returning ALL causes each data record to be sent to all output port(s).
65
+ // Can also return a number of the output port to which individual data record should be sent.
66
+ function integer transform(integer counter, recordName2 groupAccumulator) {
67
+
68
+ if (counter >= length(groupAccumulator.dates)) {
69
+ return SKIP;
70
+ }
71
+
72
+ string stage = groupAccumulator.stages[counter];
73
+ date date0 = str2date(groupAccumulator.dates[0], date_template);
74
+ date date1 = str2date(groupAccumulator.dates[counter], date_template);
75
+ string velocity;
76
+ string duration;
77
+ date date2;
78
+
79
+ if(counter == (length(groupAccumulator.dates) - 1)) {
80
+ velocity = num2str(dateDiff(date1, date0, day));
81
+ duration = "0";
82
+ } else {
83
+ date2 = str2date(groupAccumulator.dates[counter + 1], date_template);
84
+ duration = num2str(dateDiff(date2, date1, day));
85
+ velocity = num2str(dateDiff(date1, date0, day));
86
+ }
87
+
88
+
89
+ //printErr([groupAccumulator.Id, stage, duration, velocity]);
90
+ $out.0.* = $in.0.*;
91
+ $out.0.Id = groupAccumulator.Id;
92
+ $out.0.StageName = stage;
93
+ $out.0.Duration = duration;
94
+ $out.0.Velocity = velocity;
95
+
96
+ return ALL;
97
+
98
+ }
99
+
100
+ // Called during component initialization.
101
+ // function void init() {}
102
+
103
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
104
+ // required by the transform. All resources allocated within this method should be released
105
+ // by the postExecute() method.
106
+ // function void preExecute() {}
107
+
108
+ // Called only if initGroup(DataRecord) throws an exception.
109
+ //function void initGroupOnError(string errorMessage, string stackTrace, VoidMetadata groupAccumulator) {
110
+ //}
111
+
112
+ // Called only if updateGroup(DataRecord) throws an exception.
113
+ //function boolean updateGroupOnError(string errorMessage, string stackTrace, VoidMetadata groupAccumulator) {
114
+ //}
115
+
116
+ // Called only if finishGroup(DataRecord) throws an exception.
117
+ //function boolean finishGroupOnError(string errorMessage, string stackTrace, VoidMetadata groupAccumulator) {
118
+ //}
119
+
120
+ // Called only if updateTransform(integer, DataRecord) throws an exception.
121
+ //function integer updateTransformOnError(string errorMessage, string stackTrace, integer counter, VoidMetadata groupAccumulator) {
122
+ //}
123
+
124
+ // Called only if transform(integer, DataRecord) throws an exception.
125
+ //function integer transformOnError(string errorMessage, string stackTrace, integer counter, VoidMetadata groupAccumulator) {
126
+ //}
127
+
128
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
129
+ // allocated within the preExecute() method.
130
+ // function void postExecute() {}
131
+
132
+ // Called to return a user-defined error message when an error occurs.
133
+ // function string getMessage() {}
134
+ ]]></attr>
135
+ </Node>
136
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="EXT_SORT0:0"/>
137
+ <Edge fromNode="EXT_SORT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge2" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (out)" toNode="ROLLUP0:0"/>
138
+ <Edge fromNode="ROLLUP0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata2" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
139
+ </Phase>
140
+ </Graph>