docs.camunda.org Open in urlscan Pro
18.193.107.15  Public Scan

Submitted URL: https://docs.camunda.org/manual/7.5/reference/dmn11/decision-table/hit-policy/#collect-hit-policy
Effective URL: https://docs.camunda.org/manual/7.5/reference/dmn11/decision-table/hit-policy/
Submission: On November 29 via api from NL — Scanned from NL

Form analysis 0 forms found in the DOM

Text Content

Camunda Docs
 * Get Started
 * BPM Platform
 * Optimize
 * Enterprise


 * Camunda.org



BPM Platform 7.5
 * Introduction
   * Download
   * Implemented Standards
   * Architecture Overview
   * Supported Environments
   * Extensions
   * Third-Party Libraries
   * Public API
 * User Guide
   * Process Engine
     * Process Engine Bootstrapping
     * Process Engine API
     * Process Engine Concepts
     * Process Variables
     * Process Instance Modification
     * Delegation Code
     * Expression Language
     * Scripting
     * Templating
     * Custom Code & Security
     * External Tasks
     * Connectors
     * Process Versioning
     * Process Instance Migration
     * Database
     * History and Audit Event Log
     * Process Definition Cache
     * Transactions in Processes
     * The Job Executor
     * Batch
     * Multi-Tenancy
     * Id Generators
     * Metrics
     * Incidents
     * Process Engine Plugins
     * Identity Service
     * Authorization Service
     * Deployments
     * Process Diagram Visualization
     * Decisions
       * Configuration
       * Repository
       * Decision Service
       * Decisions in BPMN & CMMN
       * History
   * Process Applications
     * The Process Application class
     * The processes.xml Deployment Descriptor
     * Process Application Event Listeners
     * Process Application Resource Access
     * Maven Project Templates (Archetypes)
   * Runtime Container Integration
     * BPM Platform Services
     * JNDI Bindings for BPM Platform Services
     * Apache Tomcat
     * JBoss/WildFly
   * Spring Framework Integration
     * Bootstrapping
     * Transactions
     * Deployment
     * Expression Resolving
     * Testing
   * CDI and Java EE Integration
     * Process Engine Configuration
     * JTA Transaction Integration
     * Expression Resolving
     * Contextual Programming Model
     * Built-In Beans
     * CDI Event Bridge
   * Testing
   * Model API
     * BPMN Model API
       * Read a Model
       * Create a Model
       * Delegation Code
       * Fluent Builder API
       * Repository Service
       * Extension Elements
     * CMMN Model API
       * Read a Model
       * Create a Model
       * Delegation Code
       * Repository Service
       * Extension Elements
       * Limitations
   * Data Formats (XML, JSON, Other)
     * Configuring Spin Integration
     * Data Formats in Processes
     * XML
     * JSON
   * User Task Forms
   * DMN Engine
     * Embed
     * Evaluate Decisions
     * Expressions
     * Data Types
     * Testing
   * Logging
 * Reference
   * Rest Api
     * Overview
       * Configure Authentication
       * Usage with a Pre-Built Distribution
       * Embed the API
       * Hypertext Application Language (HAL)
       * Variables in the REST API
       * Custom Date Format
     * Authorization
       * Get List
       * Get List Count
       * Get
       * Check
       * Options
       * Create
       * Update
       * Delete
     * Batch
       * Get List
       * Get List Count
       * Get
       * Activate/Suspend
       * Delete
       * Get Statistics
       * Get Statistics Count
     * Case Definition
       * Get List
       * Get List Count
       * Get
       * Get XML
       * Get Diagram
       * Create
     * Case Execution
       * Local Variables
         * Get
         * Get (Binary)
         * Get List
         * Update
         * Update (Binary)
         * Modify
         * Delete
       * Variables
         * Get
         * Get (Binary)
         * Get List
         * Post (Binary)
         * Update
         * Modify
         * Delete
       * Get List
       * Get Count
       * Get
       * Get List (POST)
       * Get Count (Post)
       * Start
       * Complete
       * Disable
       * Re-enable
     * Case Instance
       * Variables
         * Get List
         * Get
         * Get (Binary)
         * Modify
         * Update
         * POST (Binary)
         * Delete
       * Get List
       * Get List Count
       * Get
       * Get List (POST)
       * Get List Count (POST)
       * Complete
       * Close
     * Decision Definition
       * Get List
       * Get List Count
       * Get
       * Get XML
       * Get Diagram
       * Evaluate
     * Deployment
       * Get List
       * Get List Count
       * Get
       * Create
       * Redeploy
       * Get Resources
       * Get Resource
       * Get Resource (Binary)
       * Delete
     * Engine
       * Get List
     * Execution
       * Local Variables
         * Get List
         * Get
         * Get (Binary)
         * Update
         * Post (Binary)
         * Modify
         * Delete
       * Message Event Subscription
         * Get
         * Trigger
       * Get List
       * Get List Count
       * Get
       * Get (POST)
       * Get List Count (POST)
       * Trigger
     * External Task
       * Get
       * Get List
       * Get List Count
       * Get List (POST)
       * Get List Count (POST)
       * Fetch and Lock
       * Complete
       * Handle BPMN Error
       * Handle Failure
       * Unlock
       * Set Priority
       * Set Retries
     * Filter
       * Get List
       * Get List Count
       * Get
       * Create
       * Update
       * Delete
       * Execute
       * Execute (POST)
       * Execute List
       * Execute List (POST)
       * Execute Count
       * Execute Count (POST)
       * Options
     * Group
       * Group Member
         * Create
         * Delete
         * Options
       * Get List
       * Get List Count
       * Get
       * Create
       * Update
       * Options
       * Delete
     * History
       * Activity Instance
         * Get List
         * Get List Count
         * Get
         * Get List (POST)
         * Get List Count (POST)
       * Batch
         * Get List
         * Get List Count
         * Get
         * Delete
       * Case Instance
         * Get List
         * Get List Count
         * Get
         * Get List (POST)
         * Get List Count (POST)
       * Case Activity Instance
         * Get List
         * Get List Count
         * Get
       * Decision Instance
         * Get List
         * Get List Count
         * Get
       * Detail
         * Get List
         * Get List Count
         * Get
         * Get (Binary)
       * Identity link log
         * Get List
         * Get List Count
       * Incident
         * Get List
         * Get List Count
       * Job Log
         * Get List
         * Get List Count
         * Get
         * Get Stacktrace
         * Get List Count (POST)
         * Get List (POST)
       * Process Definition
         * Get Historic Activity Statistics
       * Process Instance
         * Get List
         * Get List Count
         * Get
         * Get List (POST)
         * Get List Count (POST)
         * Delete
         * Get Duration Report
       * Task
         * Get List
         * Get List Count
         * Get List (POST)
         * Get List Count (POST)
       * User Operation Log
         * Get List
         * Get List Count
       * Variable Instance
         * Get List
         * Get List Count
         * Get
         * Get (Binary)
         * Get List (POST)
         * Get List Count (POST)
     * Identity
       * Get Groups
     * Incident
       * Get List
       * Get List Count
     * Job
       * Get List
       * Get List Count
       * Get
       * Get List (POST)
       * Get List Count (POST)
       * Execute
       * Update Due Date
       * Update Priority
       * Update Retries
       * Get Stacktrace
       * Activate/Suspend By Id
       * Activate/Suspend by Job Definition Id
       * Activate/Suspend By Process Definition Id
       * Activate/Suspend By Process Definition Key
       * Activate/Suspend By Process Instance Id
       * Delete Job
     * Job Definition
       * Get List
       * Get List Count
       * Get
       * Get List (POST)
       * Get List Count (POST)
       * Set Priority
       * Set Retries
       * Activate/Suspend By Id
       * Activate/Suspend By Process Definition Id
       * Activate/Suspend By Process Definition Key
     * Message
       * Deliver
     * Metrics
       * Get Sum
     * Migration
       * Generate
       * Validate
       * Execute
       * Execute Async (Batch)
     * Process Definition
       * Get Activity Instance Statistics
       * Get Diagram
       * Get Start Form Variables
       * Get List Count
       * Get List
       * Get Rendered Start Form
       * Get Start Form Key
       * Get Process Instance Statistics
       * Get XML
       * Get
       * Start Instance
       * Submit Start Form
       * Activate/Suspend By Id
       * Activate/Suspend By Key
     * Process Instance
       * Variables
         * Delete
         * Get (Binary)
         * Get
         * Get List
         * Post (Binary)
         * Modify
         * Update
       * Delete
       * Get Activity Instance
       * Get List Count
       * Get List
       * Get
       * Modify
       * Get List Count (POST)
       * Get List (POST)
       * Activate/Suspend By Id
       * Activate/Suspend By Process Definition Id
       * Activate/Suspend By Process Definition Key
     * Task
       * Comment
         * Get List
         * Get
         * Create
       * Attachment
         * Get List
         * Get
         * Create
         * Get (Binary)
         * Delete
       * Identity Links
         * Get List
         * Add
         * Delete
       * Variables
         * Get
         * Get (Binary)
         * Get List
         * Modify
         * Update
         * Post (Binary)
         * Delete
       * Local Variables
         * Get
         * Get (Binary)
         * Get List
         * Modify
         * Update
         * Post (Binary)
         * Delete
       * Get
       * Get List
       * Get List (POST)
       * Get List Count
       * Get List Count (POST)
       * Get Form Key
       * Claim
       * Unclaim
       * Complete
       * Submit Form
       * Resolve
       * Set Assignee
       * Delegate
       * Get Rendered Form
       * Get Task Form Variables
       * Create
       * Update
     * Tenant
       * Tenant User Membership
         * Create
         * Delete
         * Options
       * Tenant Group Membership
         * Create
         * Delete
         * Options
       * Get List
       * Get List Count
       * Get
       * Create
       * Update
       * Options
       * Delete
     * User
       * Delete
       * Get List Count
       * Get List
       * Get Profile
       * Options
       * Create
       * Update Credentials
       * Update Profile
     * Variable Instance
       * Get (Binary)
       * Get List Count
       * Get List
       * Get
       * Get List (POST)
       * Get List Count (POST)
   * Javadoc
   * BPMN 2.0
     * Tasks
       * Service Task
       * Send Task
       * User Task
       * Business Rule Task
       * Script Task
       * Receive Task
       * Manual Task
       * Task Markers
     * Gateways
       * Data-based Exclusive Gateway (XOR)
       * Conditional and Default Sequence Flows
       * Parallel Gateway
       * Inclusive Gateway
       * Event-based Gateway
     * Events
       * Start Events
       * None Events
       * Message Events
       * Timer Events
       * Error Events
       * Escalation Events
       * Signal Events
       * Cancel and Compensation Events
       * Link Events
       * Terminate Events
     * Subprocess
       * Embedded Subprocess
       * Call Activity
       * Event Subprocess
       * Transaction Subprocess
     * Extension Reference
       * Extension Elements
       * Extension Attributes
   * DMN 1.1
     * Decision Table
       * Input
       * Output
       * Rule
       * Hit Policy
     * FEEL
       * Data Types
       * Language Elements
     * Extension Reference
       * Extension Attributes
   * CMMN 1.1
     * Classic vs Fluent API
     * CMMN Concepts
       * Plan Items and Item Definitions
       * Plan Item Lifecycles
       * Entry and Exit Criteria
     * Tasks
       * Human Task
       * Process Task
       * Case Task
       * Decision Task
     * Grouping Tasks
       * Stage
     * Milestones
     * Sentries
     * Markers
       * Manual Activation Rule
       * Required Rule
       * Auto Complete
       * Repetition Rule
     * Extension Reference
       * Extension Elements
       * Extension Attributes
     * Migration between Specification Versions
       * 1.0 to 1.1
   * Forms
     * Controls
       * Text Inputs
       * Textareas
       * Date Inputs
       * Boolean Inputs
       * Selects
       * Hidden Input Fields
       * File Upload and Download
     * Javascript
       * The cam-script Directive
       * Available API
       * Participating in the Form Lifecycle
       * Debugging Scripts
       * Generating a Business Key
       * Examples
     * Lifecycle and Events
     * Working with Json Data
     * Working with Java Objects
     * Integrating the Forms SDK
       * Getting a Distribution
       * Bootstrapping
       * AngularJS Integration
       * Full Example
   * Spin Dataformats
     * XML
       * Reading XML
       * Manipulating XML
       * Writing XML
       * Querying XML
       * Mapping XML
       * Configuring XML Handling
     * JSON
       * Reading JSON
       * Writing JSON
       * Querying JSON
       * Mapping JSON
       * Configuring JSON Handling
     * Extending Spin
   * Connectors
     * HTTP Connector
     * SOAP Connector
     * Extending Connect
   * Deployment Descriptors
     * bpm-platform.xml
     * processes.xml
     * Tags
       * <job-executor />
       * <process-archive />
       * <process-engine />
 * Installation
   * Camunda Modeler
   * Full Distribution
     * Tomcat
       * Pre-Packaged Distribution
       * Manual Installation
       * Configuration
     * JBoss/Wildfly
       * Pre-Packaged Distribution
       * Manual Installation
       * Configuration
     * IBM WebSphere
       * Manual Installation
       * Configuration
     * Oracle WebLogic
       * Manual Installation
       * Configuration
   * Docker
   * Standalone Webapplication (.war)
   * Karaf / OSGi
   * Cycle
 * Modeler
   * Camunda Modeler
     * BPMN
     * CMMN
     * DMN
     * Element Templates
     * Tips and Tricks
   * Eclipse Plugin (Deprecated)
     * Update Sites
     * Installation
     * Modeling BPMN
     * Extensions
 * Web Applications
   * Admin
     * User Management
     * Group Management
     * Tenant Management
     * Authorization Management
     * System Management
     * Configuration
     * Extending
       * Plugins
   * Cockpit
     * Dashboard
     * BPMN Processes
       * Dashboard
       * Process Definition View
       * Process Instance View
       * History
       * Instance Modification
       * Instance Migration
       * Failed Jobs
       * Suspension
     * DMN Decisions
       * Dashboard
       * Decision Definition View
       * Decision Instance View
       * Live Editing
     * Deployments
     * Auditing
     * Batch View
     * Reports
     * Extending
       * Configuration
       * Plugins
   * Tasklist
     * Working with Tasklist
     * Dashboard
     * Filters
     * User Assignment
     * Task Lifecycle
     * Plugins
     * Configuration
     * Accessibility
   * Cycle
 * Examples & Tutorials
   * Tutorials
     * Error Handling
     * Custom Queries
     * Multi-Tenancy
     * JSF Task Forms
     * Communication among Processes using Web Services
     * How to develop a Cockpit plugin
 * Update & Migration
   * Minor Version Update
     * 7.4 to 7.5
       * Glassfish
       * JBoss AS/Wildfly
       * Tomcat
       * Web Application Plugins
       * WebLogic
       * WebSphere
     * 7.3 to 7.4
       * Glassfish
       * JBoss AS/Wildfly
       * Tomcat
       * WebLogic
       * WebSphere
     * 7.2 to 7.3
       * Glassfish
       * JBoss
       * Tomcat
       * WebLogic
       * WebSphere
     * 7.1 to 7.2
       * Glassfish
       * JBoss
       * Tomcat
       * WebLogic
       * Websphere
     * 7.0 to 7.1
   * Patch Level Update
   * Activiti Migration
   * Camunda Fox Migration

