gdlc 2.5.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,881 @@
1
+ # Guideline Compiler User Manual
2
+
3
+ ## Summary
4
+
5
+ GDLC is a guideline compiler. It was created to allow guidelines to be written using text files and a simple language. The compiler parses and compiles the text files (called source files) into an XML version of the guideline. This XML file can be uploaded directly into the application using the normal upload procedure.
6
+
7
+ - - -
8
+ ## TOC
9
+
10
+
11
+ - - -
12
+ ## Running GDLC from the command line
13
+
14
+ Typing GDLC without any parameters (or with the -h option) will result in the following usage message:
15
+
16
+ ======================================================================
17
+ GDLC GuideLine Compiler
18
+ Usage: GDLC inFile [outFile] [-switch]* [--I]* [--C]*
19
+
20
+ [] = optional
21
+ * = 0 or more, separated by spaces
22
+
23
+ inFile name of file to compile.
24
+ outFile name of XML output file. (default is guideline name)
25
+
26
+ --switches--
27
+ -h, -help show usage instructions.
28
+ -version display the application version.
29
+
30
+ -no,-nooutput do not generate output.
31
+ -r, -raw force output of all rules/sets/lookups.
32
+ outFile is a required parameter when -raw is used.
33
+ -v, -verbose show all status messages.
34
+ -vp, show parse tree.
35
+
36
+ -validxml output valid xml.
37
+
38
+ --parameters--
39
+ --Ipath path to include dir. Default: current dir
40
+ --Cpath path to search for config files.
41
+
42
+ ======================================================================
43
+
44
+ The `-raw` option is not available at this time.
45
+
46
+ - - -
47
+ ## Compiler Options
48
+
49
+ ### Inclusion Paths
50
+
51
+ Inclusion Paths are directory paths the compiler will search to find files `import`ed
52
+ or `include`d by your source files.
53
+
54
+ Inclusion paths are set using the `--I` command line parameter. Multiple
55
+ directories can be added to the inclusion path list with repeated use of
56
+ the `--I` flag.
57
+
58
+ Example:
59
+
60
+ gdlc my_rules.gdl my_output.xml --Irelative/path/to/my/include/dir --I/another/path
61
+
62
+ ### Configuration Paths
63
+
64
+ Configuration Paths are directory paths the compiler will search to find
65
+ configuration files.
66
+
67
+ Configuration paths are set using the `--C` command line parameter. Multiple
68
+ directories can be added to the configuration path list with repeated use of
69
+ the `--C` flag similar to the Inclusion Paths above.
70
+
71
+
72
+ - - -
73
+ ## Documentation Conventions
74
+
75
+ Text surrounded with square brackets [] is optional.
76
+ Text formatted like `this` indicates a _keyword_.
77
+
78
+ - - -
79
+ ## GDL Syntax
80
+
81
+ **Notes:**
82
+
83
+ + GDL is CaSe sEnSitiVe.
84
+ + _Definitions_ mean the objects are being **defined**
85
+ + _References_ mean previously defined objects are being **referenced**
86
+ + Most reference statements must be terminated with `;`
87
+ + `rule`, `ruleset`, and `guideline` definition statements must be terminated with `end`.
88
+ + Comments may be placed into the guideline source code in one of two ways:
89
+ + _Single line comments:_ Any text from `//` to the end of a line is considered a comment
90
+ + _Multi line comments:_ All text within a `/* ... */` pair is considered a comment.
91
+
92
+
93
+ ### Keywords
94
+
95
+ alias app boolean condition continue
96
+ crd date decision dpm dsm
97
+ else end false guideline if
98
+ import IN include InsertPricingGuideline lookup
99
+ message money numeric OUT percentage
100
+ PL powerlookup ppm prd rule
101
+ ruleset text then true xmlfunc
102
+
103
+ ### Identifiers
104
+
105
+ Variable, `rule`, `ruleset` and `condition` identifiers (names) are limited to the
106
+ string lengths listed below. Spaces and special characters (such as `&, *, and @`)
107
+ are not allowed as part of the identifier. The **only** special characters that
108
+ are allowed (other than alphanumeric characters) are `_` (the underscore) and
109
+ `-` (the dash). Identifiers must start with a letter.
110
+
111
+ DPM/DSM variable names/aliases are limited to a maximum character length of 50.
112
+
113
+ ### Operators
114
+
115
+ These operators are available for use in the guidelines.
116
+
117
+ #### Equality Operators
118
+
119
+ Equality operators can only be used inside of `if` statements.
120
+
121
+ < <= >
122
+ >= == !=
123
+ <> in ??
124
+
125
+ #### Boolean Operators
126
+
127
+ Boolean operators can only be used inside of if statements.
128
+
129
+ && and || or ( )
130
+
131
+ #### Mathematical Operators
132
+
133
+ Mathematical operators can only be used on the right hand side of assignment (`=`) statements.
134
+
135
+ + - * / ^ ( )
136
+
137
+ - - -
138
+ ## Variables
139
+
140
+ All variable definition statements must be terminated with a `;`.
141
+
142
+ ### PPMs
143
+
144
+ PPM variables are primary parameter variables. They are considered _read only_
145
+ by the application. The application initializes PPM variables with values from
146
+ the engine based on their XPath definition.
147
+
148
+ #### Definitions
149
+
150
+ ppm valueType ppmType identifier ["alias"];
151
+
152
+ ##### Examples
153
+
154
+ ppm text prd pProgramName "Program Name";
155
+ ppm text app pUserType "User Type";
156
+ ppm money crd pMortgagePayoffs "Mortgage Payoffs";
157
+
158
+ ##### Types
159
+
160
+ **valueType:**
161
+
162
+ The type of data the PPM will return:
163
+
164
+ + `boolean`
165
+ + `date`
166
+ + `money`
167
+ + `numeric`
168
+ + `percentage`
169
+ + `text`
170
+
171
+ ##### AppXML Source
172
+
173
+ **ppmType:**
174
+
175
+ What section of the AppXML is the PPM sourced from:
176
+
177
+ + `app`: application
178
+ + `prd`: product
179
+ + `crd`: credit
180
+
181
+ ### DPMs
182
+
183
+ DPM variables are derived parameter variables. These variables are considered
184
+ _read/write_ by the application (the value that they contain can be modified
185
+ by guideline rules).
186
+
187
+ #### Definitions
188
+
189
+ dpm valueType identifier ["alias"];
190
+
191
+ ##### Examples
192
+
193
+ dpm numeric creditGradeScore;
194
+ dpm text docTypeAbbrev;
195
+ dpm money loanAmount "Loan Amount";
196
+
197
+ ##### Types
198
+
199
+ The type of data the variable will contain:
200
+
201
+ + `boolean`
202
+ + `date`
203
+ + `money`
204
+ + `numeric`
205
+ + `percentage`
206
+ + `text`
207
+ + `datetime`
208
+
209
+ TALK ABOUT NUMERIC PRECISION
210
+
211
+ #### References
212
+
213
+ ### DSMs
214
+
215
+ DSM variables are a special subset of DPM variables. They are indicated by the
216
+ `decision` keyword that begins the variable definition. Refer to the DPM variable
217
+ description for further restrictions/applications.
218
+
219
+ #### Definitions
220
+
221
+ decision dpm valueType identifier ["alias"];
222
+
223
+ ##### Examples
224
+
225
+ decision dpm numeric testDsm "Test DSM Alias";
226
+
227
+ #### References
228
+
229
+ ### LOS Restrictions
230
+
231
+ **LOS Guideline Engine Restriction**
232
+
233
+ The guidelines must initialize a DPM/DSM variable to a value
234
+ **before it is referenced in any way** (other than an assignment), or an application
235
+ level error will be thrown.
236
+
237
+ _This restriction does not apply to the AMS Guideline Engine._
238
+
239
+ - - -
240
+ ## Lookups
241
+
242
+ ### Definitions
243
+
244
+ lookup("Lookup Name", xParameterVariable, yParameterVariable);
245
+
246
+ ### References
247
+
248
+ This statement defines a lookup and returns the looked-up value. It can be used
249
+ on the right hand side of an assignment ( `=` ) statement.
250
+
251
+ aValue = lookup("FHA-ClosingCostState", pSubjectPropertyState, globalParam);
252
+
253
+ When a lookup is defined, the compiler searches for the lookup data in memory.
254
+ An error will be thrown if the data does not exist. See the `import` statement
255
+ for how to load lookup data.
256
+
257
+ All lookup definition/reference statements must be terminated with a `;`.
258
+
259
+
260
+ - - -
261
+ ## PowerLookups
262
+
263
+ ### Definitions
264
+
265
+ Need more info here.
266
+
267
+ Example needed.
268
+
269
+ ### References
270
+
271
+ - - -
272
+ ## Rules
273
+
274
+ ### Definitions
275
+
276
+ Rule definitions consist of an if statement block surrounded with
277
+ the `rule` and `end` keywords:
278
+
279
+ rule RuleIdentifier()
280
+
281
+ // if statement block
282
+
283
+ end
284
+
285
+ Note the required parenthises at the end of the rule identifier.
286
+
287
+ An `if` block is made up of the keywords `if`, `then`, `else` (optional)
288
+ and `end` to close it.
289
+
290
+ rule SomeRule()
291
+
292
+ if( /* conditional statements */ )
293
+ then
294
+
295
+ // assignment statements (if conditionals equate to true)
296
+
297
+ else
298
+
299
+ // assignment statements (if conditionals equate to false)
300
+
301
+ end // end of if block
302
+
303
+ end // end of rule block
304
+
305
+ Conditional statements **must** be surrounded by parenthesis. If multiple
306
+ conditional statements are used (combined with `or`, `||`, `and`, or `&&`) then
307
+ each conditional statement is surrounded, as is the group.
308
+
309
+ Single conditional example:
310
+
311
+ rule SingleConditionalRule()
312
+
313
+ if( a == b )
314
+ then
315
+ a = c;
316
+ end
317
+
318
+ end
319
+
320
+ The statement above does not contain the optional `else` statement. While
321
+ the `else` (if false) block is optional, the true block is not.
322
+
323
+ Also note that assignments (`=`) cannot be used in the conditional section of an
324
+ `if` statement, only the boolean operators listed elsewhere.
325
+
326
+ Multiple conditional example:
327
+
328
+ rule MultipleConditionalRule()
329
+
330
+ if(
331
+ ( a == b ) &&
332
+ ( b == c )
333
+ )
334
+ then
335
+ a = d;
336
+ end
337
+
338
+ end
339
+
340
+ This rule could also be written as:
341
+
342
+ rule MultipleConditionalRule()
343
+
344
+ if(
345
+ ( a == b ) and
346
+ ( b == c )
347
+ )
348
+ then
349
+ a = d;
350
+ end
351
+
352
+ end
353
+
354
+ Here's a more complicated example:
355
+
356
+ rule ComplicatedMultipleConditionalRule()
357
+
358
+ if(
359
+ (
360
+ ( a == b ) and
361
+ ( b == c )
362
+ ) or
363
+ (
364
+ ( a != b ) and
365
+ ( b != c )
366
+ )
367
+ )
368
+ then
369
+ a = d;
370
+ end
371
+
372
+ end
373
+
374
+ For readability purposes, if you use `and`, and `or` in your statements,
375
+ do not combine them with `&&` and `||`. The compiler won't complain; it is
376
+ acceptable syntax, but can be confusing to the reader.
377
+
378
+ Here's that rule again using the alternative operators:
379
+
380
+ rule ComplicatedMultipleConditionalRule()
381
+
382
+ if(
383
+ (
384
+ ( a == b ) &&
385
+ ( b == c )
386
+ ) ||
387
+ (
388
+ ( a != b ) &&
389
+ ( b != c )
390
+ )
391
+ )
392
+ then
393
+ a = d;
394
+ end
395
+
396
+ end
397
+
398
+ The end result is the same.
399
+
400
+ A more realistic example of a simple rule:
401
+
402
+ rule SetAppraisedValue()
403
+ if(pReviewValue != 0)
404
+ then
405
+ appraisedValue = pReviewValue;
406
+ else
407
+ appraisedValue = purchasePrice;
408
+ end
409
+ end
410
+
411
+ ### References
412
+
413
+ When referencing a rule, either in a ruleset or a guideline, where the rule
414
+ has already been defined, use this syntax:
415
+
416
+ rule SetAppraisalValue();
417
+
418
+ - - -
419
+ ## Rulesets
420
+
421
+ ### Definitions
422
+
423
+ Missing info about 'PL' modifier keyword.
424
+
425
+ ruleset InitAppraisedValue(continue)
426
+
427
+ rule SetAppraisedValue()
428
+ if(pLoanAmount == pLoanAmount)
429
+ then
430
+ appraisedValue = pAppraisalValue;
431
+ end
432
+ end
433
+
434
+ // ------------------------
435
+
436
+ rule SetBPOValue()
437
+ if(pReviewValue != 0)
438
+ then
439
+ BPOValue = pReviewValue;
440
+ end
441
+ end
442
+
443
+ end // ruleset
444
+
445
+ Both rule references, and rule definitions can be used within a ruleset.
446
+
447
+ ### References
448
+
449
+ - - -
450
+ ## Conditions
451
+
452
+ condition identifier("SystemName", CategoryType, PriorToType, "Image Doc Type", "Visibility", "Condition message");
453
+
454
+ **SystemName:** Name of the condition when displayed in the GUI conditions interface.
455
+
456
+ **CategoryType:** Category of condition. By default, the following are available:
457
+
458
+ + asset
459
+ + income
460
+ + property
461
+ + purchase
462
+ + title
463
+
464
+ **PriorToType:** Stage where condition should be cleared 'prior to'.
465
+ By default, the following are available:
466
+
467
+ + docs
468
+ + funding
469
+ + approval
470
+
471
+ **Image Doc Type:** Name of the 'type' of document the condition is expecting.
472
+
473
+ **Visibility:** Visibility of the condition.
474
+
475
+ + "" <blank> = default visibility
476
+ + Internal = Internally visible - Not visible from the Borrower Portal
477
+ + External = Externally visible - Can be seen in the Borrower Portal
478
+
479
+ **Condition message:** Actual text of the condition/stipulation.
480
+
481
+ Condition definition statements must be terminated with a `;`.
482
+
483
+ Condition reference statements must be terminated with `();`.
484
+
485
+ Condition message definitions contain a number of required parameters used by
486
+ the system to generate 'underwriter' conditions. If a condition message is
487
+ redefined only the last definition will be used (uploaded) regardless of
488
+ where the definition occurred within the guideline.
489
+
490
+ _A warning message will be generated by the compiler so you know this has happened._
491
+
492
+ Condition message references can only be used within the 'if-true' or
493
+ 'if-false' sections of rule definitions.
494
+
495
+ ### Definitions
496
+
497
+ condition DeathCertificate("Death Certificate", Legal, Qualification, "Death Certificate", "External",
498
+ "Death Certificate");
499
+
500
+ ### References
501
+
502
+ condition DeathCertificate();
503
+
504
+ ### Defining Categories
505
+
506
+ To define your own categories, create a file named `category.properties`.
507
+ Populate it with key/value pairs.
508
+
509
+ Disability-Co:3
510
+ HardshipPackage-Co:2
511
+ Property:4
512
+ Property-Other:6
513
+ Borrower:7
514
+ Financials:8
515
+ Authorizations:9
516
+ Financials-Co:10
517
+ Retirement:11
518
+ HardshipPackage:12
519
+ Maintenance:13
520
+ Legal:14
521
+ Disability:15
522
+ Other:16
523
+
524
+ Each key/value pair must be separated with `:` or `=`. White space does not
525
+ matter, with the understanding that trailing white space at the end of the
526
+ line is discarded.
527
+
528
+ Another example (these are all valid):
529
+
530
+ Property :4
531
+ Property-Other: 6
532
+ Borrower = 7
533
+ Financials=8
534
+
535
+ _Note:_
536
+ The `value` part of the key/value pair is a DB ID. To determine which IDs to
537
+ use, the Factory Defaults document should be referenced.
538
+
539
+ ### Defining PriorTos
540
+
541
+ To define your own Prior To types, create a file named `priorto.properties`.
542
+ Populate it with key/value pairs.
543
+
544
+ Processing:8
545
+ Submission:9
546
+ Qualification:10
547
+ TrialPeriod:11
548
+ LoanModification:12
549
+
550
+ The same requirements/restrictions from above (Categories) apply to PriorTos.
551
+
552
+ _Note:_
553
+ The `value` part of the key/value pair is a DB ID. To determine which IDs to
554
+ use, the Factory Defaults document should be referenced.
555
+
556
+ ### Telling the Compiler about your Properties
557
+
558
+ Use the `--C` flag to tell the compiler what directory to search for
559
+ your properties files.
560
+
561
+ --Cpath/to/my/properties/dir
562
+
563
+
564
+ - - -
565
+ ## Messages
566
+
567
+ message (messageType, "Message text to display.");
568
+
569
+ ### Message Types
570
+
571
+ Exception type messages are used to indicate a failure of some
572
+ sort. Exception messages are displayed on the decision results. Message types
573
+ other than exceptions are used to convey information to the user. The following
574
+ types are available:
575
+
576
+ **messageType:**
577
+
578
+ + `exception`
579
+ + `findings`
580
+ + `observation`
581
+ + `credit`
582
+
583
+ **Message text:** Actual text of the message that will be displayed.
584
+
585
+ #### DPMs in Messages
586
+
587
+ DPM variable values can be incorporated into the message text by surrounding
588
+ the variable name with `<DPM> </DPM>` tags.
589
+ When using DPM variables within messages, if the DPM/DSM has an alias
590
+ defined, the alias must be used; the engine only recognizes/knows about the
591
+ alias.
592
+
593
+ TODO:IS THIS STILL TRUE (ABOUT ALIASES)?
594
+
595
+ TODO:DISCUSS THE ABILITY TO UNDERSTAND ALIAS' WHEN PULLING FROM PLKS.
596
+
597
+ Message definition statements must be terminated with a `;`.
598
+
599
+ Message definitions can only be used within the 'if-true' or 'if-false'
600
+ sections of rule definitions.
601
+
602
+ #### Exception messages
603
+
604
+ message(exception, "LTV of <DPM>LTV</DPM> is greater than 70%.");
605
+
606
+ Exception messages are only displayed in the application in the case of a
607
+ decline, or decision failure (`Decision != "Pass"`).
608
+
609
+ #### Findings messages
610
+
611
+ message(findings, "The borrower has a payoff on their credit report.");
612
+
613
+ Findings messages (including all non-exception messages) are only displayed
614
+ in the applicaation when there's **no** decision failure (`Decision == "Pass"`).
615
+
616
+ - - -
617
+ ## Aliases
618
+
619
+ Aliases were designed so the developer could write GDL code using valid
620
+ identifier names even though the application is expecting an identifier
621
+ that contains spaces. This is especially important for PPMs (because
622
+ they cannot be renamed in the system). Aliases are also used with DSMs
623
+ for the same reasons.
624
+
625
+ For example, application expects a DSM named `Price Adj-Total`. With an alias,
626
+ this is no problem. The rules can reference a `dpm` named `priceAdj-total`
627
+ (notice there are no spaces) and the uploaded XML will reference the dpm
628
+ as `Price Adj-Total`.
629
+
630
+ Aliases can be used with variables, rulesets and rule identifiers. Please
631
+ note that the alias itself must be in quotes in **all** cases, regardless of
632
+ whether or not it contains spaces.
633
+
634
+ All alias statements must be terminated with a `;`.
635
+
636
+ ### Variables
637
+
638
+ Variable aliases are created during variable definition. The alias is the part
639
+ of the definition in quotes.
640
+
641
+ // A DPM
642
+ dpm text someHumanName "Some Human Name Alias";
643
+
644
+ // A DSM
645
+ decision dpm numeric(3) modRate "Mod Rate";
646
+
647
+ // A PPM
648
+ ppm crd pCreditScore "Credit Score";
649
+
650
+ ### Rules
651
+
652
+ alias ( rule, Identifier, "Alias name" );
653
+
654
+ A rule alias statement consists of the `alias` keyword, an alias type of `rule`,
655
+ the rule identifier and the rule alias.
656
+
657
+ alias(rule, SimpleAliasRule1, "Alias Rule 1");
658
+
659
+ ### Rulesets
660
+
661
+ alias ( ruleset, Identifier, "Alias name" );
662
+
663
+ A ruleset alias statement consists of the `alias` keyword, an alias type of
664
+ `ruleset`, the ruleset identifier and the ruleset alias. Because a
665
+ powerlookup is just a ruleset, they can be aliased as well. _In fact, this
666
+ is how they are generated when PLK .csv files are imported._
667
+
668
+ alias(ruleset, SimpleAliasRuleset1, "Alias Ruleset 1");
669
+
670
+ - - -
671
+ ## Guideline Definitions
672
+
673
+ guideline("Guideline Name")
674
+
675
+ ...
676
+
677
+ end
678
+
679
+ The guideline statement defines the rules, rulesets, powerlookups and lookups
680
+ that are within a guideline object. The order of all contained statements
681
+ will be preserved.
682
+
683
+ A guideline is the main vehicle for outputting XML. When the compiler is
684
+ run in its default mode (no output file specified), the guideline name will
685
+ be used as the filename of the output file. An extension of .XML will be added
686
+ as a suffix.
687
+
688
+ The `guideline` statement must have a matching `end` statement to terminate
689
+ the guideline definition.
690
+
691
+ - - -
692
+ ## Including Source Files
693
+
694
+ include("includeFileName.gdl");
695
+
696
+
697
+ Included files are parsed and compiled at the point that they are included
698
+ within the parent file. _Including_ a file more than once will only result in
699
+ the file being parsed one time. It will be ignored if included again.
700
+
701
+ The include statement must be terminated with a `;`.
702
+
703
+ Files to be included must reside in a directory that has been added to the
704
+ inclusion path list. Filenames can also include a relative path from a
705
+ directory on the inclusion path list:
706
+
707
+ Given the following directory structure:
708
+
709
+ /proj
710
+ |-my_rules.gdl
711
+ |
712
+ |-src
713
+ | |-inc
714
+ | | |-includeFileName
715
+
716
+ and the following compiler command line is run from `/proj`:
717
+
718
+ gdlc my_rules.gdl my_output.xml --Isrc
719
+
720
+ then the following statements would work:
721
+
722
+ include("inc/includeFileName.gdl");
723
+
724
+ include("src/inc/includeFileName.gdl");
725
+
726
+ but this would not:
727
+
728
+ include("includeFileName.gdl");
729
+
730
+ To make this statement work, you could add its directory to the inclusion
731
+ path list like so:
732
+
733
+ gdlc my_rules.gdl my_output.xml --Isrc --Isrc/inc
734
+
735
+ Note that the current directory is added to the inclusion list by default so
736
+ the following would also work:
737
+
738
+ gdlc my_rules.gdl my_output.xml
739
+
740
+ with
741
+
742
+ include("src/inc/includeFileName.gdl");
743
+
744
+ - - -
745
+ ## Importing Files
746
+
747
+ import( importType, "csvFileToImport.csv" );
748
+
749
+ **importType:**
750
+
751
+ + `lookup`
752
+ + `powerlookup`
753
+
754
+ The `import` statement is used to load `lookup` and `powerlookup` data into the
755
+ compiler. Lookup data must be imported before a lookup definition statement
756
+ referencing the data is instantiated. The compiler will throw an error if
757
+ the lookup is referenced prior to import.
758
+
759
+ The `import` statement can only load CSV files. Non CSV files should not be
760
+ referenced by the `import` statement. The CSV file extension must be included
761
+ as part of the filename.
762
+
763
+ The `import` statement must be terminated with a `;`.
764
+
765
+ Imported files must also be on the inclusion path.
766
+
767
+ - - -
768
+ ### Lookup Files
769
+
770
+ import( lookup, "TestLookups.csv");
771
+
772
+ The `lookup` import type will import Lookup matricies from a CSV file.
773
+
774
+ - - -
775
+ ### PowerLookup Files
776
+
777
+ import( powerlookup, "TestPowerLookups.csv");
778
+
779
+ The `powerlookup` import type will import PowerLookups from a CSV file. After
780
+ a `powerlookup` has been imported, its ruleset can be referenced the same as
781
+ any other ruleset.
782
+
783
+ Powerlookups are automatically aliased as they are imported: Spaces are
784
+ removed, dashes and underscores are left in place.
785
+
786
+ Given a PLK named `Test My_Power-Lookup PLK` in the file `TestPowerLookups.csv`,
787
+ its use would be as follows:
788
+
789
+ import(powerlookup, "TestPowerLookups.csv");
790
+
791
+ // ...
792
+
793
+ guideline("MyGuideline")
794
+
795
+ ruleset SomeRuleset();
796
+
797
+ // ...
798
+
799
+ ruleset TestMy_Power-LookupPLK();
800
+
801
+ // ...
802
+
803
+ end // guideline MyGuideline
804
+
805
+
806
+ - - -
807
+ ## XML Functions
808
+
809
+ xmlfunc identifier( [IN|OUT] dpmVariable, [IN|OUT] "constant", [IN|OUT] 15.5 );
810
+
811
+ XML Functions are defined and provided by the engine. The compiler does not
812
+ know whether or not a function is available. It is up to the user to verify
813
+ the function exists before using it in your guideline.
814
+
815
+ To use an XML function, it must first be defined. The compiler does check the
816
+ argument count against the function definition when it is referenced within a
817
+ rule. Errors will be thrown if the argument count doesn't match.
818
+
819
+ In both definitions and references, the `IN` and `OUT` keywords can be used in
820
+ front of each argument. These keywords are optional. They affect nothing and
821
+ are only used as an indicator for the user as to whether the variable is used
822
+ for INput to the function or OUTput from the function. `IN` and `OUT` can be
823
+ used in either definitions, or references, or both.
824
+
825
+ DPM variables, PPM variables, numbers and constants (values surrounded with
826
+ quotes) can be used as arguments. Inline expressions are not allowed as
827
+ arguments to the function. Assigning values to variables before using them
828
+ within a function _can be done within the same rule_.
829
+
830
+ Function _definition_ statements must be terminated with a `;`.
831
+
832
+ Function _reference_ statements must also be terminated with `;` (the same as
833
+ any other assignment operation).
834
+
835
+ ### Definitions
836
+
837
+ Argument _types_ are not checked by the compiler. Because of this, it is usually
838
+ helpful to use constants in the argument list of the definition that describe
839
+ what the argument should be.
840
+
841
+ xmlfunc Floor( IN "NumToBeFloored", IN "Multiple" );
842
+
843
+ ### References
844
+
845
+ XML function references are used on the right hand side of assignment
846
+ operations. The `xmlfunc` keyword is _not_ used in references.
847
+
848
+ rule SetAppraisedValue()
849
+ if(pReviewValue != 0)
850
+ then
851
+ appraisedValue = Floor( IN pReviewValue, IN 100 );
852
+ else
853
+ appraisedValue = purchasePrice;
854
+ end
855
+ end
856
+
857
+ - - -
858
+ ## Miscellaneous
859
+
860
+ ### Inserting a Pricing Guideline (special rule)
861
+
862
+ This keyword is only of use with LOS guidelines. It generates a special rule
863
+ that tells the application where to insert the pricing guideline (into the
864
+ eligibility/program guideline) for the current product.
865
+
866
+ InsertPricingGuideline();
867
+
868
+ Example
869
+
870
+ ...
871
+
872
+ rule SomeRule();
873
+ ruleset MyRuleset();
874
+
875
+ InsertPricingGuideline(); // <--- The pricing/product guideline will be inserted here.
876
+
877
+ ruleset AnotherRuleset();
878
+
879
+ ...
880
+
881
+