use of io.automatiko.engine.services.time.TimerInstance in project automatiko-engine by automatiko-io.
the class TimerNodeInstance method signalEvent.
public void signalEvent(String type, Object event) {
if (TIMER_TRIGGERED_EVENT.equals(type)) {
TimerInstance timer = (TimerInstance) event;
if (timer.getId().equals(timerId)) {
logger.debug("Triggering timer with id {} on node {}", timerId, getNodeName());
triggerCompleted(timer.getRepeatLimit() <= 0);
}
}
}
use of io.automatiko.engine.services.time.TimerInstance in project automatiko-engine by automatiko-io.
the class EventNodeInstance method configureSla.
protected void configureSla() {
String slaDueDateExpression = (String) getNode().getMetaData().get("customSLADueDate");
if (slaDueDateExpression != null) {
TimerInstance timer = ((WorkflowProcessInstanceImpl) getProcessInstance()).configureSLATimer(slaDueDateExpression);
if (timer != null) {
this.slaTimerId = timer.getId();
this.slaDueDate = new Date(System.currentTimeMillis() + timer.getDelay());
this.slaCompliance = ProcessInstance.SLA_PENDING;
logger.debug("SLA for node instance {} is PENDING with due date {}", this.getId(), this.slaDueDate);
}
}
}
Aggregations