OPTIONS

Version: latest 7.13 7.12 7.11 7.10 7.9 7.8 7.7 7.6 7.5 7.4 7.3 7.2 7.1 7.0
develop
 * 
 * 
 * 

Edit on Github


DMN HIT POLICY

A decision table has a hit policy that specifies what the results of the
evaluation of a decision table consist of.

The hit policy is set in the hitPolicy attribute on the decisionTable XML
element. If no hit policy is set then the default hit policy UNIQUE is used.

<definitions xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" id="definitions" name="definitions" namespace="http://camunda.org/schema/1.0/dmn">
  <decision id="decision" name="Dish">
    <decisionTable id="decisionTable" hitPolicy="RULE ORDER">
      <!-- .. -->
    </decisionTable>
  </decision>
</definitions>


In the visual representation of the decision table the hit policy is specified
by the initial letter of the hit policy. The following hit policies are
supported by the Camunda DMN engine:

Visual representation XML representation U UNIQUE A ANY F FIRST R RULE ORDER C
COLLECT


THE ROLE OF A HIT POLICY

A hit policy specifies how many rules of a decision table can be satisfied and
which of the satisfied rules are included in the decision table result. The hit
policies Unique, Any and First will always return a maximum of one satisfied
rule. The hit policies Rule Order and Collect can return multiple satisfied
rules.


