gd_bam 0.0.15 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.md +313 -5
  2. data/bin/bam +126 -48
  3. data/lib/bam/version.rb +1 -1
  4. data/lib/bam.rb +51 -0
  5. data/lib/base/errors.rb +15 -0
  6. data/lib/base/flow.rb +37 -0
  7. data/lib/base/graph.rb +23 -0
  8. data/lib/base/metadata.rb +107 -0
  9. data/lib/base/project.rb +95 -0
  10. data/lib/base/repo.rb +35 -0
  11. data/lib/base/sink.rb +44 -0
  12. data/lib/base/step.rb +47 -0
  13. data/lib/base/tap.rb +167 -0
  14. data/lib/base/taps.rb +19 -0
  15. data/lib/cloud_connect/dsl/cc.rb +42 -0
  16. data/lib/cloud_connect/dsl/es_helpers.rb +49 -0
  17. data/lib/cloud_connect/dsl/helpers.rb +199 -0
  18. data/lib/{nodes → cloud_connect/dsl}/nodes.rb +106 -16
  19. data/lib/cloud_connect/dsl/sf_helpers.rb +39 -0
  20. data/lib/cloud_connect/dsl/structure_helpers.rb +94 -0
  21. data/lib/commands/commands.rb +110 -0
  22. data/lib/commands/deployment.rb +217 -0
  23. data/lib/commands/docs_commands.rb +41 -0
  24. data/lib/commands/gd_commands.rb +95 -0
  25. data/lib/commands/scaffold_commands.rb +103 -0
  26. data/lib/commands/sf_commands.rb +37 -0
  27. data/lib/commands/validators.rb +19 -0
  28. data/lib/compatibility.rb +19 -0
  29. data/lib/compiler/compiler.rb +76 -0
  30. data/lib/compiler/etl_visitor.rb +165 -0
  31. data/lib/dsl/dsl.rb +125 -0
  32. data/lib/generators/downloaders.rb +449 -0
  33. data/lib/generators/etl.rb +261 -0
  34. data/lib/generators/validators.rb +445 -0
  35. data/lib/graphs/docentize.grf +1 -1
  36. data/lib/graphs/dummy.grf +1 -1
  37. data/lib/graphs/goodsales_v2/docentize.grf +47 -0
  38. data/lib/graphs/goodsales_v2/dummy.grf +46 -0
  39. data/lib/graphs/goodsales_v2/load_history.grf +579 -0
  40. data/lib/graphs/goodsales_v2/process_account.grf +47 -0
  41. data/lib/graphs/goodsales_v2/process_activity.grf +222 -0
  42. data/lib/graphs/goodsales_v2/process_activity_dim.grf +88 -0
  43. data/lib/graphs/goodsales_v2/process_activity_owner.grf +48 -0
  44. data/lib/graphs/goodsales_v2/process_forecast.grf +20 -0
  45. data/lib/graphs/goodsales_v2/process_opp_records.grf +84 -0
  46. data/lib/graphs/goodsales_v2/process_opportunity.grf +46 -0
  47. data/lib/graphs/goodsales_v2/process_opportunity_line_item.grf +171 -0
  48. data/lib/graphs/goodsales_v2/process_opportunity_snapshot.grf +94 -0
  49. data/lib/graphs/goodsales_v2/process_owner.grf +48 -0
  50. data/lib/graphs/goodsales_v2/process_stage.grf +51 -0
  51. data/lib/graphs/goodsales_v2/process_stage_history.grf +184 -0
  52. data/lib/graphs/goodsales_v2/process_velocity_duration.grf +140 -0
  53. data/lib/graphs/process_account.grf +1 -1
  54. data/lib/graphs/process_activity.grf +1 -1
  55. data/lib/graphs/process_activity_dim.grf +1 -1
  56. data/lib/graphs/process_activity_owner.grf +1 -1
  57. data/lib/graphs/process_forecast.grf +1 -1
  58. data/lib/graphs/process_opp_records.grf +1 -1
  59. data/lib/graphs/process_opportunity.grf +1 -1
  60. data/lib/graphs/process_opportunity_line_item.grf +1 -1
  61. data/lib/graphs/process_opportunity_snapshot.grf +1 -1
  62. data/lib/graphs/process_owner.grf +1 -1
  63. data/lib/graphs/process_stage.grf +1 -1
  64. data/lib/graphs/process_stage_history.grf +1 -1
  65. data/lib/graphs/process_velocity_duration.grf +1 -1
  66. data/lib/nodes/clover_gen.rb +59 -946
  67. data/lib/nodes/dependency.rb +95 -96
  68. data/lib/runtime.rb +7 -648
  69. data/lib/utils/utils.rb +66 -0
  70. data/templates/flow.rb.erb +7 -6
  71. data/templates/join_template.grf.erb +1 -1
  72. data/templates/reformat_template.grf.erb +1 -1
  73. data/templates/sink.json.erb +28 -0
  74. data/templates/tap.json.erb +3 -5
  75. data/templates/workspace.prm.erb +4 -0
  76. metadata +50 -8
  77. data/lib/contract_checkers/contract_checkers.rb +0 -53
  78. data/lib/dsl/project_dsl.rb +0 -259
  79. data/lib/repo/1_config.json +0 -8
  80. data/templates/dataset.json.erb +0 -13
  81. data/templates/source.json.erb +0 -22
