Using Decision Tables in Workflows
The DecisionTable activity evaluates the selected table using the workflow data mapped to it, and the result becomes available to later workflow steps. For the field-level reference, see the Decision Table activity.
DecisionTable activity configuration
The activity form has the fields Name, Description, Decision Table, Inputs and Output, on the Configuration, Input and Output tabs.
| Setting or mapping | What you configure |
|---|---|
| Decision Table | The table to evaluate. |
| Inputs | Map the input records to the records list. One record uses a one-element list. |
| Output | Use the returned input groups and the complete output rows inside each group. |
| Next workflow step | Handle the result, call a shared mapper or invoke a process through an explicit Subflow step. |
Configuration properties without a form field
These properties have no Studio form field.
| Property | Meaning |
|---|---|
decisionVersion | active (default), draft or a positive version number. Use draft only for draft/test execution. |
noMatchAsError | When true, a record with no match gets error code DECISION_NO_MATCH and the message "No matching rule found for this record". |
Schema environment in the mapper
Select the Decision schema environment in the mapper header to see the schema of a step that has no pinned version. Without it, or a pinned version, the mapper shows "Choose a decision schema environment in the mapper header, or pin a published version on the step, to see its output fields."
An environment release must exist for active execution. The workflow does not select the latest authoring revision automatically. A process call uses its own deployed version and completion settings. To create releases, see publishing and releasing decision tables.
Input and output grouping
A hit policy defines the result of one table evaluation. When Koodisi evaluates a list of records, it keeps a separate result group for each record. This grouping is part of the Koodisi result format.
Every input has its own result group. A group contains all output rows selected for that input. Several inputs return separate groups in the same input order. A no-match or error also keeps its input position.
The following Collect example has two input records. It returns two result groups. The first group has two output rows; the second has one.
| Rule condition | label | points |
|---|---|---|
score >= 0 | nonnegative | 1 |
score >= 10 | high | 2 |
Input 1, score = 15, returns the output rows that belong to input 1.
label | points |
|---|---|
| nonnegative | 1 |
| high | 2 |
Input 2, score = 5, returns the output rows that belong to input 2.
label | points |
|---|---|
| nonnegative | 1 |
Collect output row order is not guaranteed. The grouping and input order are preserved. A no-match result has an empty output list and a no-match flag. A per-record error has safe error information and does not remove the other inputs.
One input uses the same structure as several inputs. The supported invocation size is 1 to 1,000 records. An invalid overall request or a shared dependency failure can fail the invocation.
Mapping fields
| Field | Meaning for a workflow mapping |
|---|---|
records | The input record list. One record is a one-element list. |
dmnEvaluateOutput.items | The ordered result groups returned by the DecisionTable activity. |
items[].index | The zero-based input position. |
items[].status | Whether this input evaluated or has a record error. |
items[].result.results | The complete selected output rows for this input. |
items[].result.noMatch | Whether the input selected no output row. |
items[].result.aggregate | A separate aggregate for an aggregation policy. |
items[].error | Safe record error information; result is null on an error item. |
Mapper expression indexes are one-based. For example, items[1] refers to the first input result group, whose index value is 0. The result also carries the selected table version, captured clock/timezone and selected-rule evidence.
Calling a process and a shared mapper
| Pattern | Workflow steps | Use |
|---|---|---|
| Decision then process | Evaluate, map the result, call a process | Route work using the outcome |
| Shared mapper then process | Evaluate, call a reusable mapper, call a process | Reuse a common mapping |
| Process for each input | Loop through eligible input result groups | Separate work for each input |
| Process for each output row | Loop through a result group's output rows | Work for every selected outcome |
The DecisionTable activity returns data. A transition or subsequent step uses that data to decide whether to call a process. A mapper-only Subflow can transform the selected outputs into the process input before the process Subflow runs.
A loop over input result groups performs work for each eligible input. A loop over a group's output rows performs work for each selected outcome from that input. Keeping these levels separate preserves the relationship between the input and its outputs.
The workflow defines no-match and error handling, maximum iterations, process versions and completion behavior. A pinned process version must be deployed. A required call waits for completion. Retries use the workflow's configured behavior and can repeat process side effects.