UNIQUE HIT POLICY

Only a single rule can be satisfied. The decision table result contains the
output entries of the satisfied rule.

If more than one rule is satisfied, the Unique hit policy is violated.

See the following decision table.

Depending on the current season the dish should be chosen. Only one dish can be
chosen, since only one season can exist at the same time.




ANY HIT POLICY

Multiple rules can be satisfied. However, all satisfied rules must generate the
same output. The decision table result contains only the output of one of the
satisfied rules.

If multiple rules are satisfied which generate different outputs, the hit policy
is violated.

See the following example:

There is a decision table for the leave application. If the applier has no
vacation days left or he is currently in the probation period, the application
will be refused. Otherwise the application is applied.




FIRST HIT POLICY

Multiple rules can be satisfied. The decision table result contains only the
output of the first satisfied rule.



See the decistion table for advertisement. Regarding the current age of the
user, which advertisement should be shown is decided. For example, the user is
19 years old. All the rules will match, but since the hit policy is set to first
only, the advertisement for Cars is used.




RULE ORDER HIT POLICY

Multiple rules can be satisfied. The decision table result contains the output
of all satisfied rules in the order of the rules in the decision table.



Again, see the advertisement example with the rule order policy. Say we have a
user at the age of 19 again. All rules are satisfied so all outputs are given,
ordered by the rule ordering. It can perhaps be used to indicate the priority of
the displayed advertisements.




