@SuppressWarnings("unchecked")
public void initialize() {
log.debug("initializing {}", this);
ScopeImpl scope = getScopeObject();
ensureParentInitialized();
// initialize the lists of referenced objects (prevents db queries)
variableInstances = new HashMap<String, VariableInstanceEntity>();
variableInstanceList = new ArrayList<VariableInstanceEntity>();
eventSubscriptions = new ArrayList<EventSubscriptionEntity>();
jobs = new ArrayList<JobEntity>();
tasks = new ArrayList<TaskEntity>();
// Cached entity-state initialized to null, all bits are zore, indicating NO entities present
cachedEntityState = 0;
List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) scope.getProperty(BpmnParse.PROPERTYNAME_TIMER_DECLARATION);
if (timerDeclarations!=null) {
for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
TimerEntity timer = timerDeclaration.prepareTimerEntity(this);
Context
.getCommandContext()
.getJobEntityManager()
.schedule(timer);
}
}
// create event subscriptions for the current scope
List<EventSubscriptionDeclaration> eventSubscriptionDeclarations = (List<EventSubscriptionDeclaration>) scope.getProperty(BpmnParse.PROPERTYNAME_EVENT_SUBSCRIPTION_DECLARATION);
if(eventSubscriptionDeclarations != null) {
for (EventSubscriptionDeclaration eventSubscriptionDeclaration : eventSubscriptionDeclarations) {
if(!eventSubscriptionDeclaration.isStartEvent()) {
EventSubscriptionEntity eventSubscriptionEntity = eventSubscriptionDeclaration.prepareEventSubscriptionEntity(this);
if (getTenantId() != null) {