Search in sources :

Example 6 with TimerInstance

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);
        }
    }
}
Also used : TimerInstance(io.automatiko.engine.services.time.TimerInstance)

Example 7 with TimerInstance

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);
        }
    }
}
Also used : TimerInstance(io.automatiko.engine.services.time.TimerInstance) WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl) Date(java.util.Date)

Aggregations

TimerInstance (io.automatiko.engine.services.time.TimerInstance)7 Date (java.util.Date)5 ProcessInstanceJobDescription (io.automatiko.engine.api.jobs.ProcessInstanceJobDescription)2 EventListener (io.automatiko.engine.api.runtime.process.EventListener)2 BaseEventDescription (io.automatiko.engine.api.workflow.BaseEventDescription)2 EventDescription (io.automatiko.engine.api.workflow.EventDescription)2 NamedDataType (io.automatiko.engine.api.workflow.NamedDataType)2 WorkItemExecutionError (io.automatiko.engine.api.workflow.workitem.WorkItemExecutionError)2 Variable (io.automatiko.engine.workflow.base.core.context.variable.Variable)2 VariableScope (io.automatiko.engine.workflow.base.core.context.variable.VariableScope)2 InternalProcessRuntime (io.automatiko.engine.workflow.base.instance.InternalProcessRuntime)2 VariableScopeInstance (io.automatiko.engine.workflow.base.instance.context.variable.VariableScopeInstance)2 WorkflowProcessInstanceImpl (io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl)2 IdentityProvider (io.automatiko.engine.api.auth.IdentityProvider)1 TrustedIdentityProvider (io.automatiko.engine.api.auth.TrustedIdentityProvider)1 Node (io.automatiko.engine.api.definition.process.Node)1 NodeContainer (io.automatiko.engine.api.definition.process.NodeContainer)1 WorkflowProcess (io.automatiko.engine.api.definition.process.WorkflowProcess)1 ExpressionEvaluator (io.automatiko.engine.api.expression.ExpressionEvaluator)1 DurationExpirationTime (io.automatiko.engine.api.jobs.DurationExpirationTime)1