return eventScopeActivityId;
}
protected TimerEntity newJobInstance(ExecutionEntity execution) {
BusinessCalendar businessCalendar = Context
.getProcessEngineConfiguration()
.getBusinessCalendarManager()
.getBusinessCalendar(type.calendarName);
if (description==null) {
// Prevent NPE from happening in the next line
throw new ProcessEngineException("Timer '"+execution.getActivityId()+"' was not configured with a valid duration/time");
}
String dueDateString = null;
Date duedate = null;
// ACT-1415: timer-declaration on start-event may contain expressions NOT
// evaluating variables but other context, evaluating should happen nevertheless
VariableScope<?> scopeForExpression = execution;
if(scopeForExpression == null) {
scopeForExpression = StartProcessVariableScope.getSharedInstance();
}
Object dueDateValue = description.getValue(scopeForExpression);
if (dueDateValue instanceof String) {
dueDateString = (String)dueDateValue;
}
else if (dueDateValue instanceof Date) {
duedate = (Date)dueDateValue;
}
else {
throw new ProcessEngineException("Timer '"+execution.getActivityId()+"' was not configured with a valid duration/time, either hand in a java.util.Date or a String in format 'yyyy-MM-dd'T'hh:mm:ss'");
}
if (duedate==null) {
duedate = businessCalendar.resolveDuedate(dueDateString);
}
TimerEntity timer = new TimerEntity(this);
timer.setDuedate(duedate);
if (execution != null) {