xmlutils 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +22 -0
  5. data/README.md +77 -0
  6. data/bin/xmltogdl +88 -0
  7. data/docs/README.txt +20 -0
  8. data/lib/xmlutils/contextlistener.rb +432 -0
  9. data/lib/xmlutils/contextparser.rb +111 -0
  10. data/lib/xmlutils/dumplistener.rb +57 -0
  11. data/lib/xmlutils/gdlcontext.rb +305 -0
  12. data/lib/xmlutils/gdlcontextobjs.rb +286 -0
  13. data/lib/xmlutils/gdldoc.rb +547 -0
  14. data/lib/xmlutils/gdldocbuilder.rb +181 -0
  15. data/lib/xmlutils/gdllistener.rb +265 -0
  16. data/lib/xmlutils/gdltemplate.rb +488 -0
  17. data/lib/xmlutils/lineparser.rb +193 -0
  18. data/lib/xmlutils/listener.rb +459 -0
  19. data/lib/xmlutils/rulelistener.rb +414 -0
  20. data/lib/xmlutils/ruleparser.rb +112 -0
  21. data/lib/xmlutils/varlistener.rb +86 -0
  22. data/lib/xmlutils/version.rb +5 -0
  23. data/lib/xmlutils/xmlrulevisitor.rb +704 -0
  24. data/lib/xmlutils/xmltogdlcontroller.rb +93 -0
  25. data/lib/xmlutils/xmltogdltask.rb +23 -0
  26. data/lib/xmlutils/xmlvisitor.rb +690 -0
  27. data/lib/xmlutils.rb +40 -0
  28. data/rakefile.rb +34 -0
  29. data/unittests/2830.xml +1 -0
  30. data/unittests/chunks.rb +31 -0
  31. data/unittests/curDirTest.rb +2 -0
  32. data/unittests/data/2830-GENERATED.gdl +309 -0
  33. data/unittests/data/2830-GENERATED.xml +1 -0
  34. data/unittests/data/AUGuideline.xml +12 -0
  35. data/unittests/data/AUGuideline.xml.gdl +19190 -0
  36. data/unittests/data/BAKUP.DCTEST1.xml +1 -0
  37. data/unittests/data/DCTEST.xml +1 -0
  38. data/unittests/data/DCTEST1.xml +1 -0
  39. data/unittests/data/DCTEST1.xml.gdl +14890 -0
  40. data/unittests/data/DCTEST1.xml.rename.csv +180 -0
  41. data/unittests/data/DCTEST1wLookups.xml +174 -0
  42. data/unittests/data/DCTEST1wLookups.xml.gdl +127 -0
  43. data/unittests/data/GENERATED.gdl.xml +1 -0
  44. data/unittests/data/Message.xml +1 -0
  45. data/unittests/data/Message.xml.gdl +142 -0
  46. data/unittests/data/Pricing2ndGuideline.xml +1 -0
  47. data/unittests/data/Pricing2ndGuideline.xml.gdl +52670 -0
  48. data/unittests/data/Z-TEMP-Jeff.xml +1 -0
  49. data/unittests/data/Z-TEMP-Jeff.xml.gdl +288 -0
  50. data/unittests/tc_convert_xml_to_gdl.rb +23 -0
  51. data/unittests/ts_allTests.rb +2 -0
  52. data/xmlutils.gemspec +25 -0
  53. metadata +139 -0
