Using DmnHistoryService

Hello! I am trying to understand how the Historic Decision are retrieved.

I am first executing a rule decision:


And after that I am trying to get the history for the above executed decision

List<DmnHistoricDecisionExecution> history = dmnHistoryService.createHistoricDecisionExecutionQuery()

And this list comes empty.
Am I missing something?

That looks like it should work. Where/how are you calling these methods? Could it be you’re calling this at a moment the transaction of the first method hasn’t completed yet (e.g in a JavaDelegate)?

I am doing it inside a test, should I try and give it some time to finish the transaction?

No, that shoud be ok. Can you share your test?


@Property(name = "flowable.rules-location", value = "rules/dummy_risk_locations.dmn")
class FlowableDummyRulesTest {
    public static final String COUNTRY = "country";
    public static final String CONTRACT_TYPE = "contractType";
    public static final String CLASS_OF_BUSINESS = "classOfBusiness";
    public static final String EXISTING_COUNTRY = "US";
    public static final String EXISTING_CONTRACT_TYPE = "INSURANCE";
    public static final String EXISTING_CLASS_OF_BUSINESS = "MOVEABLE";
    private static final String DECISION_KEY = "RISK_LOCATIONS";

    DmnHistoryService dmnHistoryService;

    DmnRuleService dmnRuleService;

    void executeRuleWithResult() {

        List<Map<String, Object>> decisionResult = queryFlowable(buildQueryMap());
        List<DmnHistoricDecisionExecution> history = dmnHistoryService.createHistoricDecisionExecutionQuery()


    private List<Map<String, Object>> queryFlowable(Map<String, Object> flowableQuery) {
        return dmnRuleService.createExecuteDecisionBuilder().decisionKey(DECISION_KEY)

    private Map<String, Object> buildQueryMap() {
        return Map.of(COUNTRY, EXISTING_COUNTRY, 


Found anything? :smile: