// an active case instance
String caseInstanceId = caseService
.withCaseDefinition(caseDefinitionId)
.create().getId();
CaseExecutionQuery caseExecutionQuery = caseService.createCaseExecutionQuery();
String caseExecutionId = caseExecutionQuery
.activityId("PI_HumanTask_1")
.singleResult()
.getId();
// the human task is disabled
caseService
.withCaseExecution(caseExecutionId)
.disable();
// when
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("aVariable", "aValue");
caseService.reenableCaseExecution(caseExecutionId, variables);
// then
CaseExecution caseExecution = caseExecutionQuery.singleResult();
// the human task is disabled
assertFalse(caseExecution.isDisabled());
assertFalse(caseExecution.isActive());
assertTrue(caseExecution.isEnabled());