flowable / flowable/flowable-engine

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

Aperta
#4,201 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

**Describe the bug**
The [document of CMMN History Level](https://documentation.flowable.com/latest/develop/be/history-level#cmmn) 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.