parse_decision 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +6 -0
  5. data/LICENSE +22 -0
  6. data/README.md +71 -0
  7. data/bin/parse_decision +126 -0
  8. data/lib/parse_decision/config.rb +90 -0
  9. data/lib/parse_decision/controller.rb +142 -0
  10. data/lib/parse_decision/parsedecisiontask.rb +31 -0
  11. data/lib/parse_decision/parser.rb +194 -0
  12. data/lib/parse_decision/pd_context.rb +148 -0
  13. data/lib/parse_decision/plugin/application.rb +48 -0
  14. data/lib/parse_decision/plugin/plugin.rb +56 -0
  15. data/lib/parse_decision/plugin/ppm_xpath.rb +70 -0
  16. data/lib/parse_decision/plugin/pre_decision_guideline.rb +177 -0
  17. data/lib/parse_decision/plugin/product.rb +176 -0
  18. data/lib/parse_decision/plugin/product_xpath.rb +52 -0
  19. data/lib/parse_decision/plugin/web_product.rb +179 -0
  20. data/lib/parse_decision/plugin.rb +50 -0
  21. data/lib/parse_decision/version.rb +5 -0
  22. data/lib/parse_decision.rb +59 -0
  23. data/parse_decision.gemspec +27 -0
  24. data/rakefile.rb +58 -0
  25. data/spec/context_spec.rb +21 -0
  26. data/spec/data/multiproduct.decision.txt +1481 -0
  27. data/spec/data/prod.decision.txt +3957 -0
  28. data/spec/data/reference/multiproduct/001-APP.xml +1 -0
  29. data/spec/data/reference/multiproduct/001-Mod-Forbear-PRODUCT.xml +357 -0
  30. data/spec/data/reference/multiproduct/001-Mod-Forgive-PRODUCT.xml +361 -0
  31. data/spec/data/reference/multiproduct/001-Mod-RateTerm-PRODUCT.xml +353 -0
  32. data/spec/data/reference/multiproduct/001-Mod-SAM-PRODUCT.xml +365 -0
  33. data/spec/data/reference/product/001-APP.xml +1 -0
  34. data/spec/data/reference/product/001-Validation-Rules.xml +536 -0
  35. data/spec/data/reference/product/002-APP.xml +1 -0
  36. data/spec/data/reference/product/002-FAPIILoanModification-PRODUCT.xml +1770 -0
  37. data/spec/data/reference/web/001-APP.xml +1 -0
  38. data/spec/data/reference/web/001-Product01-PRODUCT.xml +1088 -0
  39. data/spec/data/reference/web/002-APP.xml +1 -0
  40. data/spec/data/reference/web/002-Product01-PRODUCT.xml +15 -0
  41. data/spec/data/reference/workflow/001-APP.xml +1 -0
  42. data/spec/data/reference/workflow/001-WF-DataClearing-Pre-Rules.xml +37 -0
  43. data/spec/data/reference/workflow-2/001-APP.xml +1 -0
  44. data/spec/data/reference/workflow-2/001-WF-ProdSel-Post-Rules.xml +699 -0
  45. data/spec/data/test.rb +13 -0
  46. data/spec/data/validation.decision.txt +1199 -0
  47. data/spec/data/web.decision.txt +1128 -0
  48. data/spec/data/wf.decision.txt +43 -0
  49. data/spec/data/wf2.decision.txt +705 -0
  50. data/spec/parser_spec.rb +308 -0
  51. data/spec/plugin_app_spec.rb +40 -0
  52. data/spec/plugin_ppmxpath_spec.rb +74 -0
  53. data/spec/plugin_predecision_spec.rb +81 -0
  54. data/spec/plugin_product_spec.rb +117 -0
  55. data/spec/plugin_productxpath_spec.rb +76 -0
  56. data/spec/plugin_spec.rb +54 -0
  57. data/spec/spec_helper.rb +81 -0
  58. data/test/data/2.2.decision-multiple.txt +1391 -0
  59. data/test/data/2.2.decision.txt +1128 -0
  60. data/test/data/2.decision.txt +1481 -0
  61. data/test/plugins/test_plugin_predecisionguideline.rb +120 -0
  62. data/test/plugins/test_plugin_product.rb +120 -0
  63. data/test/test_config.rb +90 -0
  64. data/test/test_context.rb +103 -0
  65. data/test/test_parse_webdecision.rb +121 -0
  66. data/test/test_parser.rb +69 -0
  67. data/test/test_parser_parse.rb +110 -0
  68. metadata +225 -0
