task.setDescription(description);
}
}
protected void initializeTaskDueDate(TaskEntity task, VariableScope variableScope) {
Expression dueDateExpression = taskDefinition.getDueDateExpression();
if(dueDateExpression != null) {
Object dueDate = dueDateExpression.getValue(variableScope);
if(dueDate != null) {
if (dueDate instanceof Date) {
task.setDueDate((Date) dueDate);
} else if (dueDate instanceof String) {
BusinessCalendar businessCalendar = Context
.getProcessEngineConfiguration()
.getBusinessCalendarManager()
.getBusinessCalendar(DueDateBusinessCalendar.NAME);
task.setDueDate(businessCalendar.resolveDuedate((String) dueDate));
} else {
throw new ProcessEngineException("Due date expression does not resolve to a Date or Date string: " +
dueDateExpression.getExpressionText());
}
}
}
}