Skip to main content

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 mappingWhat you configure
Decision TableThe table to evaluate.
InputsMap the input records to the records list. One record uses a one-element list.
OutputUse the returned input groups and the complete output rows inside each group.
Next workflow stepHandle 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.

PropertyMeaning
decisionVersionactive (default), draft or a positive version number. Use draft only for draft/test execution.
noMatchAsErrorWhen 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 conditionlabelpoints
score >= 0nonnegative1
score >= 10high2

Input 1, score = 15, returns the output rows that belong to input 1.

labelpoints
nonnegative1
high2

Input 2, score = 5, returns the output rows that belong to input 2.

labelpoints
nonnegative1

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​

FieldMeaning for a workflow mapping
recordsThe input record list. One record is a one-element list.
dmnEvaluateOutput.itemsThe ordered result groups returned by the DecisionTable activity.
items[].indexThe zero-based input position.
items[].statusWhether this input evaluated or has a record error.
items[].result.resultsThe complete selected output rows for this input.
items[].result.noMatchWhether the input selected no output row.
items[].result.aggregateA separate aggregate for an aggregation policy.
items[].errorSafe 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​

PatternWorkflow stepsUse
Decision then processEvaluate, map the result, call a processRoute work using the outcome
Shared mapper then processEvaluate, call a reusable mapper, call a processReuse a common mapping
Process for each inputLoop through eligible input result groupsSeparate work for each input
Process for each output rowLoop through a result group's output rowsWork 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.

Next steps​