Search in sources :

Example 21 with WorkItemImpl

use of io.automatiko.engine.workflow.base.instance.impl.workitem.WorkItemImpl 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

WorkItemImpl (io.automatiko.engine.workflow.base.instance.impl.workitem.WorkItemImpl)21 ProcessInstance (io.automatiko.engine.api.runtime.process.ProcessInstance)6 ExpressionEvaluator (io.automatiko.engine.api.expression.ExpressionEvaluator)4 WorkItemExecutionError (io.automatiko.engine.api.workflow.workitem.WorkItemExecutionError)4 Date (java.util.Date)4 ProcessContext (io.automatiko.engine.workflow.base.core.context.ProcessContext)3 VariableScopeInstance (io.automatiko.engine.workflow.base.instance.context.variable.VariableScopeInstance)3 AssignmentAction (io.automatiko.engine.workflow.base.instance.impl.AssignmentAction)3 DefaultWorkItemManager (io.automatiko.engine.workflow.base.instance.impl.workitem.DefaultWorkItemManager)3 WorkItemHandlerNotFoundException (io.automatiko.engine.workflow.base.instance.impl.workitem.WorkItemHandlerNotFoundException)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Matcher (java.util.regex.Matcher)3 DataTransformer (io.automatiko.engine.api.runtime.process.DataTransformer)2 WorkItemHandler (io.automatiko.engine.api.runtime.process.WorkItemHandler)2 HumanTaskWorkItemImpl (io.automatiko.engine.workflow.base.instance.impl.humantask.HumanTaskWorkItemImpl)2 WorkflowProcess (io.automatiko.engine.workflow.process.core.WorkflowProcess)2 NodeInstance (io.automatiko.engine.workflow.process.instance.NodeInstance)2 NodeInstanceResolverFactory (io.automatiko.engine.workflow.process.instance.impl.NodeInstanceResolverFactory)2 ExtensionRegistry (com.google.protobuf.ExtensionRegistry)1