Create an outcome
An outcome is what a feature returns. Your page switches on its id and renders its fields. This page covers the
outcomes screen, Revenue › Decision Engine › Outcomes.
Name and id are two things
Section titled “Name and id are two things”- The name is what a rule points at, such as
metered-access. It never reaches your page. - The id is what decide returns in
outcome, such asarticle. It is what your page switches on.
Two outcomes may return the same id on purpose. metered-access and already-read can both return article: the
page draws the same thing, and what differs is whether a meter counted the read. Within one feature, outcomes that
share an id must declare the same fields, with the same names and types. Stage refuses a feature where they do not,
because your page could not know which shape it got.
The Outcomes list
Section titled “The Outcomes list”The list shows every named outcome, how many named outcomes there are, and how many distinct ids they put on the wire. Each row has:
- Outcome: the name.
- Returns: the id. A row whose id another outcome also returns says how many do.
- Decision: Allow, Deny, or Takes no access decision.
- Reason and Fields.
- Returned by: the slots that return it. An outcome nothing returns is marked unused.
Filter by decision, fields, state, use or id, search by name or id, and sort by name, id, fields or use.
Below the table, Written straight onto a rule lists the outcomes written inside a feature rather than named. Each says where it sits and opens in the builder. To give one a name, use Name it in the builder. See Pick what a slot returns.
Create an outcome
Section titled “Create an outcome”-
Select New outcome.
-
Optionally, pick an outcome under Start from to copy it.
-
Enter a Name: lowercase letters, digits and hyphens, starting with a letter or a digit. No other decision record may have the same name.
-
Enter what it Returns: the id.
-
Pick a Decision:
- Opens the article:
typeisallow. - Stops them:
typeisdeny. - No access axis: no
type. Use it for an outcome that is not about access, such as which banner to show.
An outcome used as a feature’s error outcome may not open the article.
- Opens the article:
-
Pick Why: the reason, from the fixed list below. Beside it, you can add your own words for reporting.
-
Optionally, add fields under Outcome data. See Fields.
-
Select Create outcome.
A new outcome starts left out of the next deploy. When it is ready, open it and select Include in deploy, then stage and deploy. Until then, a feature that returns it is refused at stage.
Reasons
Section titled “Reasons”| Reason | Means |
|---|---|
grant |
They hold access to this |
meter |
The free allowance decided it |
registration |
Signing in is what is being asked for |
paywall |
Paying is what is being asked for |
gift |
A gift link decided it |
upgrade |
They pay for something, and not for this |
restricted |
The account is held |
match |
An authored rule matched, with no access meaning |
default |
A canvas’s outcome for everyone else, or the feature’s fallback, answered |
error |
Something inside the entered canvas could not be read |
redirect |
A journey feature’s outcome resolved to a URL |
Decide returns the reason in reason, and your own words in reasonDetail.
Fields
Section titled “Fields”Fields are typed, named values beside the id. Decide returns them in the decision’s value, as plain JSON keyed by
field name. Only a named outcome can carry fields; an outcome written onto a rule cannot.
| Kind | Type | What decide returns |
|---|---|---|
| value | boolean, number, string, date (ISO 8601), string[] |
The value you entered |
| value | enum |
One of the legal values you list |
| reference | An offer, a product or a site | An object with the columns you select from that row. Stage refuses a row that does not exist or does not reach the feature’s sites |
| structured | json |
The object you entered |
| computed | fact |
The live value of a fact for this request. Stage refuses a fact a response may not carry, such as the bot.*, profile.*, streaming.* and db_user_org.* facts |
| offer token | An offer | A fresh offer token for that offer, which your page passes to checkout. See Checkout |
Two rules follow from computed fields and offer tokens:
- A computed field whose fact cannot be read for this request makes the feature return its error outcome instead.
- An operational feature may not return an offer token. Stage refuses it.
The Response panel shows what decide returns when the outcome wins. A computed field shows its fact path, since its value is only known at request time.
Changing fields needs the outcome fields permission, which Owner, Admin and Developer hold. Without it, the fields are read-only.
Edit an outcome
Section titled “Edit an outcome”Open it from the list. The Outcome section holds the name, the id, the decision and the reason, and Outcome data holds the fields. Each saves on its own.
- Renaming does not change the rules that point at the old name. Stage refuses the draft until they point at the new one, so repoint them in the builder in the same deploy.
- Leave out of next deploy removes the outcome from the next deployment. It keeps answering until that deploy. A feature that still returns it is refused at stage.
Delete an outcome
Section titled “Delete an outcome”Select Delete outcome, then Delete for good. When slots still return it, they point at nothing, and stage refuses the draft until you repoint them. A deployed outcome keeps answering until the next deploy.