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,171 @@
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" licenseType="Commercial" modified="Tue Jun 25 17:05:18 PDT 2013" modifiedBy="tomassvarovsky" name="process_opportunity_line_item" revision="1.36" 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.prm" 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);$Snapshot(a)#$Id(a);$Snapshot(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="673" guiY="382" id="EXT_MERGE_JOIN1" joinKey="$Id(a);$Snapshot(a)#$OpportunityId(a);$Snapshot(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
+
61
+ $out.0.Amount = nvl($in.1.TotalPrice, $in.0.Amount);
62
+ $out.0.ProductId = $in.1.PricebookEntryId;
63
+
64
+ return ALL;
65
+ }
66
+
67
+ // Called during component initialization.
68
+ // function boolean init() {}
69
+
70
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
71
+ // required by the transform. All resources allocated within this method should be released
72
+ // by the postExecute() method.
73
+ // function void preExecute() {}
74
+
75
+ // Called only if transform() throws an exception.
76
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
77
+
78
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
79
+ // allocated within the preExecute() method.
80
+ // function void postExecute() {}
81
+
82
+ // Called to return a user-defined error message when an error occurs.
83
+ // function string getMessage() {}
84
+ ]]></attr>
85
+ </Node>
86
+ <Node enabled="enabled" guiHeight="89" guiName="ExtMergeJoin" guiWidth="128" guiX="809" guiY="533" id="EXT_MERGE_JOIN2" joinKey="$StageName(a);$Snapshot(a)#$Id(a);$Snapshot(a);" joinType="leftOuter" slaveDuplicates="true" type="EXT_MERGE_JOIN">
87
+ <attr name="transform"><![CDATA[//#CTL2
88
+
89
+ // Transforms input record into output record.
90
+ function integer transform() {
91
+
92
+ $out.0.* = $in.0.*;
93
+
94
+ $out.0.IsClosed = $in.1.IsClosed;
95
+ $out.0.IsWon = $in.1.IsWon;
96
+
97
+ return ALL;
98
+ }
99
+
100
+ // Called during component initialization.
101
+ // function boolean 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 transform() throws an exception.
109
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
110
+
111
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
112
+ // allocated within the preExecute() method.
113
+ // function void postExecute() {}
114
+
115
+ // Called to return a user-defined error message when an error occurs.
116
+ // function string getMessage() {}
117
+ ]]></attr>
118
+ </Node>
119
+ <Node enabled="enabled" guiHeight="89" guiName="ExtSort" guiWidth="128" guiX="252" guiY="51" id="EXT_SORT0" sortKey="PricebookEntryId(a);Snapshot(a)" type="EXT_SORT"/>
120
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="252" guiY="153" id="EXT_SORT1" sortKey="Id(a);Snapshot(a)" type="EXT_SORT"/>
121
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="252" guiY="388" id="EXT_SORT2" sortKey="Id(a);Snapshot(a)" type="EXT_SORT"/>
122
+ <Node enabled="enabled" guiHeight="89" guiName="ExtSort" guiWidth="128" guiX="482" guiY="236" id="EXT_SORT3" sortKey="OpportunityId(a);Snapshot(a)" type="EXT_SORT"/>
123
+ <Node enabled="enabled" guiHeight="77" guiName="ExtSort" guiWidth="128" guiX="283" guiY="539" id="EXT_SORT4" sortKey="Id(a);Snapshot(a)" type="EXT_SORT"/>
124
+ <Node enabled="enabled" guiHeight="89" guiName="ExtSort" guiWidth="128" guiX="855" guiY="388" id="EXT_SORT5" sortKey="StageName(a);Snapshot(a)" type="EXT_SORT"/>
125
+ <Node enabled="enabled" guiHeight="65" guiName="Reformat" guiWidth="128" guiX="989" guiY="533" id="REFORMAT0" type="REFORMAT">
126
+ <attr name="transform"><![CDATA[//#CTL2
127
+
128
+ // Transforms input record into output record.
129
+ function integer transform() {
130
+ $out.0.* = $in.0.*;
131
+
132
+ $out.0.CreatedDate = left($in.0.CreatedDate, 10);
133
+
134
+ return ALL;
135
+ }
136
+
137
+ // Called during component initialization.
138
+ // function boolean init() {}
139
+
140
+ // Called during each graph run before the transform is executed. May be used to allocate and initialize resources
141
+ // required by the transform. All resources allocated within this method should be released
142
+ // by the postExecute() method.
143
+ // function void preExecute() {}
144
+
145
+ // Called only if transform() throws an exception.
146
+ // function integer transformOnError(string errorMessage, string stackTrace) {}
147
+
148
+ // Called during each graph run after the entire transform was executed. Should be used to free any resources
149
+ // allocated within the preExecute() method.
150
+ // function void postExecute() {}
151
+
152
+ // Called to return a user-defined error message when an error occurs.
153
+ // function string getMessage() {}
154
+ ]]></attr>
155
+ </Node>
156
+ <Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="EXT_SORT0:0"/>
157
+ <Edge fromNode="DATA_READER1:0" guiBendpoints="" guiRouter="Manhattan" id="Edge2" inPort="Port 0 (in)" metadata="Metadata2" outPort="Port 0 (output)" toNode="EXT_SORT1:0"/>
158
+ <Edge fromNode="DATA_READER2:0" guiBendpoints="" guiRouter="Manhattan" id="Edge5" inPort="Port 0 (in)" metadata="Metadata4" outPort="Port 0 (output)" toNode="EXT_SORT2:0"/>
159
+ <Edge fromNode="DATA_READER3:0" guiBendpoints="" guiRouter="Manhattan" id="Edge10" inPort="Port 0 (in)" metadata="Metadata6" outPort="Port 0 (output)" toNode="EXT_SORT4:0"/>
160
+ <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"/>
161
+ <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"/>
162
+ <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"/>
163
+ <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"/>
164
+ <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"/>
165
+ <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"/>
166
+ <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"/>
167
+ <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"/>
168
+ <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"/>
169
+ <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"/>
170
+ </Phase>
171
+ </Graph>
@@ -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.prm" 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.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,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.2" id="1360179808937" licenseType="Commercial" modified="Wed Apr 17 09:21:46 PDT 2013" modifiedBy="josefvitek" name="process_name" revision="1.18" 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="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.label = $in.0.Id;
24
+ $out.0.SortOrder = nvl($in.0.SortOrder, "9999");
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.prm" 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>