COLLECT HIT POLICY

Multiple rules can be satisfied. The decision table result contains the output
of all satisfied rules in an arbitrary order as a list.



With this hit policy, the output list has no ordering. So the advertisement will
be arbitrary if the age is for example 19.



Additionally, an aggregator can be specified for the Collect hit policy. If an
aggregator is specified, the decision table result will only contain a single
output entry. The aggregator will generate the output entry from all satisfied
rules. Note if the Collect hit policy is used with an aggregator, the decision
table can only have one output.

The aggregator is set as the aggregation attribute of the descisionTable XML
element.

<decisionTable id="decisionTable" hitPolicy="COLLECT" aggregation="SUM">
  <!-- .. -->
</decisionTable>



AGGREGATORS FOR COLLECT HIT POLICY

In the visual representation of the decision table the aggregator is specified
by a marker after the hit policy. The following aggregators are supported by the
Camunda DMN engine:

Visual representation XML representation Result of the aggregation + SUM the sum
of all output values < MIN the smallest value of all output values > MAX the
largest value of all output values # COUNT the number of output values

SUM AGGREGATOR

The SUM aggregator sums up all outputs from the satisfied rules.

The showed decision table can be used to sum up the salary bonus for an
employee. For example, the employee has been working in the company for 3.5
years. So the first, second and third rule will match and the result of the
decision table is 600, since the output is summed up.



