@Override public void readBpmn(BpmnReader r) { super.readBpmn(r); BoundaryEvent boundaryEvent = new BoundaryEvent(); boundaryEvent.readBpmn(r); } }
protected void attachTimers(AbstractWorkflow workflow) { List<Timer> timers = workflow.getTimers(); if (timers != null && timers.size() > 0) { Iterator<Timer> timerIterator = timers.iterator(); while (timerIterator.hasNext()) { Timer timer = timerIterator.next(); // todo: make generic if (timer instanceof BoundaryEventTimer) { BoundaryEvent boundaryEvent = ((BoundaryEventTimer) timer).boundaryEvent; if (boundaryEvent != null) { Activity act = workflow.findActivity(boundaryEvent.getFromId()); if (act != null) act.timer(timer); timerIterator.remove(); } } } } }
BoundaryEvent boundaryEvent = ((BoundaryEventTimer) timer).boundaryEvent; activityIds.add(boundaryEvent.getBoundaryId()); activityIds.addAll(boundaryEvent.getToTransitionIds());
@Override public void execute(JobController jobController) { ActivityInstanceImpl activityInstance = jobController.getWorkflowInstance().findActivityInstance(jobController.getJob().getActivityInstanceId()); if (activityInstance != null) { for (TimerImpl timer : activityInstance.activity.getTimers()) { if (timer.timer instanceof BoundaryEventTimer) { BoundaryEventTimer boundaryEventTimer = (BoundaryEventTimer) timer.timer; for (String transitionId : boundaryEventTimer.boundaryEvent.getToTransitionIds()) { activityInstance.takeTransition( jobController.getWorkflowInstance().getWorkflow().findTransitionByIdLocal(transitionId)); } } } jobController.getWorkflowInstance().executeWork(); } else { if (log.isDebugEnabled()) log.debug("activityInstance is null, job is not executed. Looked for activityInstance: " + jobController.getJob().getActivityInstanceId()); } } }
BoundaryEvent boundaryEvent = new BoundaryEvent(); boundaryEvent.readBpmn(this);