@@ -0,0 +1,43 @@
1
+ ****CalculateAppParam: Application InputXML
2
+
3
+ <DECISION_REQUEST><APPLICATION ApplicationID="99" OrganizationID="27" CreatedDate="03/19/2012" ModifiedDate="03/04/2013" Summary="Batch Upload Application" StateID="3" State="01 New File" SpouseIncludeFlag="N" SpouseQualFlag="N" JointFlag="N" UserID="199" UserName="Import User" OrganizationName="Loan Import" ForwardDate="03/04/2013" UserTypeId="" Source="Internal" ActName="HSBC" InBankruptcy="N" BankruptcyStatus="None" BankruptcyReaffirmation="N" HideMessages="N" IncomeTolerance="25.0000"><ORGANIZATION OrganizationID="27" UDFInt1="0" UDFInt2="0" UDFInt3="0" UDFInt4="0" UDFInt5="0" UDFStr1="" UDFStr2="" UDFStr3="" UDFStr4="" UDFStr5=""/><USER UserID="199" IsSupervisor="1" UDFInt1="0" UDFInt2="0" UDFInt3="0" UDFInt4="0" UDFInt5="0" UDFStr1="" UDFStr2="" UDFStr3="" UDFStr4="" UDFStr5="" SubmittedUser=""/><APPLICATIONTEAM><APPLICATIONTEAM_USER FirstName="Import" LastName="User" OrganizationName="Loan Import" OriginType="Internal" UserType="Originator" UserID="199" LoginID="Import" UDFStr1="" UDFStr2="" UDFStr3="" UDFStr4="" UDFStr5=""><APPLICATIONTEAM_USER_ORGANIZATION Address="" City="" Region="CA" Zip="" PhoneNumber="" OrganizationID="27"/></APPLICATIONTEAM_USER><APPLICATIONTEAM_USER FirstName="The" LastName="Borrower" OrganizationName="HSBC Corporate" OriginType="Internal" UserType="Borrower" UserID="234" LoginID="borrower" UDFStr1="" UDFStr2="" UDFStr3="" UDFStr4="" UDFStr5=""><APPLICATIONTEAM_USER_ORGANIZATION Address="" City="" Zip="" PhoneNumber="" OrganizationID="2"/></APPLICATIONTEAM_USER></APPLICATIONTEAM><APPLICANTS><APPLICANT BorrowerID="99" FirstName="HIPPOL D CANTA A" NationalId="555256093" IsPrimary="Y" Score="0" ForeignNationalIndicator="N"><EMPLOYMENTS><EMPLOYMENT EmploymentID="99" IsSelfEmployed="N" Type="Primary" Retired="0" W2="Y"/><EMPLOYMENT EmploymentID="2099" IsSelfEmployed="N" Type="Previous" Retired="0" W2="Y"/></EMPLOYMENTS><RESIDENCES><RESIDENCE ResidenceID="99" IsPresent="Y" IsMailing="N"/></RESIDENCES></APPLICANT><APPLICANT BorrowerID="1099" FirstName="DAMAR T DAMARIO" NationalId="535817167" IsPrimary="N" ForeignNationalIndicator="N"><EMPLOYMENTS><EMPLOYMENT EmploymentID="1099" IsSelfEmployed="N" Type="Primary" Retired="0" W2="Y"/><EMPLOYMENT EmploymentID="3099" IsSelfEmployed="N" Type="Previous" Retired="0" W2="Y"/></EMPLOYMENTS><RESIDENCES><RESIDENCE ResidenceID="1099" IsPresent="Y" IsMailing="N"/></RESIDENCES></APPLICANT></APPLICANTS><ASSETS/><PARAMETERS><PPM Name="UDF IUI Insurance Premium" Value="00000.00"/><PPM Name="UDF Current Deferred Principal" Value="000000000.00"/><PPM Name="UDF Trial Payment Received Date 3"/><PPM Name="UDF Reli Insurance Premium" Value="00000.00"/><PPM Name="UDF Current Deferred Interest" Value="000000000.00"/><PPM Name="UDF Initial Tax / Insurance Required Date"/><PPM Name="UDF Life Insurance Premium" Value="00000.00"/><PPM Name="UDF TDR Flag" Value="0"/><PPM Name="UDF Disability Insurance Premium" Value="00000.00"/><PPM Name="UDF Initial Tax / Insurance Complete Date"/><PPM Name="Borrower Intends Short Sale"/><PPM Name="UDF AppDebugCheck1"/><PPM Name="UDF DebugCheck1" Value="N"/><PPM Name="UDF DebugCheck2" Value="N"/><PPM Name="UDF DebugCheck3" Value="N"/><PPM Name="UDF DebugText1" Value=""/><PPM Name="UDF DebugText2" Value=""/><PPM Name="UDF Due Day"/><PPM Name="UDF Escrow Balance"/><PPM Name="UDF Has Previous 6 Payment Mod"/><PPM Name="UDF Initial Tax / Insurance Complete"/><PPM Name="UDF Previous Mod Category2 Activated Date"/><PPM Name="UDF Use Validation Scripting" Value="N"/><PPM Name="ManualCredit" Value="Y"/></PARAMETERS><LOANS><LOAN LoanID="99" LoanNumber="99" Amount="16458.4400" Rate="5.2500" LienNumber="2" Duration="480" ComboFlag="N" LienType="2nd" HighOverDueActivities="0" MediumOverDueActivities="0" LowOverDueActivities="0" LoanStage="99 Decline Application" CurrentStage="99 Decline Application" PI="123.5700" OriginalLoanAmount="17950.0000" SellerLoanNumber="7043885860" MortgageType="HELOC" IOIndicator="N" Decision="N" RemainingOriginalTerm="0" PastDueAmount="243.5700" MaturityDate="08/31/2025" EscrowPaymentAmount="0.00000" NoteResetRate="0.0000" GSELoanNumber="0000000000" NoteDate="08/01/1985" SuspenseAmount="0.0000" EscrowShortageForAdvances="0.0000" ProductBeforeMod="ARM" OriginalRate="6.75000" PayArrearagesAtOnceWithLiqAssets="N" PayArrearagesInInstmntWithLiqAssets="N" FNMAHomeSaverNote="N" CurrentlyInLoanMod="N" PreviousModifiedUnderHMP="N" BorrowerAgreesEscrowSetup="N" Approval="N" MIPartialClaimPayment="0.0000" InternalStatusCode="1LMCode-NotActive" NPVLock="0" ProductID="37" LTVAtOrigination="0.0000" PriorLoanMod="N" ImminentDefaultFlag="N" TimeInCurrentStage="1" AncillaryAmount="0.0000" OriginalLoanStandardSecurityInstrument="N" InterVivosTrust="N" CurrentMaturityDate="08/31/2025" PreviousModificationForbearanceAmount="0.0000" IOIndicatorCurrent="N" CurrentNextRateResetDate="01/28/2012" PastTwoYearsTaxesPaid="N" EscrowBalance="0.0000" RecoverableCorporateAdvances="0.0000" StageChangeDate="03/04/2013" ARMFlag="N" OriginationFrontEndRatio="0.0000" CurrentPaymentDueDay="23" ServicingSystem="HMS" PMIInsurance="N" CurrentPrincipalPayment="123.5700" CurrentIOPayment="0.0000" IncompletenessLetterSentCount="0" FFIEC="N" AgencyType="L2F" PendingServiceRelease="N" HasEscrowAccount="N" HOAFeesCurrent="N" CurrentlyOnActiveMod="N" CorpAdvancesForDQTaxes="0.0000" CorpAdvancesNonTaxNonInsurance="0.0000" BorrowerSendDocsBeforeExpirationDate="N" OptOutofNewMod="N" PendingInvestorAccount="N" MinARMAdjustment="0.0000" MaxARMAdjustment="0.0000" ARMChangeFrequency="0" ARMFloor="0.0000" ARMCeiling="18.0000" PrepayFlag="N" GrossDisposableIncomeatOrigination="0.0000" InvestmentPropertyAtOrigination="N" PayrightRewardsFlag="N" PreviousModNoOrLowIncome="N" TroubledDebtReservesFlag="N" BorrowerAgreedToSendDocuments="N" TaxWatchandInsuranceProjectionsCompleted="N" CreditType="Y" ContractualInterestRate="0.0000" IsPrincipalWriteDown="N" IsPersonalHomeLoan="N" ContractualPIPayment="0.0000" InterestMethodType="020" AssociationDuesEscrowed="N" OfferMeetsFHAGuidelines="N" OptionalInsuranceAmount="0.0000" PreviouslyModifiedUnderHAMPTier2="N" DeclineApproval="N" CompletedDocs="N" PCOValue="0.0000" ServicingAdvances="0.0000" StageAlias="Denied"><LOCKS/><DEFAULT DelinquencyStatus="CurrentOrNotDelinquent" AbilityToResumeCurrentMtgPmt="N" DQPIPayment="0.0000" DelinquentCounselorCode="L2F" AccountInLitigation="N" BankruptcyLitigation="N" ChangeofCircumstance="N" IncomePreviouslyUsedForCategory1Mod="N"/><INVESTOR InvestorCode="30041"/><MSP/><SERVICER/><LISTINGAGENT/><PREVIOUSMODS ModCount="1" ModsLast60MonthsCount="0" PreviousModDTI="0.0000" NoOrLowIncome="N" PreviousModificationDeferredInterest="0.0000" Category2ModTerm="0"><PREVIOUSMOD Category1ModCount="0" Category1ModActivatedCount="0" Category1FailedTrialsCount="0" Category1FailedTrialPmtsCount="0" Category1FailedTrialNSFCount="0" CategoryFailedTrialDocNotSentCount="0" Category1ModFailedCount="0" Category1InterestRate="0.0000" Category1MonthlyPayment="0.0000" Category1ModTerm="0" Category1ModDisposableIncome="0.0000" Category1ModTotalIncome="0.0000" LastRestructureDate="03/24/2000"><Category1 Forbearance="N"/></PREVIOUSMOD></PREVIOUSMODS><Decision GuidelineId="34" GuidelineName="FAP II Loan Modification Program Guideline" ExecutionTime="2013-03-04T18:28:03.737"><DerivedParameters><DPM Name="Exclusion Decision" Value="Exclude"/><DPM Name="Trial Period Completed" Value="N"/><DPM Name="Low Income Flag" Value="N"/><DPM Name="Foreclosure NPV Value" Value="999999999.99"/><DPM Name="Days Since Last Appraisal" Value="0"/><DPM Name="Type Of Modification"/><DPM Name="Can Change Stage" Value="Y"/><DPM Name="Material Change Rate" Value="999.99"/></DerivedParameters></Decision><AFTERMOD PrincipalForbearanceAmount="0.0000"/><OTHERLOAN IOIndicator="N"/><HAUP/><NPVRESULTFROMTREASURY WaterfallTest="N" DeminimisTest="N" ForbearanceFlag="N" NPVRunSuccessful="N" PRAWaterfallTest="N" PRANPVTest="N"/><OVERRIDES/><TASKS><TASK TaskID="63" TaskDefinitionID="9" TaskStage="99 Decline Application" Name="Sending Denial Letter" Status="Open" TaskType="Workflow"/></TASKS><TITLE_COMPANY/><PRODUCT ProductID="37" Name="FAP II Loan Modification"/><CLOSING_COMPANY/></LOAN></LOANS><COLLATERALS><COLLATERAL CollID="99" AddressL2="00100 CORNBLUE STREET" City="EARTHQUAKE" PostalCode="93304" RegionValue="CA" Units="1" RealEstateType="SingleFamily" LoanID="99" NonWarrantableCondo="0" HUDRepo="0" ModelHomeLeaseback="0" InheritedProperty="0" ValidAVM="N" ValidFlood="N" Occupied="N" Listed="N" OccupancyStatus="BorrowerOccupied" ForeclosureStatus="None" TenantCooperation="N" PermissionToContactAgent="N" HOAorManagementCompany="N" OriginationValue="0.0000" PropertyDamage="N" Cancellation="N" RescindedMICoverage="N" AbilitytoContribute="N" ReasonforDefaultResolved="N" ChargedOff="N" RentalPropertyCertified="N"><COUNTIES><COUNTY StateCode="06" State="CA" CountyCode="029" CountyName="Kern County" CBSACode="12540" CBSATitle="Bakersfield CA" CBSALSAD="Metropolitan Statistical Area"/></COUNTIES><HAMPCOUNTIES><COUNTY ZipCode="93304" Region="8" MSAName="Bakersfield CA"/></HAMPCOUNTIES><VALUATIONS><VALUATION AsIsValue="0.0000" IsCurrent="Y"/><VALUATION Type="AutomatedValuationModel" IsCurrent="N"/><VALUATION Type="BrokerPriceOpinion" AsIsValue="0.0000" IsCurrent="N"/><VALUATION Type="Fullappraisal" IsCurrent="N"/><VALUATION Type="AutomatedValuationModelOther" IsCurrent="N"/></VALUATIONS><SHORTSALE MIApprovalRequiredforSS="N" AllowrentafterSS="N" AllowDILifSSFails="N" AllowDeedforLease="N" ListPropertyAsIs="N" AcceptSaleifNetProceedsMet="N" VendorRetainedtoAssistListingAgentwithSS="N" PreviousShortSaleAttemptFailed="N"/><LIQUIDATION TitleDelayorIssue="N" LegalDelayorIssue="N"/></COLLATERAL></COLLATERALS></APPLICATION><WORKFLOWEVENT Name="ClearDataPreEvent"><EVENTATTRIBUTES /></WORKFLOWEVENT></DECISION_REQUEST>
4
+
5
+
6
+ PRIMARY PARAMETER VALUES***********Output XML*******
7
+ <PARAMS><_DATA_SET _Name='CURRENT LOAN STAGE' _Value='99 Decline Application'/><_DATA_SET _Name='STATE OF THE SUBJECT PROPERTY' _Value='CA'/><_DATA_SET _Name='TODAYS DATE' _Value='3/4/2013 12:00:00 AM'/><_DATA_SET _Name='FORWARD DATE' _Value='3/4/2013 12:00:00 AM'/></PARAMS>
8
+ **********Primary Parameters Ends at 3/4/2013 7:29:01 PM**********
9
+
10
+ ******Guideline****************
11
+
12
+ <Guideline Id=47 Name=WF-DataClearing-Pre Version=1218/>
13
+
14
+ <Decision GuidelineId="47" GuidelineName="WF-DataClearing-Pre" Rulecount="0" ExecutionTime="3/4/2013 7:29:01 PM" ExecutionResult="True">
15
+ <Rules> <Rule Name="Set-CurrentStage" Id="73331" ConditionResult="True">
16
+ <DPM Name="Current Stage" Type="DPM">99 Decline Application</DPM>
17
+ <DPM Name="Stage" Type="DPM">99</DPM>
18
+ <DPM Name="stageNum" Type="DPM">99</DPM>
19
+ </Rule>
20
+ <Rule Name="Hold-CalcNumDaysInStage99" Id="100287" ConditionResult="True">
21
+ <DPM Name="tempDate" Type="DPM">3/4/2013 12:00:00 AM</DPM>
22
+ <DPM Name="Todays Date" Type="DPM">3/4/2013 12:00:00 AM</DPM>
23
+ <DPM Name="Temp Number" Type="DPM">0</DPM>
24
+ </Rule>
25
+ <Rule Name="Hold-DoNotDataClear" Id="100288" ConditionResult="True">
26
+ <Message Type="EXCEPTIONS" RuleId="100288" RulesetId="539" Id="0" PriorTo="" Category="" Visibility="" Critical=""><![CDATA[ Should not clear. ]]></Message> <DPM Name="Decision" Type="DPM">Fail</DPM>
27
+ </Rule>
28
+ </Rules>
29
+ <Decision GuidelineId="47" GuidelineName="WF-DataClearing-Pre" Rulecount="0" ExecutionTime="3/4/2013 7:29:01 PM" ExecutionResult="True">
30
+ <Messages>
31
+ <Message Type="Exceptions" RuleId="100288" RulesetId="539"><![CDATA[Should not clear]]></Message>
32
+ </Messages>
33
+ <DerivedParameters>
34
+ <DPM Id="727" Name="Decision" Type="DSM" Order="0" ProductType="6">Fail</DPM>
35
+ <DPM Id="1071" Name="Current Stage" Type="DSM" Order="0" ProductType="6">99 Decline Application</DPM>
36
+ <DPM Id="1194" Name="Stage" Type="DPM" Order="0" ProductType="6">99</DPM>
37
+ <DPM Id="736" Name="tempDate" Type="DPM" Order="0" ProductType="2">3/4/2013</DPM>
38
+ <DPM Id="697" Name="Todays Date" Type="DPM" Order="0" ProductType="2">3/4/2013</DPM>
39
+ <DPM Id="1225" Name="stageNum" Type="DPM" Order="0" ProductType="4">99</DPM>
40
+ <DPM Id="763" Name="Temp Number" Type="DPM" Order="0" ProductType="4">0</DPM>
41
+ </DerivedParameters>
42
+ </Decision></Decision>
43
+