data/rakefile.rb ADDED
@@ -0,0 +1,34 @@
1
+ ######################################################################################
2
+ # File:: rakefile
3
+ # Purpose:: Build tasks for XmlUtils application
4
+ #
5
+ # Author:: Jeff McAffee 03/12/2010
6
+ # Copyright:: Copyright (c) 2010, kTech Systems LLC. All rights reserved.
7
+ # Website:: http://ktechsystems.com
8
+ ######################################################################################
9
+
10
+ require 'bundler/gem_tasks'
11
+
12
+ require 'rake'
13
+ require 'rake/clean'
14
+ require 'rspec/core/rake_task'
15
+
16
+
17
+ # Set the project name
18
+ PROJNAME = "XmlUtils"
19
+
20
+ # Setup common clean and clobber targets ----------------------------
21
+
22
+ CLEAN.include("pkg/**/*.*")
23
+ CLEAN.include("tmp/**/*.*")
24
+
25
+ CLOBBER.include("pkg")
26
+ CLOBBER.include("tmp")
27
+
28
+
29
+ #############################################################################
30
+ desc "run all specs"
31
+ RSpec::Core::RakeTask.new do |t|
32
+ #t.rcov = true
33
+ end
34
+
@@ -0,0 +1 @@
1
+ <GuidelineRoot><Guideline GuidelineID="1" Name="GENERATED" Version="1" StartDate="Dec 03 2007 12:00AM"><Ruleset Id="1" Name="AltA-Max DTI Limits Calc Ruleset" ExecuteType="1" Type="0"><Rule Id="9" Name="MaxDTIReducedDocTypes-AltA"><IfMessages><Message Type="Observation"><![CDATA[Max DTI reduced to 45 for reduced doc type.]]></Message></IfMessages><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>45</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="LTV" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Limited Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="5" Name="AltA-Max Dti SivaLiteDoc"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="1" Name="AltA-Max DTI Investment"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>Investment</Constant></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="8" Name="AltA-Max DTI PriSecResidence"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>SecondaryResidence</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule></Ruleset><Ruleset Id="2" Name="AltA-Max DTI Limits Calc Combo Ruleset" ExecuteType="1" Type="0"><Rule Id="9" Name="MaxDTIReducedDocTypes-AltA"><IfMessages><Message Type="Observation"><![CDATA[Max DTI reduced to 45 for reduced doc type.]]></Message></IfMessages><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>45</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="LTV" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Limited Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="2" Name="AltA-Max DTI 1000001 Combo"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>42</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="4" Name="AltA-Max DTI Texas Cash Out"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Purpose Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>CO</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="State of the Subject Property" Type="APM"/></LeftOperand><RightOperand><Constant>TX</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="3" Name="AltA-MaxDti55IOFullDocCombo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Doc Type Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>Full Doc</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOARM</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOFixed</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="7" Name="AltA-MaxDti55IOFullDocHelocCombo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Doc Type Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>Full Doc</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOARM</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOFixed</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Amort Type 2nd" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>HELOC</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="6" Name="AltA-Max DTI 1000000 Combo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>SecondaryResidence</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="CLTV" Type="DSM" Order="0" ProductType="5"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions><ElseActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></ElseActions></Rule></Ruleset></Guideline><LOOKUPS></LOOKUPS></GuidelineRoot>
@@ -0,0 +1,31 @@
1
+ require 'xmlUtils/lineParser'
2
+
3
+ chunks = 0
4
+
5
+ File.read(ARGV[0]).split.each do |word|
6
+ next if word =~ /^#/
7
+ break if ["__DATA__", "__END__"].member? word
8
+ chunks += 1
9
+
10
+ # puts word
11
+ end
12
+
13
+ print "Found ", chunks, " chunks\n"
14
+
15
+
16
+
17
+ lp = LineParser.new
18
+
19
+ lp.parse(ARGV[0])
20
+
21
+ lp.dumpResults
22
+
23
+ #
24
+ #fh = File.new(ARGV[0])
25
+
26
+ #fh.readlines.each { |line|
27
+ # lp.parseLine(line.chomp!)
28
+ #}
29
+
30
+
31
+
@@ -0,0 +1,2 @@
1
+ curDir = Dir.getwd
2
+ puts "Working dir: #{curDir}"
@@ -0,0 +1,309 @@
1
+ /* **************************************************************************
2
+ * File: data/Z-TEMP-Jeff.xml.gdl
3
+ * Generated guideline
4
+ *
5
+ * *************************************************************************/
6
+
7
+
8
+
9
+
10
+
11
+
12
+ // --------------------------- DPM Definitions ---------------------------
13
+
14
+ dpm text DocTypeAbbrev "Doc Type Abbrev";
15
+ dpm money CombinedLoanAmount "Combined Loan Amount";
16
+ dpm text PurposeAbbrev "Purpose Abbrev";
17
+ dpm text AmortType2nd "Amort Type 2nd";
18
+
19
+
20
+
21
+
22
+ // --------------------------- DSM Definitions ---------------------------
23
+
24
+ decision dpm percentage CLTV "CLTV";
25
+ decision dpm numeric MaxDTI "Max DTI";
26
+
27
+ decision dpm numeric LTV;
28
+
29
+
30
+
31
+
32
+ // --------------------------- PPM Definitions ---------------------------
33
+
34
+ ppm text prd pAmortizationType-PDT "Amortization Type-PDT";
35
+ ppm text app pOccupancy "Occupancy";
36
+ ppm text app pStateoftheSubjectProperty "State of the Subject Property";
37
+ ppm text app pDocumentType "Document Type";
38
+
39
+
40
+
41
+
42
+ // -------------------------- Rule Definitions --------------------------
43
+
44
+ alias(rule, AltA-MaxDTIInvestment, "AltA-Max DTI Investment");
45
+
46
+ /* ==========================================================================
47
+ * AltA-MaxDTIInvestment
48
+ *
49
+ *
50
+ */
51
+ rule AltA-MaxDTIInvestment()
52
+ if(
53
+ (pOccupancy == 'Investment')
54
+ )
55
+ then
56
+ MaxDTI = '50';
57
+
58
+ end
59
+ end // rule AltA-MaxDTIInvestment
60
+
61
+
62
+
63
+
64
+ alias(rule, AltA-MaxDTI1000001Combo, "AltA-Max DTI 1000001 Combo");
65
+
66
+ /* ==========================================================================
67
+ * AltA-MaxDTI1000001Combo
68
+ *
69
+ *
70
+ */
71
+ rule AltA-MaxDTI1000001Combo()
72
+ if(
73
+ (CombinedLoanAmount > '1000000')
74
+ )
75
+ then
76
+ MaxDTI = '42';
77
+
78
+ end
79
+ end // rule AltA-MaxDTI1000001Combo
80
+
81
+
82
+
83
+
84
+
85
+ /* ==========================================================================
86
+ * AltA-MaxDti55IOFullDocCombo
87
+ *
88
+ *
89
+ */
90
+ rule AltA-MaxDti55IOFullDocCombo()
91
+ if(
92
+ (DocTypeAbbrev == 'Full Doc') &&
93
+ (CombinedLoanAmount <= '1000000') &&
94
+ ((pAmortizationType-PDT == 'IOARM') ||
95
+ (pAmortizationType-PDT == 'IOFixed'))
96
+ )
97
+ then
98
+ MaxDTI = '55';
99
+
100
+ end
101
+ end // rule AltA-MaxDti55IOFullDocCombo
102
+
103
+
104
+
105
+
106
+ alias(rule, AltA-MaxDTITexasCashOut, "AltA-Max DTI Texas Cash Out");
107
+
108
+ /* ==========================================================================
109
+ * AltA-MaxDTITexasCashOut
110
+ *
111
+ *
112
+ */
113
+ rule AltA-MaxDTITexasCashOut()
114
+ if(
115
+ (pOccupancy == 'PrimaryResidence') &&
116
+ (PurposeAbbrev == 'CO') &&
117
+ (pStateoftheSubjectProperty == 'TX')
118
+ )
119
+ then
120
+ MaxDTI = '45';
121
+
122
+ end
123
+ end // rule AltA-MaxDTITexasCashOut
124
+
125
+
126
+
127
+
128
+ alias(rule, AltA-MaxDtiSivaLiteDoc, "AltA-Max Dti SivaLiteDoc");
129
+
130
+ /* ==========================================================================
131
+ * AltA-MaxDtiSivaLiteDoc
132
+ *
133
+ *
134
+ */
135
+ rule AltA-MaxDtiSivaLiteDoc()
136
+ if(
137
+ (pDocumentType == 'SIVA') ||
138
+ (pDocumentType == 'Lite Doc')
139
+ )
140
+ then
141
+ MaxDTI = '50';
142
+
143
+ end
144
+ end // rule AltA-MaxDtiSivaLiteDoc
145
+
146
+
147
+
148
+
149
+ alias(rule, AltA-MaxDTI1000000Combo, "AltA-Max DTI 1000000 Combo");
150
+
151
+ /* ==========================================================================
152
+ * AltA-MaxDTI1000000Combo
153
+ *
154
+ *
155
+ */
156
+ rule AltA-MaxDTI1000000Combo()
157
+ if(
158
+ ((pOccupancy == 'PrimaryResidence') ||
159
+ (pOccupancy == 'SecondaryResidence')) &&
160
+ (CLTV <= '80') &&
161
+ (CombinedLoanAmount <= '1000000')
162
+ )
163
+ then
164
+ MaxDTI = '55';
165
+
166
+ else
167
+ MaxDTI = '50';
168
+
169
+ end
170
+ end // rule AltA-MaxDTI1000000Combo
171
+
172
+
173
+
174
+
175
+
176
+ /* ==========================================================================
177
+ * AltA-MaxDti55IOFullDocHelocCombo
178
+ *
179
+ *
180
+ */
181
+ rule AltA-MaxDti55IOFullDocHelocCombo()
182
+ if(
183
+ (DocTypeAbbrev == 'Full Doc') &&
184
+ (CombinedLoanAmount <= '1000000') &&
185
+ ((pAmortizationType-PDT == 'IOARM') ||
186
+ (pAmortizationType-PDT == 'IOFixed')) &&
187
+ (AmortType2nd == 'HELOC')
188
+ )
189
+ then
190
+ MaxDTI = '55';
191
+
192
+ end
193
+ end // rule AltA-MaxDti55IOFullDocHelocCombo
194
+
195
+
196
+
197
+
198
+ alias(rule, AltA-MaxDTIPriSecResidence, "AltA-Max DTI PriSecResidence");
199
+
200
+ /* ==========================================================================
201
+ * AltA-MaxDTIPriSecResidence
202
+ *
203
+ *
204
+ */
205
+ rule AltA-MaxDTIPriSecResidence()
206
+ if(
207
+ ((pOccupancy == 'PrimaryResidence') ||
208
+ (pOccupancy == 'SecondaryResidence'))
209
+ )
210
+ then
211
+ MaxDTI = '50';
212
+
213
+ end
214
+ end // rule AltA-MaxDTIPriSecResidence
215
+
216
+
217
+
218
+
219
+ /* ==========================================================================
220
+ * MaxDTIReducedDocTypes-AltA
221
+ *
222
+ *
223
+ */
224
+ rule MaxDTIReducedDocTypes-AltA()
225
+ if(
226
+ (MaxDTI > 45) &&
227
+ (LTV > 80) &&
228
+ (
229
+ (pDocumentType == "SIVA") ||
230
+ (pDocumentType == "Lite Doc") ||
231
+ (pDocumentType == "Limited Doc")
232
+ )
233
+ )
234
+ then
235
+ MaxDTI = 45;
236
+ message(observation, "Max DTI reduced to 45 for reduced doc type.");
237
+
238
+ end
239
+ end // rule AltA-MaxDTIPriSecResidence
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+ // ------------------------- RuleSet Definitions -------------------------
249
+
250
+ alias(ruleset, AltA-MaxDTILimitsCalcRuleset, "AltA-Max DTI Limits Calc Ruleset");
251
+
252
+ /* ==========================================================================
253
+ * AltA-MaxDTILimitsCalcRuleset
254
+ *
255
+ *
256
+ */
257
+ ruleset AltA-MaxDTILimitsCalcRuleset(true)
258
+ rule MaxDTIReducedDocTypes-AltA();
259
+ rule AltA-MaxDtiSivaLiteDoc();
260
+ rule AltA-MaxDTIInvestment();
261
+ rule AltA-MaxDTIPriSecResidence();
262
+
263
+ end // ruleset AltA-MaxDTILimitsCalcRuleset
264
+
265
+
266
+
267
+
268
+ alias(ruleset, AltA-MaxDTILimitsCalcComboRuleset, "AltA-Max DTI Limits Calc Combo Ruleset");
269
+
270
+ /* ==========================================================================
271
+ * AltA-MaxDTILimitsCalcComboRuleset
272
+ *
273
+ *
274
+ */
275
+ ruleset AltA-MaxDTILimitsCalcComboRuleset(true)
276
+ rule MaxDTIReducedDocTypes-AltA();
277
+ rule AltA-MaxDTI1000001Combo();
278
+ rule AltA-MaxDTITexasCashOut();
279
+ rule AltA-MaxDti55IOFullDocCombo();
280
+ rule AltA-MaxDti55IOFullDocHelocCombo();
281
+ rule AltA-MaxDTI1000000Combo();
282
+
283
+
284
+ end // ruleset AltA-MaxDTILimitsCalcComboRuleset
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ // ------------------------ Guideline Definition ------------------------
294
+
295
+ /* ==========================================================================
296
+ * Z-TEMP-Jeff
297
+ *
298
+ * ID: 292
299
+ * Version: 63147
300
+ * Start Date: Nov 30 2007 3:10PM
301
+ *
302
+ */
303
+ guideline("GENERATED")
304
+
305
+ ruleset AltA-MaxDTILimitsCalcRuleset();
306
+ ruleset AltA-MaxDTILimitsCalcComboRuleset();
307
+
308
+
309
+ end // guideline Z-TEMP-Jeff
@@ -0,0 +1 @@
1
+ <GuidelineRoot><Guideline GuidelineID="1" Name="GENERATED" Version="1" StartDate="Nov 30 2007 12:00AM"><Ruleset Id="1" Name="AltA-Max DTI Limits Calc Ruleset" ExecuteType="1" Type="0"><Rule Id="5" Name="AltA-Max Dti SivaLiteDoc"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="1" Name="AltA-Max DTI Investment"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>Investment</Constant></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="8" Name="AltA-Max DTI PriSecResidence"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>SecondaryResidence</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="9" Name="MaxDTIReducedDocTypes-AltA"><IfMessages><Message Type="Observation"><![CDATA[Max DTI reduced to 45 for reduced doc type.]]></Message></IfMessages><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>45</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="LTV" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Limited Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule></Ruleset><Ruleset Id="2" Name="AltA-Max DTI Limits Calc Combo Ruleset" ExecuteType="1" Type="0"><Rule Id="2" Name="AltA-Max DTI 1000001 Combo"><IfMessages/><ElseMessages/><Condition><Expression><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>42</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="4" Name="AltA-Max DTI Texas Cash Out"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Purpose Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>CO</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="State of the Subject Property" Type="APM"/></LeftOperand><RightOperand><Constant>TX</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="3" Name="AltA-MaxDti55IOFullDocCombo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Doc Type Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>Full Doc</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOARM</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOFixed</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="7" Name="AltA-MaxDti55IOFullDocHelocCombo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Doc Type Abbrev" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>Full Doc</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOARM</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Amortization Type-PDT" Type="PRD"/></LeftOperand><RightOperand><Constant>IOFixed</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><DPM Name="Amort Type 2nd" Type="DPM" Order="0" ProductType="6"/></LeftOperand><RightOperand><Constant>HELOC</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions></Rule><Rule Id="6" Name="AltA-Max DTI 1000000 Combo"><IfMessages/><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>PrimaryResidence</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Occupancy" Type="APM"/></LeftOperand><RightOperand><Constant>SecondaryResidence</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="CLTV" Type="DSM" Order="0" ProductType="5"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>&lt;=</Operator><LeftOperand><DPM Name="Combined Loan Amount" Type="DPM" Order="0" ProductType="3"/></LeftOperand><RightOperand><Constant>1000000</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>55</Constant></Expression></AssignValue></Assign></IfActions><ElseActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>50</Constant></Expression></AssignValue></Assign></ElseActions></Rule><Rule Id="9" Name="MaxDTIReducedDocTypes-AltA"><IfMessages><Message Type="Observation"><![CDATA[Max DTI reduced to 45 for reduced doc type.]]></Message></IfMessages><ElseMessages/><Condition><Expression><Compute><Operator>AND</Operator><LeftOperand><Compute><Operator>AND</Operator><LeftOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>45</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>&gt;</Operator><LeftOperand><DPM Name="LTV" Type="DSM" Order="0" ProductType="4"/></LeftOperand><RightOperand><Constant>80</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>OR</Operator><LeftOperand><Compute><Operator>OR</Operator><LeftOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>SIVA</Constant></RightOperand></Compute></Brace></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Lite Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></LeftOperand><RightOperand><Brace><Compute><Operator>==</Operator><LeftOperand><PPM Name="Document Type" Type="APM"/></LeftOperand><RightOperand><Constant>Limited Doc</Constant></RightOperand></Compute></Brace></RightOperand></Compute></Brace></RightOperand></Compute></Expression></Condition><IfActions><Assign><AssignTo><DPM Name="Max DTI" Type="DSM" Order="0" ProductType="4"/></AssignTo><AssignValue><Expression><Constant>45</Constant></Expression></AssignValue></Assign></IfActions></Rule></Ruleset></Guideline><LOOKUPS></LOOKUPS></GuidelineRoot>