Error setting variables in CMMN

I just want to set a variable in CMMN and overwrite it afterwards.

The simple code is:

@Deployment(resources = {"processes/Case.cmmn"})
public void test_onCreatingCaseInstance_settingVariableWorks() throws Exception {		  
CaseInstance caseInstance = caseService.createCaseInstanceByKey(CaseConstants.CASE_ID);
caseService.setVariable(caseInstance.getId(), "test", "test");
caseService.setVariable(caseInstance.getId(), "test", "test2");}

Unfortunately, I get the following error when reaching the step of overwriting:

08:35:14.934 [main] ERROR org.camunda.bpm.engine.context - ENGINE-16004 Exception while closing command context: ENGINE-05018 Variable listener invocation failed. Reason: null

Thank you for your help!!

Hi @mhoc,

could you please also provide your case definition (cmmn file)?


Hi @tasso94,

thank you for your help! Sometimes the right questions lead to the correct answers.
In our case, we had an incorrect variable listener attached to our CasePlanModel. After removing it, the setting of variables works correctly.

Thank you very much!