MIN AGGREGATOR

The MIN aggregator can be used to return the smallest output value of all
satisfied rules. See the following example of a car insurance. After years
without a car crash the insurance fee will be reduced.

For example, if the input for the decision table is 3.5 years, the result will
be 98.83, since the first three rules match but the third rule has the minimal
output.



MAX AGGREGATOR

The MAX aggregator can be used to return the largest output value of all
satisfied rules.

This decision table represents the decision for the amount of pocket money for a
child. Depending of the age, the amount grows. For example, an input of 9 will
satisfy the first and second rules. The output of the second rule is larger then
the output of the first rule, so the output will be 5. A child at the age of 9
will get 5 as pocket money.

COUNT AGGREGATOR

The COUNT aggregator can be use to return the count of satisfied rules.

For example, see the salary bonus decision table again, this time with the COUNT
aggregator. With an input of 4, the first three rules will be satisfied.
Therefore, the result from the decision table will be 3, which means that after
4 years the result of the decision table is 3 salary bonuses.


ON THIS PAGE:

 * The Role of a Hit Policy
   * Unique Hit Policy
   * Any Hit Policy
   * First Hit Policy
   * Rule Order Hit Policy
   * Collect Hit Policy
     * Aggregators for Collect Hit Policy
       * SUM aggregator
       * MIN aggregator
       * MAX aggregator
       * COUNT aggregator

> Whitepaper: Camunda compared to Alternatives
> 
> Download now

Back to top

camunda.org and docs.camunda.org are part of camunda BPM | Built by camunda and
contributors — Privacy Statement — camunda Services GmbH © 2015

The content on this site is licensed under a Creative Commons
Attribution-ShareAlike 3.0 Unported License.