Skip to main content
Install Relativities first; it includes rslc. This guide runs the staffing example, a guideline for the synthetic carrier Example Mutual. Run your own guideline the same way. rslc examples get staffing saves the example, and open starts a log for its guideline:
One log holds one submission. open pins the log to the program, so later commands name only the log. Every command prints the entries it wrote, then the status: the stage and the open questions. The log’s name ends in .jsonl for a file of JSON lines, or in .sqlite for a database. Submission log compares the two. Each command that writes names its writer as --as role:name. The role is one that the guideline declares in Roles. The name is free text for the person or the tool.

Answer questions

A question is an input’s path, such as policy.payroll, or a referral’s name. To answer from a JSON file, pass --file:
The file holds one JSON object. Each top-level key is one question, and each entry names the file as its source. To answer on the command line, write question=value:
  • --because records why the writer gives the answer.
  • --from records where the answer comes from, such as a document or a system.
  • A value is JSON, or a bare word for a string: 2500000, true, no_claims.
  • Quote a value that the shell changes, such as 'policy={"payroll": 2500000}'.
  • One command takes several question=value pairs and applies all of them or refuses all of them.
  • To replace an answer, answer the question again.
  • Name a list item by its key, as in 'placements[class="clerical"].share=0.6'. Submission log gives the rules.

Check the status

The open block lists each question that still needs an answer, its kind, and the lowest role that may answer. A signoff line is a referral with its reason, and each reads line under it is an answer that the sign-off stands for. outcomes known so far lists each outcome that the answers already decide.

Retract an answer

To make a question open again, retract its answer by the path it was given at:
The referral leaves the status, because its condition reads the retracted answer. Answer the question again to continue:

Sign off a referral

A sign-off is an answer to the referral’s name, from the referral’s role or a role above it:
  • Approved lets the submission go on. Declined makes it Ineligible; see Decline a submission.
  • The entry records the answers that the manager saw, after on.
  • retract with the referral’s name takes a sign-off back.
  • A sign-off lapses when an answer that the referral’s condition reads changes. Sign off again on the new answers.

Quote

Give the quote a name:
  • quote works in the Quotable stage: every question has an answer and every open referral is approved.
  • A quote name starts with a lowercase letter and holds lowercase letters, digits and _. A log uses each name once.
  • A quote lapses when an answer or a sign-off changes after it. Quote again under a new name.

Offer quote options

The broker asks for a second quote with a $2,000,000 limit. Both quotes price the same firm, so only the limit differs. The rater marks limit with per quote:
An input with this mark is a term. Every other input is a fact, and all quotes of the submission share one answer to it. A quote option is a named set of answers to terms, laid over the shared answers. Answer the limit in an option named high, with --in:
The status after a command with --in is the status of that option: the premium is $5,500 at the higher limit. The shared answers still hold the $1,000,000 limit, so q1 stands. Quote the option under a new name:
Both quotes stand at once: q1 at $5,000 and q2 at $5,500. A plain status reads the shared answers, at the $1,000,000 limit:
Add --in high to read the option, at $5,500. An option answers terms only. The log refuses a fact in an option with the code NOT_A_TERM:
  • --in works with answer, retract, quote and status.
  • An option’s name follows the rule for a quote’s name.
  • An option starts with its first answer. quote --in on an option that holds zero answers is refused as NOT_QUOTABLE.
  • retract --in high takes back the option’s answer, and the option reads the shared answer again.
  • A new answer to a fact, given as usual, changes every option. Each quote that it changes lapses.
  • A sign-off given as usual counts in each option that holds the answers it read. A sign-off with --in counts in that option alone.

Bind

bind names one quote that stands. The insured accepts the higher limit:
  • bind takes a quote that stands. A bound submission is final.
  • A quote keeps its option, so bind takes the name alone.
  • The outcomes block of a plain status reads the shared answers, here the $1,000,000 limit. The bound policy is the option of q2: read it with status --in high.

Read the history

history lists every entry, with its number and its writer:
To see the status as it was after an earlier entry, pass its number as --at:

Write on what you read

Another person may change a submission between your read and your write. --based-on names the last entry you read, and the log then refuses a write whose facts changed after that entry. Start a second log, with the application and the loss experience in it:
The manager reads this status, whose last entry is 6. Before the manager decides, the underwriter corrects the firm’s age:
The manager signs off the firm of 2 years that entry 6 showed:
The log refuses the sign-off as STALE and names the answer that changed. Read the status again, then write on the entry it shows:
  • --based-on works with answer, retract, quote, bind and close.
  • The log compares only what the command reads. A change elsewhere in the log leaves your write valid.
  • With --in, the log compares what the command reads in that option.
  • The entry number is the last number in history, or seq in the --json output.

Close a submission

To end a submission before a quote is bound, close it with a reason: withdrawn, expired or lost.
A closed submission is final, like a bound one. Each role closes with these three reasons.

Decline a submission

A fourth reason, declined, records the carrier’s decision to turn a submission down. It follows the Ineligible stage. A third applicant is a PEO that is 2 years old. Open a log for it:
Answer two questions from its application:
The answers break a rule that has a code, so the stage is Ineligible. A sign-off of Declined gives the same stage. The declines block lists each rule and each sign-off that declines. An Ineligible submission stays open, because a typing error and a true answer break a rule alike. The log refuses quote, and it accepts two things:
  • A correction. Answer the question again, and the stage follows the new answers.
  • A decision. close declined turns the submission down for good.
  • close declined takes the role of the quote act, or a role above it.
  • The entry lists, after on, each code that the decision rests on.
  • In the Open and Quotable stages, the log refuses close declined as NOT_DECLINABLE.
  • Declined is final, like Bound and Closed.

Read the result from a program

Add --json to any command to get one JSON value on standard output. This Python reads the status of both logs, then sends a write to the bound one:
submission is a helper that this page defines, in ordinary Python. A report holds ok, the applied entries, the refusal, the last entry number seq, the program hash and the status. Submission log lists every field. A program that writes to a log needs the questions, the roles and the rules first. rslc submission contract submission.jsonl prints them as one JSON value, and Submission log lists its parts.

Exit codes

These codes belong to rslc submission. For the other rslc commands, 2 marks a wrong command line. Submission log explains each refusal code.

Replay a story with a script

A script file plays one submission from its first step and checks the results it expects. The example’s stale.script tells the story of the two sign-offs above:
Run it with rslc script:
  • The script’s log lives in memory. --keep log.jsonl writes it to a new log.
  • rslc script exits with 0 when every step passes, and with 1 otherwise.
  • Submission log gives every line form.