// a case execution associated with Task B
CmmnActivityExecution taskB = caseInstance.findCaseExecution("B");
// when
caseInstance.terminate();
// then
assertTrue(caseInstance.isTerminated());
assertTrue(stageX.isTerminated());
assertTrue(taskA.isTerminated());