A decision
is the main ressource to interact with.
It contains an outcome
, as well as details (scenario
, score
, rules
) that you can use to trigger specific actions in your application.
Attribute | Description |
---|---|
id string | ID of the decision. |
app_link | Link to the app with the detail of the decision, including intermediate values. |
created_at | Time at which the object was created (received by Marble, before executing scenarios). Measured in seconds since the Unix epoch. |
trigger_object | Trigger object data, for example a full transaction. |
trigger_object_type | Trigger object type, for example |
outcome |
|
scenario | Scenario that was executed. |
rules | Array of rules executed in the scenario. |
score | Score computed by the scenario (sum of all Only present if |
scheduled_scenario_execution_id | ID of the scheduled scenario execution. Only present if the decision was created by a scheduled scenario execution |
scenario
The scenario
shows details about the scenario executed.
This is mainly useful to display its information in a third-party system, like a case manager.
Attribute | Description |
---|---|
id string | ID of the scenario. |
name | Name of the scenario. |
description | Description of the scenario. |
scenario_iteration_id | Unique identifier of the scenario version use in this decision |
version | Version of the scenario. |
rule
The rule
provides all the detail of the rules that were computed to produce an outcome.
This is mainly useful to display its information in a third-party system, like a case manager.
Attribute | Description |
---|---|
name string | Name of the rule. |
description | Description of the rule. |
score_modifier | If the rule is true, this is added to the scenario's score. |
result | Did the rule evaluate to true or false ? |
rule_id | Unique identifier of the rule version used in this decision |
error | Error when executing the rule. |
error
The error
provides more context when a scenario was not able to produce an outcome, or a rule was not able to produce a score.
Note that error == null
if Marble was able to produce an outcome (ie when decision.outcome != null
).
Attribute | Description |
---|---|
code int | Machine-readable error code. |
message | Human-readable error message. |
Possible errors on the decision
object:
code | message |
---|---|
100 | Scenario was not able to compute a score because all rules failed. |
Possible errors on the rule
object:
code | message |
---|---|
200 | A field ({field name}) in rule is empty or missing |