@@ -0,0 +1,47 @@
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.prm" 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.Url = '${SF_SERVER_FOR_LINKS}' + $in.0.Id;
21
+
22
+ return ALL;
23
+ }
24
+
25
+ // Called during component initialization.
26
+ // function boolean init() {}
27
+
28
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
29
+ // required by the transform. All resources allocated within this method should be released
30
+ // by the postExecute() method.
31
+ // function void preExecute() {}
32
+
33
+ // Called only if transform() throws an exception.
34
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
35
+
36
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
37
+ // allocated within the preExecute() method.
38
+ // function void postExecute() {}
39
+
40
+ // Called to return a user-defined error message when an error occurs.
41
+ // function string getMessage() {}
42
+ ]]></attr>
43
+ </Node>
44
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
45
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
46
+ </Phase>
47
+ </Graph>
@@ -0,0 +1,222 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="fluke" created="Tue Feb 05 15:38:24 PST 2013" guiVersion="3.3.2" id="1360179808937" licenseCode="CLP1DGOODD71636137BY" licenseType="Commercial" modified="Fri Mar 08 12:55:05 PST 2013" modifiedBy="gdc-defectivedisplay" name="process_name" revision="1.17" 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="Metadata3"/>
7
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_out.xml" id="Metadata4"/>
8
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/3_in.xml" id="Metadata5"/>
9
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/3_out.xml" id="Metadata6"/>
10
+ <MetadataGroup id="ComponentGroup0" name="metadata"/>
11
+ <Property fileURL="params.prm" id="GraphParameter0"/>
12
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
13
+ <Dictionary/>
14
+ </Global>
15
+ <Phase number="0">
16
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/3_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="26" guiY="339" id="DATA_READER1" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
17
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/1_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="26" guiY="9" id="DATA_READER5" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
18
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/2_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="26" guiY="158" id="DATA_READER6" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
19
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="263" guiY="339" id="EXT_SORT1" sortKey="Id(a)" type="EXT_SORT"/>
20
+ <Edge fromNode="DATA_READER1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata5" outPort="Port 0 (output)" toNode="EXT_SORT1:0"/>
21
+ <Edge debugMode="true" fromNode="DATA_READER5:0" guiBendpoints="" guiRouter="Manhattan" id="Edge6" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT4:0"/>
22
+ <Edge debugMode="true" fromNode="DATA_READER6:0" guiBendpoints="" guiRouter="Manhattan" id="Edge28" inPort="Port 0 (in)" metadata="Metadata3" outPort="Port 0 (output)" toNode="REFORMAT5:0"/>
23
+ <Edge fromNode="EXT_SORT1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge2" inPort="Port 1 (slave)" metadata="Metadata6" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN0:1"/>
24
+ </Phase>
25
+ <Phase number="19">
26
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="215" guiY="15" id="REFORMAT4" type="REFORMAT">
27
+ <attr name="transform"><![CDATA[//#CTL2
28
+
29
+ // Transforms input record into output record.
30
+ function integer transform() {
31
+
32
+ integer number_of_fields = length($in.0);
33
+ integer i = 0;
34
+ string input_name = "";
35
+ integer output_index = 0;
36
+ string type = "";
37
+ string value = "";
38
+ for (i; i< number_of_fields; ++i) {
39
+ type = getFieldType($in.0, i);
40
+ input_name = getFieldName($in.0, i);
41
+ output_index = getFieldIndex($out.0, input_name);
42
+ if (output_index != -1) {
43
+ switch(type) {
44
+ case "string": setStringValue($out.0, output_index, getStringValue($in.0, input_name): ""); break;
45
+ case "number": setNumValue($out.0, output_index, getNumValue($in.0, input_name) : 0); break;
46
+ case "date": setDateValue($out.0, output_index, getDateValue($in.0, input_name) : str2date("1950-01-01", "yyyy-MM-dd")); break;
47
+
48
+ }
49
+
50
+ }
51
+ };
52
+
53
+ $out.0.isTask = "false";
54
+
55
+ return OK;
56
+ }
57
+
58
+ // Called during component initialization.
59
+ // function boolean init() {}
60
+
61
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
62
+ // required by the transform. All resources allocated within this method should be released
63
+ // by the postExecute() method.
64
+ // function void preExecute() {}
65
+
66
+ // Called only if transform() throws an exception.
67
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
68
+
69
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
70
+ // allocated within the preExecute() method.
71
+ // function void postExecute() {}
72
+
73
+ // Called to return a user-defined error message when an error occurs.
74
+ // function string getMessage() {}
75
+ ]]></attr>
76
+ </Node>
77
+ <Edge fromNode="REFORMAT4:0" guiBendpoints="" guiRouter="Manhattan" id="Edge40" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="SIMPLE_GATHER0:0"/>
78
+ </Phase>
79
+ <Phase number="20">
80
+ <Node append="false" charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/out.csv" guiHeight="89" guiName="Activity" guiWidth="128" guiX="1024" guiY="339" id="ACTIVITY1" makeDirs="false" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
81
+ <Node enabled="enabled" guiHeight="77" guiName="ExtMergeJoin" guiWidth="128" guiX="665" guiY="333" id="EXT_MERGE_JOIN0" joinKey="$WhatId(a)#$Id(a);" joinType="leftOuter" type="EXT_MERGE_JOIN">
82
+ <attr name="transform"><![CDATA[//#CTL2
83
+
84
+ // Transforms input record into output record.
85
+ function integer transform() {
86
+ $out.0.* = $in.0.*;
87
+ $out.0.CreatedDate = $in.1.CreatedDate;
88
+ $out.0.CloseDate = $in.1.CloseDate;
89
+ $out.0.AccountId = $in.1.AccountId;
90
+ $out.0.OpportunityOwner = $in.1.OwnerId;
91
+ $out.0.Stage = $in.1.StageName;
92
+
93
+ return ALL;
94
+ }
95
+
96
+ // Called during component initialization.
97
+ // function boolean init() {}
98
+
99
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
100
+ // required by the transform. All resources allocated within this method should be released
101
+ // by the postExecute() method.
102
+ // function void preExecute() {}
103
+
104
+ // Called only if transform() throws an exception.
105
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
106
+
107
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
108
+ // allocated within the preExecute() method.
109
+ // function void postExecute() {}
110
+
111
+ // Called to return a user-defined error message when an error occurs.
112
+ // function string getMessage() {}
113
+ ]]></attr>
114
+ </Node>
115
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="619" guiY="141" id="EXT_SORT0" sortKey="WhatId(a)" type="EXT_SORT"/>
116
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="853" guiY="339" id="REFORMAT0" type="REFORMAT">
117
+ <attr name="transform"><![CDATA[//#CTL2
118
+
119
+ // Transforms input record into output record.
120
+ function integer transform() {
121
+ $out.0.* = $in.0.*;
122
+
123
+
124
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) < "1950") {
125
+ $out.0.CloseDate = '1950-01-01';
126
+ }
127
+
128
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) > "2049") {
129
+ $out.0.CloseDate = '2049-01-01';
130
+ }
131
+
132
+ if ($in.0.CreatedDate != null && $in.0.CreatedDate != "") {
133
+ $out.0.CreatedDate = left($in.0.CreatedDate, 10);
134
+ }
135
+
136
+ return ALL;
137
+ }
138
+
139
+ // Called during component initialization.
140
+ // function boolean init() {}
141
+
142
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
143
+ // required by the transform. All resources allocated within this method should be released
144
+ // by the postExecute() method.
145
+ // function void preExecute() {}
146
+
147
+ // Called only if transform() throws an exception.
148
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
149
+
150
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
151
+ // allocated within the preExecute() method.
152
+ // function void postExecute() {}
153
+
154
+ // Called to return a user-defined error message when an error occurs.
155
+ // function string getMessage() {}
156
+ ]]></attr>
157
+ </Node>
158
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="232" guiY="158" id="REFORMAT5" type="REFORMAT">
159
+ <attr name="transform"><![CDATA[//#CTL2
160
+
161
+ // Transforms input record into output record.
162
+ function integer transform() {
163
+ integer number_of_fields = length($in.0);
164
+ integer i = 0;
165
+ string input_name = "";
166
+ integer output_index = 0;
167
+ string type = "";
168
+ string value = "";
169
+ for (i; i< number_of_fields; ++i) {
170
+ type = getFieldType($in.0, i);
171
+ input_name = getFieldName($in.0, i);
172
+ output_index = getFieldIndex($out.0, input_name);
173
+ if (output_index != -1) {
174
+ switch(type) {
175
+ case "string": setStringValue($out.0, output_index, getStringValue($in.0, input_name) : ""); break;
176
+ case "number": setNumValue($out.0, output_index, getNumValue($in.0, input_name) : 0); break;
177
+ case "date": setDateValue($out.0, output_index, getDateValue($in.0, input_name) : str2date("1950-01-01", "yyyy-MM-dd")); break;
178
+ }
179
+
180
+ }
181
+ };
182
+
183
+ $out.0.isTask = "true";
184
+
185
+ if (($in.0.ActivityDate != null && $in.0.ActivityDate != "") && left($in.0.ActivityDate, 4) < "1950") {
186
+ $out.0.ActivityDate = '1950-01-01';
187
+ }
188
+
189
+ if (($in.0.ActivityDate != null && $in.0.ActivityDate != "") && left($in.0.ActivityDate, 4) > "2049") {
190
+ $out.0.ActivityDate = '2049-01-01';
191
+ }
192
+
193
+ return OK;
194
+ }
195
+
196
+ // Called during component initialization.
197
+ // function boolean init() {}
198
+
199
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
200
+ // required by the transform. All resources allocated within this method should be released
201
+ // by the postExecute() method.
202
+ // function void preExecute() {}
203
+
204
+ // Called only if transform() throws an exception.
205
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
206
+
207
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
208
+ // allocated within the preExecute() method.
209
+ // function void postExecute() {}
210
+
211
+ // Called to return a user-defined error message when an error occurs.
212
+ // function string getMessage() {}
213
+ ]]></attr>
214
+ </Node>
215
+ <Node enabled="enabled" guiHeight="72" guiName="SimpleGather" guiWidth="128" guiX="445" guiY="146" id="SIMPLE_GATHER0" type="SIMPLE_GATHER"/>
216
+ <Edge fromNode="EXT_MERGE_JOIN0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge3" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="REFORMAT0:0"/>
217
+ <Edge fromNode="EXT_SORT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (driver)" metadata="Metadata4" outPort="Port 0 (out)" toNode="EXT_MERGE_JOIN0:0"/>
218
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge4" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="ACTIVITY1:0"/>
219
+ <Edge fromNode="REFORMAT5:0" guiBendpoints="" guiRouter="Manhattan" id="Edge41" inPort="Port 1 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="SIMPLE_GATHER0:1"/>
220
+ <Edge fromNode="SIMPLE_GATHER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge135" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="EXT_SORT0:0"/>
221
+ </Phase>
222
+ </Graph>
@@ -0,0 +1,88 @@
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 14:52:17 PST 2013" modifiedBy="fluke" name="process_name" revision="1.14" 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="Metadata3"/>
7
+ <Metadata fileURL="${PROJECT}/metadata/${FLOW}/${NAME}/2_out.xml" id="Metadata4"/>
8
+ <MetadataGroup id="ComponentGroup0" name="metadata"/>
9
+ <Property fileURL="params.prm" id="GraphParameter0"/>
10
+ <Property fileURL="workspace.prm" id="GraphParameter1"/>
11
+ <Dictionary/>
12
+ </Global>
13
+ <Phase number="0">
14
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/1_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="284" guiY="12" id="DATA_READER5" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
15
+ <Node charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/2_in.csv" guiHeight="89" guiName="CSV Reader" guiWidth="128" guiX="284" guiY="232" id="DATA_READER6" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
16
+ <Edge debugMode="true" fromNode="DATA_READER5:0" guiBendpoints="" guiRouter="Manhattan" id="Edge6" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT4:0"/>
17
+ <Edge debugMode="true" fromNode="DATA_READER6:0" guiBendpoints="" guiRouter="Manhattan" id="Edge28" inPort="Port 0 (in)" metadata="Metadata3" outPort="Port 0 (output)" toNode="REFORMAT5:0"/>
18
+ </Phase>
19
+ <Phase number="19">
20
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="473" guiY="18" id="REFORMAT4" type="REFORMAT">
21
+ <attr name="transform"><![CDATA[//#CTL2
22
+
23
+ // Transforms input record into output record.
24
+ function integer transform() {
25
+
26
+ $out.0.* = $in.0.*;
27
+ $out.0.Status = "Done";
28
+
29
+ return OK;
30
+ }
31
+
32
+ // Called during component initialization.
33
+ // function boolean init() {}
34
+
35
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
36
+ // required by the transform. All resources allocated within this method should be released
37
+ // by the postExecute() method.
38
+ // function void preExecute() {}
39
+
40
+ // Called only if transform() throws an exception.
41
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
42
+
43
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
44
+ // allocated within the preExecute() method.
45
+ // function void postExecute() {}
46
+
47
+ // Called to return a user-defined error message when an error occurs.
48
+ // function string getMessage() {}
49
+ ]]></attr>
50
+ </Node>
51
+ <Edge fromNode="REFORMAT4:0" guiBendpoints="" guiRouter="Manhattan" id="Edge40" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="SIMPLE_GATHER0:0"/>
52
+ </Phase>
53
+ <Phase number="20">
54
+ <Node append="false" charset="UTF-8" enabled="enabled" fileURL="${PROJECT}/data/out.csv" guiHeight="89" guiName="Activity" guiWidth="128" guiX="905" guiY="103" id="ACTIVITY1" makeDirs="false" outputFieldNames="true" quoteCharacter="&quot;" quotedStrings="true" type="DATA_WRITER"/>
55
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="490" guiY="232" id="REFORMAT5" type="REFORMAT">
56
+ <attr name="transform"><![CDATA[//#CTL2
57
+
58
+ // Transforms input record into output record.
59
+ function integer transform() {
60
+ $out.0.* = $in.0.*;
61
+
62
+ return OK;
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="72" guiName="SimpleGather" guiWidth="128" guiX="652" guiY="112" id="SIMPLE_GATHER0" type="SIMPLE_GATHER"/>
85
+ <Edge fromNode="REFORMAT5:0" guiBendpoints="" guiRouter="Manhattan" id="Edge41" inPort="Port 1 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="SIMPLE_GATHER0:1"/>
86
+ <Edge fromNode="SIMPLE_GATHER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge135" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (out)" toNode="ACTIVITY1:0"/>
87
+ </Phase>
88
+ </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.prm" 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,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Graph author="fluke" created="Tue Feb 05 15:38:24 PST 2013" guiVersion="3.3.2" id="1360179808937" licenseType="Commercial" modified="Thu May 02 12:37:08 PDT 2013" modifiedBy="gdc-defectivedisplay" name="process_name" revision="1.14" 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.prm" id="GraphParameter0"/>
8
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
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="37" 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 dedupKey="ForecastCategoryName(a)" enabled="enabled" guiHeight="65" guiName="Dedup" guiWidth="128" guiX="368" guiY="160" id="DEDUP0" type="DEDUP"/>
15
+ <Node enabled="enabled" guiHeight="89" guiName="ExtSort" guiWidth="128" guiX="199" guiY="175" id="EXT_SORT0" sortKey="ForecastCategoryName(a)" type="EXT_SORT"/>
16
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="EXT_SORT0:0"/>
17
+ <Edge fromNode="DEDUP0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (unique)" toNode="DATA_WRITER0:0"/>
18
+ <Edge fromNode="EXT_SORT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge2" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (out)" toNode="DEDUP0:0"/>
19
+ </Phase>
20
+ </Graph>
@@ -0,0 +1,84 @@
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="1363571865202" licenseCode="CLP1DGOODD71636137BY" licenseType="Commercial" modified="Thu Apr 11 13:57:16 PDT 2013" modifiedBy="Jagjit" name="xxxx" revision="1.55" 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 id="Metadata2">
7
+ <Record fieldDelimiter="|" name="recordName1" recordDelimiter="\n" type="delimited">
8
+ <Field name="field1" type="string"/>
9
+ </Record>
10
+ </Metadata>
11
+ <Property fileURL="params.prm" id="GraphParameter0"/>
12
+ <Property fileURL="workspace.prm" id="GraphParameter2"/>
13
+ <Dictionary/>
14
+ </Global>
15
+ <Phase number="0">
16
+ <Node enabled="enabled" fileURL="data/1_in.csv" guiHeight="77" guiName="CSV Reader" guiWidth="128" guiX="83" guiY="90" id="DATA_READER0" quoteCharacter="&quot;" quotedStrings="true" skipRows="1" type="DATA_READER"/>
17
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="282" guiY="80" id="REFORMAT1" type="REFORMAT">
18
+ <attr name="transform"><![CDATA[//#CTL2
19
+
20
+ // Transforms input record into output record.
21
+ function integer transform() {
22
+ $out.0.* = $in.0.*;
23
+
24
+ if ($in.0.Probability == null) {
25
+ $out.0.Probability = "0";
26
+ } else {
27
+ $out.0.Probability = toString(str2decimal($in.0.Probability)/100D);
28
+ }
29
+
30
+ if ($in.0.Amount == null) {
31
+ $out.0.Amount = "0";
32
+ } else {
33
+ $out.0.Amount = toString(round(str2decimal($in.0.Amount)*100D)/100D);
34
+ }
35
+
36
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) < "1950") {
37
+ $out.0.CloseDate = '1950-01-01';
38
+ }
39
+
40
+ if ($in.0.CloseDate != null && $in.0.CloseDate != "" && left($in.0.CloseDate, 4) > "2049") {
41
+ $out.0.CloseDate = '2049-01-01';
42
+ }
43
+
44
+ if ($in.0.CreatedDate != null && $in.0.CreatedDate != "" && left($in.0.CreatedDate, 4) < "1950") {
45
+ $out.0.CreatedDate = '1950-01-01';
46
+ }
47
+
48
+ if ($in.0.CreatedDate != null && $in.0.CreatedDate != "" && left($in.0.CreatedDate, 4) > "2049") {
49
+ $out.0.CreatedDate = '2049-01-01';
50
+ }
51
+
52
+ if ($in.0.CreatedDate != null && $in.0.CreatedDate != "" ) {
53
+ $out.0.CreatedDate = left($in.0.CreatedDate, 10);
54
+ }
55
+
56
+ return ALL;
57
+ }
58
+
59
+ // Called during component initialization.
60
+ // function boolean init() {}
61
+
62
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
63
+ // required by the transform. All resources allocated within this method should be released
64
+ // by the postExecute() method.
65
+ // function void preExecute() {}
66
+
67
+ // Called only if transform() throws an exception.
68
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
69
+
70
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
71
+ // allocated within the preExecute() method.
72
+ // function void postExecute() {}
73
+
74
+ // Called to return a user-defined error message when an error occurs.
75
+ // function string getMessage() {}
76
+ ]]></attr>
77
+ </Node>
78
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT1:0"/>
79
+ <Edge fromNode="REFORMAT1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
80
+ </Phase>
81
+ <Phase number="1">
82
+ <Node enabled="enabled" fileURL="data/out.csv" guiHeight="77" guiName="CSV Writer" guiWidth="128" guiX="517" guiY="74" id="DATA_WRITER0" outputFieldNames="true" quotedStrings="true" type="DATA_WRITER"/>
83
+ </Phase>
84
+ </Graph>
@@ -0,0 +1,46 @@
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.prm" 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
+
20
+ $out.0.* = $in.0.*;
21
+ return ALL;
22
+ }
23
+
24
+ // Called during component initialization.
25
+ // function boolean init() {}
26
+
27
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
28
+ // required by the transform. All resources allocated within this method should be released
29
+ // by the postExecute() method.
30
+ // function void preExecute() {}
31
+
32
+ // Called only if transform() throws an exception.
33
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
34
+
35
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
36
+ // allocated within the preExecute() method.
37
+ // function void postExecute() {}
38
+
39
+ // Called to return a user-defined error message when an error occurs.
40
+ // function string getMessage() {}
41
+ ]]></attr>
42
+ </Node>
43
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
44
+ <Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="DATA_WRITER0:0"/>
45
+ </Phase>
46
+ </Graph>