Skip to content

"Full" history level for variable changes doesn't implemented in CMMN #4201

@JohnnySong

Description

@JohnnySong

Describe the bug
The document of CMMN History Level describes when History Level = Full, the changes of variables will be stored.

Image

But it is not implemented yet.

Expected behavior
If I changed variables in the runtime, the change history should be stored and can be retrieved from act_hi_varinst and act_hi_detail tables

Code

The BPMN engine (org.flowable.engine.impl.history.DefaultHistoryManager.java) has a method recordHistoricDetailVariableCreate that checks isHistoryLevelAtLeast(HistoryLevel.FULL) and creates a HistoricDetailVariableInstanceUpdateEntity — a separate row for every variable change. This is what powers the history/historic-detail REST endpoint with detailType: "variableUpdate" and revision numbers. So the how history stored.

    @Override
    public void recordHistoricDetailVariableCreate(VariableInstanceEntity variable, ExecutionEntity sourceActivityExecution, boolean useActivityId,
        String activityInstanceId, Date createTime) {
        String processDefinitionId = getProcessDefinitionId(variable, sourceActivityExecution);

        if (getHistoryConfigurationSettings().isHistoryEnabledForVariableInstance(processDefinitionId, variable)
                && isHistoryLevelAtLeast(HistoryLevel.FULL, processDefinitionId)) {

            HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = getHistoricDetailEntityManager().copyAndInsertHistoricDetailVariableInstanceUpdateEntity(variable, createTime);

            if (StringUtils.isNotEmpty(activityInstanceId)) {
                historicVariableUpdate.setActivityInstanceId(activityInstanceId);
            } else {
                if (useActivityId && sourceActivityExecution != null) {
                    HistoricActivityInstanceEntity historicActivityInstance = findHistoricActivityInstance(sourceActivityExecution, false);
                    if (historicActivityInstance != null) {
                        historicVariableUpdate.setActivityInstanceId(historicActivityInstance.getId());
                    }
                }
            }
        }
    }

The CMMN engine (DefaultCmmnHistoryManager.java) has none of this:

  • Zero references to HistoryLevel.FULL anywhere in the file
  • Zero references to "detail" or HistoricDetail entities
  • No recordHistoricDetailVariableCreate method
  • The CmmnHistoryManager interface doesn't even define such a method

Additional context
flowable-engine 8.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions