public Timer toTimer() { Timer timer = new Timer(); // TODO serialize this into a timer return timer; }
public void parse(Timer timer, ScopeImpl parentImpl, WorkflowParser parser) { this.configuration = parser.configuration; this.timer = timer; this.id = timer.getId(); if (parentImpl!=null) { this.parent = parentImpl; this.workflow = parentImpl.workflow; } if (timer.getRepeatExpression() != null && timer.getDueDateExpression() != null) { parser.addError("TimeDuration and TimeDate on TimerEventDefinition are both set, but mutually exclusive, please remove one of them."); } TimerTypeService timerTypeService = parser.getConfiguration(TimerTypeService.class); this.timerType = timerTypeService.instantiateTimerType(timer); // some activity types need to validate incoming and outgoing transitions, // that's why they are NOT parsed here, but after the transitions. if (this.timerType==null) { parser.addError("Activity '%s' has no activityType configured", id); } }
public LocalDateTime calculateDueDate() { String repeatExpression = timer.getRepeatExpression(); try { if (repeatExpression != null) { Duration f = DatatypeFactory.newInstance().newDuration(repeatExpression); Date date = new Date(); f.addTo(date); return new LocalDateTime(date.getTime()); } } catch (DatatypeConfigurationException ex) { throw new RuntimeException(ex); } return null; } }
@Override public void readBpmn(BpmnReader r) { super.readBpmn(r); BoundaryEvent boundaryEvent = new BoundaryEvent(); boundaryEvent.readBpmn(r); } }