Search in sources :

Example 56 with ProcessInstance

use of io.automatiko.engine.api.runtime.process.ProcessInstance in project automatiko-engine by automatiko-io.

the class LightWorkItemManager method internalCompleteWorkItem.

public void internalCompleteWorkItem(WorkItem workItem) {
    ProcessInstance processInstance = workItem.getProcessInstance();
    ((WorkItemImpl) workItem).setState(COMPLETED);
    workItem.setCompleteDate(new Date());
    // process instance may have finished already
    if (processInstance != null) {
        processInstance.signalEvent("workItemCompleted", workItem);
    }
    workItems.remove(workItem.getId());
}
Also used : WorkItemImpl(io.automatiko.engine.workflow.base.instance.impl.workitem.WorkItemImpl) ProcessInstance(io.automatiko.engine.api.runtime.process.ProcessInstance) Date(java.util.Date)

Aggregations

ProcessInstance (io.automatiko.engine.api.runtime.process.ProcessInstance)56 ArrayList (java.util.ArrayList)25 NodeInstance (io.automatiko.engine.api.runtime.process.NodeInstance)19 List (java.util.List)18 WorkItem (io.automatiko.engine.api.runtime.process.WorkItem)17 ProcessCompletedEvent (io.automatiko.engine.api.event.process.ProcessCompletedEvent)16 ProcessEventListener (io.automatiko.engine.api.event.process.ProcessEventListener)16 ProcessNodeLeftEvent (io.automatiko.engine.api.event.process.ProcessNodeLeftEvent)16 ProcessNodeTriggeredEvent (io.automatiko.engine.api.event.process.ProcessNodeTriggeredEvent)16 ProcessStartedEvent (io.automatiko.engine.api.event.process.ProcessStartedEvent)16 ProcessVariableChangedEvent (io.automatiko.engine.api.event.process.ProcessVariableChangedEvent)16 ProcessRuntime (io.automatiko.engine.api.runtime.process.ProcessRuntime)16 DelayedExecution (io.automatiko.engine.api.event.process.DelayedExecution)15 ProcessNodeInstanceFailedEvent (io.automatiko.engine.api.event.process.ProcessNodeInstanceFailedEvent)15 ProcessSignaledEvent (io.automatiko.engine.api.event.process.ProcessSignaledEvent)15 ProcessWorkItemTransitionEvent (io.automatiko.engine.api.event.process.ProcessWorkItemTransitionEvent)15 SLAViolatedEvent (io.automatiko.engine.api.event.process.SLAViolatedEvent)15 UnitOfWorkManager (io.automatiko.engine.api.uow.UnitOfWorkManager)15 WorkUnit (io.automatiko.engine.api.uow.WorkUnit)15 Transition (io.automatiko.engine.api.workflow.workitem.Transition)15