提交 f400d374 编写于 作者: J Joram Barrez

Cmmn: fix subscope not exposed for historic variable

上级 f191c480
......@@ -126,18 +126,21 @@ public class VariablesTest extends FlowableCmmnTestCase {
assertEquals(caseInstance.getId(), historicVariableInstance.getScopeId());
assertEquals(VariableScopeType.CMMN, historicVariableInstance.getScopeType());
assertEquals("test", historicVariableInstance.getValue());
assertNull(historicVariableInstance.getSubScopeId());
assertEquals(123, cmmnRuntimeService.getVariable(caseInstance.getId(), "intVar"));
historicVariableInstance = cmmnHistoryService.createHistoricVariableInstanceQuery().variableName("intVar").singleResult();
assertEquals(caseInstance.getId(), historicVariableInstance.getScopeId());
assertEquals(VariableScopeType.CMMN, historicVariableInstance.getScopeType());
assertEquals(123, historicVariableInstance.getValue());
assertNull(historicVariableInstance.getSubScopeId());
assertEquals(123.123, cmmnRuntimeService.getVariable(caseInstance.getId(), "doubleVar"));
historicVariableInstance = cmmnHistoryService.createHistoricVariableInstanceQuery().variableName("doubleVar").singleResult();
assertEquals(caseInstance.getId(), historicVariableInstance.getScopeId());
assertEquals(VariableScopeType.CMMN, historicVariableInstance.getScopeType());
assertEquals(123.123, historicVariableInstance.getValue());
assertNull(historicVariableInstance.getSubScopeId());
// Update variables
Map<String, Object> newVariables = new HashMap<>();
......
......@@ -55,5 +55,7 @@ public interface HistoricVariableInstance extends HistoricData {
String getScopeId();
String getSubScopeId();
String getScopeType();
}
......@@ -53,6 +53,7 @@ public class HistoricVariableInstanceEntityManagerImpl extends AbstractEntityMan
historicVariableInstance.setName(variableInstance.getName());
historicVariableInstance.setVariableType(variableInstance.getType());
historicVariableInstance.setScopeId(variableInstance.getScopeId());
historicVariableInstance.setSubScopeId(variableInstance.getSubScopeId());
historicVariableInstance.setScopeType(variableInstance.getScopeType());
copyVariableValue(historicVariableInstance, variableInstance);
......
......@@ -217,7 +217,7 @@ public class VariableInstanceEntityImpl extends AbstractEntity implements Variab
@Override
public String getSubScopeId() {
return scopeId;
return subScopeId;
}
@Override
......
......@@ -93,7 +93,7 @@
<if test="originalPersistentState.scopeId != scopeId">
SCOPE_ID_ = #{scopeId, jdbcType=VARCHAR},
</if>
<if test="originalPersistentState.subScopeId != scopeId">
<if test="originalPersistentState.subScopeId != subScopeId">
SCOPE_ID_ = #{subScopeId, jdbcType=VARCHAR},
</if>
<if test="originalPersistentState.scopeType != scopeType">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册