Skip to content
ArtificialFlow

Decisions

Business-rule tasks evaluate JSON decision tables, and a strict DMN XML subset. A table is deployed by id, then referenced from BPMN with artificialflow:decisionRef.

Open Decisions in the console as artificialflowadmin or artificialflowbusiness. Upload JSON or DMN XML, or paste the table, then deploy. Evaluate dry-runs inputs without starting a process. The XML importer accepts one DMN 1.3 decision table with hit policy FIRST. Other hit policies, FEEL functions, and multi-decision documents are rejected.

Table shape

A table has an id, a hit policy, and rules. FIRST returns the first rule whose when matches. An empty when is the fallback.

{
  "id": "invoice_decision",
  "hitPolicy": "FIRST",
  "rules": [
    { "when": { "amount": { "op": "gt", "value": 1000 } }, "then": { "result": "manager" } },
    { "when": {}, "then": { "result": "auto" } }
  ]
}

Deploy and evaluate

$API is http://localhost:9100/api/v1 on a local stack. Add a bearer token when IAM is on. The resource field is the table as a string.

curl -fsS -X POST "$API/decisions" \
  -H "Content-Type: application/json" \
  -d '{"decision_id":"invoice_decision","name":"Invoice routing","resource":"{...}"}'

curl -fsS -X POST "$API/decisions/invoice_decision/evaluate" \
  -H "Content-Type: application/json" \
  -d '{"inputs":{"amount":1500}}'

The runtime writes matched outputs into the instance context under decisionResult unless the task sets another result variable, and it copies those keys onto the top-level context.