{"record":{"id":"48e83e30a913dcf7","repo":"flowable/flowable-engine","slug":"hitpolicy-s-has-aggregation-s-needs-output-typ","errorCode":null,"errorMessage":"HitPolicy: %s has aggregation: %s needs output type number","messagePattern":"HitPolicy: (.+?) has aggregation: (.+?) needs output type number","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/RuleEngineExecutorImpl.java","lineNumber":329,"sourceCode":"\n        if (hitPolicyBehavior == null) {\n            String hitPolicyBehaviorNotFoundMessage = String.format(\"HitPolicy behavior: %s not configured\", hitPolicy.getValue());\n\n            LOGGER.error(hitPolicyBehaviorNotFoundMessage);\n\n            throw new FlowableException(hitPolicyBehaviorNotFoundMessage);\n        }\n\n        return hitPolicyBehavior;\n    }\n\n    protected void sanityCheckDecisionTable(DecisionTable decisionTable) {\n        if (decisionTable.getHitPolicy() == HitPolicy.COLLECT && decisionTable.getAggregation() != null && decisionTable.getOutputs() != null) {\n            if (decisionTable.getOutputs().size() > 1) {\n                throw new FlowableException(String.format(\"HitPolicy: %s has aggregation: %s and multiple outputs. This is not supported\", decisionTable.getHitPolicy(), decisionTable.getAggregation()));\n            }\n            if (!\"number\".equals(decisionTable.getOutputs().get(0).getTypeRef())) {\n                throw new FlowableException(String.format(\"HitPolicy: %s has aggregation: %s needs output type number\", decisionTable.getHitPolicy(), decisionTable.getAggregation()));\n            }\n        }\n    }\n\n    @Override\n    public Map<String, AbstractHitPolicy> getHitPolicyBehaviors() {\n        return hitPolicyBehaviors;\n    }\n\n    @Override\n    public void setHitPolicyBehaviors(Map<String, AbstractHitPolicy> hitPolicyBehaviors) {\n        this.hitPolicyBehaviors = hitPolicyBehaviors;\n    }\n\n    @Override\n    public ExpressionManager getExpressionManager() {\n        return expressionManager;\n    }","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/RuleEngineExecutorImpl.java#L311-L347","documentation":"A COLLECT hit policy with an aggregation must aggregate over a single output whose type is 'number'. The sanity check rejects tables whose sole output column declares a different typeRef because the aggregator result would be untyped or wrong.","triggerScenarios":"execute -> sanityCheckDecisionTable finds COLLECT + aggregation, one output, and its typeRef is not \"number\" (e.g. string, boolean, date).","commonSituations":"Authoring mistake in the DMN editor where the output column type was left as string or not set; tables converted from tools that don't enforce numeric aggregation.","solutions":["Set the output column typeRef to \"number\" in the DMN XML","If the aggregated value is not numeric, remove the aggregation or change the hit policy","Re-validate/redeploy the corrected decision table"],"exampleFix":"// before\n<outputEntry typeRef=\"string\">...</outputEntry>\n// after\n<outputEntry typeRef=\"number\">...</outputEntry>","handlingStrategy":"validation","validationCode":"if (dt.getHitPolicy() == HitPolicy.COLLECT && dt.getAggregation() != null && dt.getOutputs() != null && dt.getOutputs().size() == 1) {\n  if (!\"number\".equals(dt.getOutputs().get(0).getTypeRef())) throw new IllegalArgumentException(\"aggregation output must be number\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set typeRef=\"number\" on aggregated output columns","Lint DMN XML for aggregation/typeRef consistency in CI"],"tags":["dmn","hit-policy","type-mismatch","flowable"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}