public void addEventListeners() { if (timerInstances != null && timerInstances.size() > 0 || slaTimerId > -1) { addTimerListener(); } if (slaCompliance == ProcessInstance.SLA_PENDING) { ((WorkflowProcessInstance) getProcessInstance()).addEventListener("slaViolation:" + getId(), this, true); } }
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); addTimerListener(); } } }
protected void addTimerListener() { ((WorkflowProcessInstance) getProcessInstance()).addEventListener("timerTriggered", this, false); ((WorkflowProcessInstance) getProcessInstance()).addEventListener("timer", this, true); ((WorkflowProcessInstance) getProcessInstance()).addEventListener("slaViolation:" + getId(), this, true); }
public void removeEventListeners() { ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("timerTriggered", this, false); ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("timer", this, true); ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("slaViolation:" + getId(), this, true); }
@Override public void signalEvent(String type, Object event) { if ("timerTriggered".equals(type)) { TimerInstance timerInstance = (TimerInstance) event; if (timerInstances != null && timerInstances.contains(timerInstance.getId())) { triggerTimer(timerInstance); } else if (timerInstance.getId() == slaTimerId) { handleSLAViolation(); } } else if (("slaViolation:" + getId()).equals(type)) { handleSLAViolation(); } else if (type.equals(getActivationType())) { if (event instanceof MatchCreatedEvent) { String name = ((MatchCreatedEvent)event).getMatch().getRule().getName(); if (checkProcessInstance((Activation) ((MatchCreatedEvent)event).getMatch())) { ((MatchCreatedEvent)event).getKieRuntime().signalEvent(name, null); } } } }
protected void handleSLAViolation() { if (slaCompliance == ProcessInstance.SLA_PENDING) { InternalProcessRuntime processRuntime = ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime().getProcessRuntime()); processRuntime.getProcessEventSupport().fireBeforeSLAViolated(getProcessInstance(), this, getProcessInstance().getKnowledgeRuntime()); logger.debug("SLA violated on node instance {}", getId()); this.slaCompliance = ProcessInstance.SLA_VIOLATED; this.slaTimerId = -1; processRuntime.getProcessEventSupport().fireAfterSLAViolated(getProcessInstance(), this, getProcessInstance().getKnowledgeRuntime()); } }
public void internalTrigger(NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return;
public void addEventListeners() { if (timerInstances != null && timerInstances.size() > 0 || slaTimerId > -1) { addTimerListener(); } if (slaCompliance == ProcessInstance.SLA_PENDING) { ((WorkflowProcessInstance) getProcessInstance()).addEventListener("slaViolation:" + getId(), this, true); } }
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); addTimerListener(); } } }
protected void addTimerListener() { ((WorkflowProcessInstance) getProcessInstance()).addEventListener("timerTriggered", this, false); ((WorkflowProcessInstance) getProcessInstance()).addEventListener("timer", this, true); ((WorkflowProcessInstance) getProcessInstance()).addEventListener("slaViolation:" + getId(), this, true); }
public void removeEventListeners() { ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("timerTriggered", this, false); ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("timer", this, true); ((WorkflowProcessInstance) getProcessInstance()).removeEventListener("slaViolation:" + getId(), this, true); }
@Override public void signalEvent(String type, Object event) { if ("timerTriggered".equals(type)) { TimerInstance timerInstance = (TimerInstance) event; if (timerInstances != null && timerInstances.contains(timerInstance.getId())) { triggerTimer(timerInstance); } else if (timerInstance.getId() == slaTimerId) { handleSLAViolation(); } } else if (("slaViolation:" + getId()).equals(type)) { handleSLAViolation(); } else if (type.equals(getActivationType())) { if (event instanceof MatchCreatedEvent) { String name = ((MatchCreatedEvent)event).getMatch().getRule().getName(); if (checkProcessInstance((Activation) ((MatchCreatedEvent)event).getMatch())) { ((MatchCreatedEvent)event).getKieRuntime().signalEvent(name, null); } } } }
protected void handleSLAViolation() { if (slaCompliance == ProcessInstance.SLA_PENDING) { InternalProcessRuntime processRuntime = ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime().getProcessRuntime()); processRuntime.getProcessEventSupport().fireBeforeSLAViolated(getProcessInstance(), this, getProcessInstance().getKnowledgeRuntime()); logger.debug("SLA violated on node instance {}", getId()); this.slaCompliance = ProcessInstance.SLA_VIOLATED; this.slaTimerId = -1; processRuntime.getProcessEventSupport().fireAfterSLAViolated(getProcessInstance(), this, getProcessInstance().getKnowledgeRuntime()); } }
public void internalTrigger(NodeInstance from, String type) { super.internalTrigger(from, type); if (getNodeInstanceContainer().getNodeInstance(getId()) == null) { return;