The underwriting rules
The example program has a rating manual with four rules:- The premium is $2 for each $1,000 of payroll.
- A firm with claims pays 1.5 times that premium.
- The basic limit is $1,000,000. A higher limit, up to $2,000,000, costs 1.1 times that premium.
- The program rates a payroll of $1,000 or more.
- A professional employer organization (PEO) must be in operation for 3 years or more and be financially sound.
- An underwriter judges the loss experience and the financial soundness.
- A manager signs off a firm that is in operation for less than 3 years.
- A manager signs off a premium of $10,000 or more.
- An underwriter quotes and binds.
Save the rater and check it
Create a folder for the program:rater.rsl.
rater.rsl
rater.rsl
staffing/rater.rsl
premium. Its
coded rule, PAYROLL_BELOW_MINIMUM, refuses a payroll below $1,000, the lowest payroll that the manual rates.
The mark per quote on limit makes the limit a term: each quote of one submission may set
its own limit. Every other input is a fact that all quotes of the submission share.
Run a submission quotes two limits side by side.
Write the guideline
Createguideline.rsl beside rater.rsl, and write it from top to bottom in the seven parts
below. The complete file follows the last part.
Name the program and use the rater
use line links the rater in the same
folder under the short name ts. From here, the rater’s record is ts.Policy.
Declare the roles and the acts
Roles lists the roles from lowest to highest. A role does everything that the roles below it do,
so a manager also answers an underwriter’s questions. Acts names the lowest role that quotes and
the lowest role that binds.
Cite the guideline and declare its values
Ask the questions
policy: ts.Policytakes the rater’s record as one input. The guideline then asks every question of the rater underpolicy.by @Role.uwgives a question to the underwriter. A question that lacksbyis open to every role.policy.experience by @Role.uwgives one of the rater’s questions to the underwriter, by its path.whenasks forfinancially_soundonly when the firm is a PEO.
Read the rater’s premium
ts(self.policy).premium is the rater’s premium outcome for this policy. A guideline reads a
rater through its inputs and its outcomes only, so the rater’s inner calculations stay free to
change. A policy that breaks a coded rule of the rater makes the submission ineligible.
Add the eligibility rule
Close the record with awhere rule that has a code:
Ineligible stage and shows the code and the
message. The answers stay in the log, so a corrected answer makes the submission eligible again.
Decline a submission shows the stage and the decision that follows it.
Add the two referrals
Write the referrals after the rule, then closeRecords and name the outcome:
Approved or
Declined from that role.
Check the guideline
Your file now matches this one:guideline.rsl
guideline.rsl
staffing/guideline.rsl
Work a submission
rslc submission records one submission in a log file. Each command names who acts, as
--as role:name. Each command prints the entries it wrote and then the status of the submission.
Open the log as the assistant
Save the applicant’s answers asapplication.json:
staffing/application.json
program start a hash of the guideline
and the rater, so the same files give the same characters.
The status lists four open questions with the lowest role that may answer each. The policy line
stands for the rater’s questions that every role answers.
Answer from the application
new_venture referral is open before the premium is known.
Read the status
status prints the same block at any time and leaves the log as it is:
input takes an answer. A signoff takes Approved or Declined.
See a refusal
Answer the underwriter’s question as the assistant:NOT_AUTHORIZED and stays as it was. The candidates
line lists the roles that may answer. A refused command exits with code 2, and the refusal is kept
in submission.refused.jsonl, beside the log.
Answer as the underwriter
--because records the reason beside the answer. Every rating answer is in, so the premium is
known: 2,500 × $2 is $5,000. The stage stays Open while the referral waits for the manager.
Sign off the referral as the manager
A sign-off is an answer to the referral’s name:Quotable.
Quote
Change an answer
The applicant reports a higher payroll. Record it as the underwriter:q1 lapses, because a quote rests on every answer. The sign-off stands, because the
condition of new_venture reads only years_in_operation. The premium is now $6,000.
Now change an answer that the referral reads:
Quote again and bind
The quoteq1 stays in the log under its name, so the new quote takes a new name:
Bound at a $6,000 premium. bind takes a quote only while it stands, so a
bound premium always matches the answers in the log. A bound submission is final: the log refuses every later write.
Read the log
history lists every entry with its number and its writer:
submission.jsonl in an
editor. Lines 7 and 8 hold the first sign-off and the first quote:
at holds the time of your run. read holds the answer that the manager saw at the sign-off.
Each key is a hash of the answers that the sign-off or the quote rests on. Commands only add
lines, and each status is computed from the lines.
Decline a submission
A second applicant is a PEO that is 2 years old. Open a second log for it:Ineligible. The log refuses a quote in
this stage. The submission stays open, because a wrong answer and a true one look the same to the
log. A person decides what follows:
- Correct the answer. An answer of 4 years returns the submission to the
Openstage. - Decline the submission.
close declinedrecords the decision.
close declined takes the role of the quote act, here uw, and it works only while a rule or a
sign-off declines. The entry names the code that the decision rests on. Declined is final, like Bound.
Run the whole story as a script
A script file holds the same story, one step on each line, with the results it expects. Save this one asbind.script.
bind.script
bind.script
staffing/bind.script
rslc script plays the steps on a log in memory and checks each expect line. A line that starts
with refused passes when the log refuses the step with that code. Keep the script beside the
guideline as its test, and run it after each change.
Next steps
- Run a submission covers each command, quote options,
--jsonfor a program, and writes that name the entry they read. - Raters and guidelines explains what each file owns and why a sign-off lapses.
- Submission log lists every entry, stage, refusal code and script line.
- Check messages for guidelines explains each message that
rslc checkgives a guideline.