For the list of all supported Decision Insight downloads and releases, see the Downloads page.

Decision table

The decision table component takes as input an object represented as a Map. It then evaluates this object against a set of rules and outputs a single value named the outcome. In this page, learn how to use the decision table component. 

Use case

Here is an example of a decision table that indicates whether you should go play golf or stay home depending on the current weather. The current weather is characterized by 4 indicators:

  • Outlook (string) – sunny, cloudy or rainy
  • Temperature (integer) – in degree Celsius
  • Humidity (string) – high, normal, low
  • Windy (boolean) – true or false



To generate the outcome, the decision table engine evaluates rules one by one in order until it finds a matching rule. When a matching rule is found, the engine outputs the outcome (usually the first or last column).

For example let's that today,the weather is {outlook:rainy, temperature:30, humidity:high, windy:false}

  • The first rule does not match because it's not sunny.
  • The second rule does match: it's rainy, temperature is between 25 and 35 degrees and it's not windy. The outcome corresponding to the second rule is play-golf. Conclusion: you should go and play golf today!


Create a new library with the following jar:

Camel version Library jars

See also How to retrieve the Camel version of Decision Insight.

The source for this component can also be downloaded. Feel free to report bugs and propose improvements.

Usage samples

  • Create a new library named camel_decisiontable and upload the camel decision table jar (see above).
  • Create a new resource named decisiontable1_rules with the following content:

  • Create a new routing context named decisiontable1_test

    <routes xmlns="" xmlns:u="">
            <from uri="timer:foo?repeatCount=1"/>
                    <u:map-entry key="outlook"><simple>rainy</simple></u:map-entry>
                    <u:map-entry key="temperature"><simple>30</simple></u:map-entry>
                    <u:map-entry key="humidity"><simple>high</simple></u:map-entry>
                    <u:map-entry key="windy"><simple>false</simple></u:map-entry>
            <log message="input: ${body}"/>
            <setHeader headerName="output">
                <language language="decision-table">resource:tnd-resource:decisiontable1_test</language>
            <log message="output: ${header.output}"/>
  • Start the route and check out the logs. You should have the following logs:

    decisiontable1_test - input: {temperature=30, humidity=high, outlook=rainy, windy=false}
    decisiontable1_test - output: play-golf

Decision table resource syntax

A decision table contains a header and a set of rules.


The header is the first line of a decision table and must start with #.

It contains a list of column separated by semicolons (;). One of the columns must be named <outcome> .



The body of the decision table consists in a list of rule sets (i.e lines).

In a rule set, to escape the following characters, you should add a backslash (\) in front of them:

  • <
  • {
  • [
  • ,
  • ;
  • \

So for example to create a rule that matches the string "<null>" instead of null values, you should write \<null>.

Each rule sets contains a list of columns separated by semicolons (;).

Each column in a rule set contains a rule. The following rules are supported:

Rule Description
<anyspace> Matches any value.
<null> Matches null values.

Matches null or empty strings, or strings containing only whitespaces.

Note: Values that are not strings are first converted into their string equivalent.


Matches any integer value in the range [x..y].

For example [1..3] matches 12 and 3.


Matches any value equal to x, y, or z.

For example {foo,bar} matches foo and bar.

not rule

Matches any value that do not match the rule.

For example not hot matches 'cool' and 'mild' or any other value different from hot.


Matches any value whose string representation is xxxx.

For example foo matches 'foo'. 

Related Links