Search in sources :

Example 1 with StateBasedNodeInstance

use of io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance in project automatiko-engine by automatiko-io.

the class ProcessInstanceMarshaller method importProcessInstance.

@SuppressWarnings({ "rawtypes", "unchecked" })
public ProcessInstance importProcessInstance(ExportedProcessInstance<?> instance, Process process) {
    List<Map<String, String>> timers = instance.convertTimers();
    WorkflowProcessInstance wpi = importWorkflowProcessInstance((String) instance.getHeader(), (String) instance.getInstance(), timers, process);
    Model model = ((AbstractProcess) process).createModel();
    model.fromMap(wpi.getVariables());
    ProcessInstance processInstance = ((AbstractProcess) process).createInstance(wpi, model, 1);
    if (timers != null && !timers.isEmpty()) {
        String parentProcessInstanceId = wpi.getParentProcessInstanceId();
        if (parentProcessInstanceId != null && !parentProcessInstanceId.isEmpty()) {
            parentProcessInstanceId += ":";
        } else {
            parentProcessInstanceId = "";
        }
        JobsService jobService = ((WorkflowProcessInstanceImpl) wpi).getProcessRuntime().getJobsService();
        Collection<io.automatiko.engine.workflow.process.instance.NodeInstance> nodes = ((WorkflowProcessInstanceImpl) wpi).getNodeInstances(true);
        // keeps iterator for statebased node instance timers
        Map<String, Iterator<Timer>> nodeInstanceTimers = new LinkedHashMap<>();
        for (Map<String, String> timer : timers) {
            String nodeInstanceId = timer.get("nodeInstanceId");
            for (io.automatiko.engine.workflow.process.instance.NodeInstance ni : nodes) {
                if (ni.getId().equals(nodeInstanceId)) {
                    ExpirationTime expirationTime = null;
                    long timerNodeId = 0;
                    if (((NodeInstanceImpl) ni).getRetryJobId() != null && ((NodeInstanceImpl) ni).getRetryJobId().equals(timer.get("timerId"))) {
                        jobService.scheduleProcessInstanceJob(ProcessInstanceJobDescription.of(timer.get("timerId"), ni.getNodeId(), "retry:" + ni.getId(), expirationTime, ((NodeInstanceImpl) ni).getProcessInstanceIdWithParent(), ni.getProcessInstance().getRootProcessInstanceId(), ni.getProcessInstance().getProcessId(), ni.getProcessInstance().getProcess().getVersion(), ni.getProcessInstance().getRootProcessId()));
                        break;
                    } else if (ni instanceof TimerNodeInstance) {
                        TimerNodeInstance nodeInstance = (TimerNodeInstance) ni;
                        timerNodeId = nodeInstance.getTimerNode().getTimer().getId();
                        expirationTime = nodeInstance.createTimerInstance(nodeInstance.getTimerNode().getTimer());
                        expirationTime.reset(ZonedDateTime.parse(timer.get("scheduledAt")));
                    } else if (ni instanceof StateBasedNodeInstance) {
                        StateBasedNodeInstance nodeInstance = (StateBasedNodeInstance) ni;
                        if (nodeInstance.getTimerInstances().contains(timer.get("timerId"))) {
                            Iterator<Timer> it = nodeInstanceTimers.computeIfAbsent(nodeInstanceId, k -> nodeInstance.getEventBasedNode().getTimers().keySet().iterator());
                            expirationTime = nodeInstance.createTimerInstance(it.next());
                            expirationTime.reset(ZonedDateTime.parse(timer.get("scheduledAt")));
                        }
                    }
                    // lastly schedule timer on calculated expiration time
                    jobService.scheduleProcessInstanceJob(ProcessInstanceJobDescription.of(timer.get("timerId"), timerNodeId, expirationTime, ((NodeInstanceImpl) ni).getProcessInstanceIdWithParent(), wpi.getRootProcessInstanceId(), wpi.getProcessId(), wpi.getProcess().getVersion(), wpi.getRootProcessId()));
                    break;
                }
            }
        }
    }
    return processInstance;
}
Also used : WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl) ExpirationTime(io.automatiko.engine.api.jobs.ExpirationTime) LinkedHashMap(java.util.LinkedHashMap) JobsService(io.automatiko.engine.api.jobs.JobsService) Iterator(java.util.Iterator) NodeInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.NodeInstanceImpl) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) AbstractProcess(io.automatiko.engine.workflow.AbstractProcess) Timer(io.automatiko.engine.workflow.base.core.timer.Timer) Model(io.automatiko.engine.api.Model) AbstractProcessInstance(io.automatiko.engine.workflow.AbstractProcessInstance) WorkflowProcessInstance(io.automatiko.engine.api.runtime.process.WorkflowProcessInstance) ProcessInstance(io.automatiko.engine.api.workflow.ProcessInstance) StringExportedProcessInstance(io.automatiko.engine.workflow.StringExportedProcessInstance) ExportedProcessInstance(io.automatiko.engine.api.workflow.ExportedProcessInstance) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) TimerNodeInstance(io.automatiko.engine.workflow.process.instance.node.TimerNodeInstance) TimerNodeInstance(io.automatiko.engine.workflow.process.instance.node.TimerNodeInstance) WorkflowProcessInstance(io.automatiko.engine.api.runtime.process.WorkflowProcessInstance)

Example 2 with StateBasedNodeInstance

use of io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance in project automatiko-engine by automatiko-io.

the class ProcessInstanceMarshaller method exportProcessInstance.

public ExportedProcessInstance<?> exportProcessInstance(ProcessInstance<?> processInstance) {
    io.automatiko.engine.api.runtime.process.ProcessInstance pi = ((AbstractProcessInstance<?>) processInstance).internalGetProcessInstance();
    if (pi == null) {
        return null;
    }
    try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
        Map<String, Object> localEnv = new HashMap<String, Object>(env);
        localEnv.put("_export_", true);
        ProcessMarshallerWriteContext context = new ProcessMarshallerWriteContext(baos, ((io.automatiko.engine.workflow.base.instance.ProcessInstance) pi).getProcessRuntime(), null, localEnv);
        context.setProcessInstanceId(pi.getId());
        context.setState(pi.getState());
        String processType = pi.getProcess().getType();
        context.stream.writeUTF(processType);
        io.automatiko.engine.workflow.marshalling.impl.ProcessInstanceMarshaller marshaller = ProcessMarshallerRegistry.INSTANCE.getMarshaller(processType);
        Object result = marshaller.writeProcessInstance(context, pi);
        AutomatikoMessages.Header.Builder _header = AutomatikoMessages.Header.newBuilder();
        _header.setVersion(AutomatikoMessages.Version.newBuilder().setVersionMajor(1).setVersionMinor(0).setVersionRevision(0).build());
        PersisterHelper.writeStrategiesIndex(context, _header);
        String header = JsonFormat.printer().print(_header);
        context.close();
        // collect all information about timers
        Collection<io.automatiko.engine.workflow.process.instance.NodeInstance> nodes = ((WorkflowProcessInstanceImpl) pi).getNodeInstances(true);
        StringBuilder timers = new StringBuilder("[");
        for (io.automatiko.engine.workflow.process.instance.NodeInstance ni : nodes) {
            String timerId = null;
            if (ni instanceof TimerNodeInstance) {
                timerId = ((TimerNodeInstance) ni).getTimerId();
            } else if (ni instanceof StateBasedNodeInstance) {
                if (((StateBasedNodeInstance) ni).getTimerInstances() != null) {
                    ((StateBasedNodeInstance) ni).getTimerInstances().forEach(timer -> {
                        ZonedDateTime scheduledTime = context.processRuntime.getJobsService().getScheduledTime(timer);
                        timers.append("{\"timerId\":\"").append(timer).append("\",\"scheduledAt\":\"").append(scheduledTime.toString()).append("\",\"nodeInstanceId\":\"").append(ni.getId()).append("\"}");
                    });
                }
            }
            if (timerId != null) {
                ZonedDateTime scheduledTime = context.processRuntime.getJobsService().getScheduledTime(timerId);
                timers.append("{\"timerId\":\"").append(timerId).append("\",\"scheduledAt\":\"").append(scheduledTime.toString()).append("\",\"nodeInstanceId\":\"").append(ni.getId()).append("\"}");
            }
            if (((NodeInstanceImpl) ni).getRetryJobId() != null && !((NodeInstanceImpl) ni).getRetryJobId().isEmpty()) {
                ZonedDateTime scheduledTime = context.processRuntime.getJobsService().getScheduledTime(((NodeInstanceImpl) ni).getRetryJobId());
                timers.append("{\"timerId\":\"").append(((NodeInstanceImpl) ni).getRetryJobId()).append("\",\"scheduledAt\":\"").append(scheduledTime.toString()).append("\",\"nodeInstanceId\":\"").append(ni.getId()).append("\"}");
            }
        }
        timers.append("]");
        return StringExportedProcessInstance.of(header, JsonFormat.printer().print((MessageOrBuilder) result), timers.toString(), null);
    } catch (Exception e) {
        throw new RuntimeException("Error while marshalling process instance", e);
    }
}
Also used : StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) TimerNodeInstance(io.automatiko.engine.workflow.process.instance.node.TimerNodeInstance) AbstractProcessInstance(io.automatiko.engine.workflow.AbstractProcessInstance) Timer(io.automatiko.engine.workflow.base.core.timer.Timer) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ProtobufRuleFlowProcessInstanceMarshaller(io.automatiko.engine.workflow.marshalling.impl.ProtobufRuleFlowProcessInstanceMarshaller) WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl) ZonedDateTime(java.time.ZonedDateTime) ObjectInputStream(java.io.ObjectInputStream) ExpirationTime(io.automatiko.engine.api.jobs.ExpirationTime) NodeInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.NodeInstanceImpl) HashMap(java.util.HashMap) MessageOrBuilder(com.google.protobuf.MessageOrBuilder) SerializablePlaceholderResolverStrategy(io.automatiko.engine.workflow.marshalling.impl.strategies.SerializablePlaceholderResolverStrategy) LinkedHashMap(java.util.LinkedHashMap) JobsService(io.automatiko.engine.api.jobs.JobsService) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map) Process(io.automatiko.engine.api.workflow.Process) PersisterHelper(io.automatiko.engine.workflow.marshalling.impl.PersisterHelper) AbstractProcess(io.automatiko.engine.workflow.AbstractProcess) StreamCorruptedException(java.io.StreamCorruptedException) Iterator(java.util.Iterator) Model(io.automatiko.engine.api.Model) AutomatikoMessages(io.automatiko.engine.workflow.marshalling.impl.AutomatikoMessages) Collection(java.util.Collection) ClassObjectMarshallingStrategyAcceptor(io.automatiko.engine.workflow.marshalling.impl.ClassObjectMarshallingStrategyAcceptor) IOException(java.io.IOException) WorkflowProcessInstance(io.automatiko.engine.api.runtime.process.WorkflowProcessInstance) MarshallerReaderContext(io.automatiko.engine.workflow.marshalling.impl.MarshallerReaderContext) ProcessMarshallerRegistry(io.automatiko.engine.workflow.marshalling.impl.ProcessMarshallerRegistry) ProcessInstance(io.automatiko.engine.api.workflow.ProcessInstance) StringExportedProcessInstance(io.automatiko.engine.workflow.StringExportedProcessInstance) List(java.util.List) JsonFormat(com.google.protobuf.util.JsonFormat) ObjectMarshallingStrategy(io.automatiko.engine.api.marshalling.ObjectMarshallingStrategy) ExportedProcessInstance(io.automatiko.engine.api.workflow.ExportedProcessInstance) EnvironmentName(io.automatiko.engine.api.runtime.EnvironmentName) ProcessInstanceJobDescription(io.automatiko.engine.api.jobs.ProcessInstanceJobDescription) AbstractProcessInstance(io.automatiko.engine.workflow.AbstractProcessInstance) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl) MessageOrBuilder(com.google.protobuf.MessageOrBuilder) ZonedDateTime(java.time.ZonedDateTime) NodeInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.NodeInstanceImpl) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) ByteArrayOutputStream(java.io.ByteArrayOutputStream) StreamCorruptedException(java.io.StreamCorruptedException) IOException(java.io.IOException) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) TimerNodeInstance(io.automatiko.engine.workflow.process.instance.node.TimerNodeInstance) TimerNodeInstance(io.automatiko.engine.workflow.process.instance.node.TimerNodeInstance)

Example 3 with StateBasedNodeInstance

use of io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance in project automatiko-engine by automatiko-io.

the class WorkflowProcessInstanceImpl method getEventDescriptions.

@Override
public Set<EventDescription<?>> getEventDescriptions() {
    if (getState() == ProcessInstance.STATE_COMPLETED || getState() == ProcessInstance.STATE_ABORTED) {
        return Collections.emptySet();
    }
    VariableScope variableScope = (VariableScope) ((ContextContainer) getProcess()).getDefaultContext(VariableScope.VARIABLE_SCOPE);
    Set<EventDescription<?>> eventDesciptions = new LinkedHashSet<>();
    List<EventListener> activeListeners = eventListeners.values().stream().flatMap(List::stream).collect(Collectors.toList());
    activeListeners.addAll(externalEventListeners.values().stream().flatMap(List::stream).collect(Collectors.toList()));
    activeListeners.forEach(el -> eventDesciptions.addAll(el.getEventDescriptions()));
    ((io.automatiko.engine.workflow.process.core.WorkflowProcess) getProcess()).getNodesRecursively().stream().filter(n -> n instanceof EventNodeInterface).forEach(n -> {
        NamedDataType dataType = null;
        if (((EventNodeInterface) n).getVariableName() != null) {
            Map<String, Object> dataOutputs = (Map<String, Object>) n.getMetaData().get("DataOutputs");
            if (dataOutputs != null) {
                for (Entry<String, Object> dOut : dataOutputs.entrySet()) {
                    dataType = new NamedDataType(dOut.getKey(), dOut.getValue());
                }
            } else {
                Variable eventVar = variableScope.findVariable(((EventNodeInterface) n).getVariableName());
                if (eventVar != null) {
                    dataType = new NamedDataType(eventVar.getName(), eventVar.getType());
                }
            }
        }
        if (n instanceof BoundaryEventNode) {
            BoundaryEventNode boundaryEventNode = (BoundaryEventNode) n;
            StateBasedNodeInstance attachedToNodeInstance = (StateBasedNodeInstance) getNodeInstances(true).stream().filter(ni -> ni.getNode().getMetaData().get(UNIQUE_ID).equals(boundaryEventNode.getAttachedToNodeId())).findFirst().orElse(null);
            if (attachedToNodeInstance != null) {
                Map<String, String> properties = new HashMap<>();
                properties.put("AttachedToID", attachedToNodeInstance.getNodeDefinitionId());
                properties.put("AttachedToName", attachedToNodeInstance.getNodeName());
                String eventType = EVENT_TYPE_SIGNAL;
                String eventName = boundaryEventNode.getType();
                Map<String, String> timerProperties = attachedToNodeInstance.extractTimerEventInformation();
                if (timerProperties != null) {
                    properties.putAll(timerProperties);
                    eventType = "timer";
                    eventName = "timerTriggered";
                }
                eventDesciptions.add(new BaseEventDescription(eventName, (String) n.getMetaData().get(UNIQUE_ID), n.getName(), eventType, null, getId(), dataType, properties));
            }
        } else if (n instanceof EventSubProcessNode) {
            EventSubProcessNode eventSubProcessNode = (EventSubProcessNode) n;
            boolean isContainerActive = false;
            if (eventSubProcessNode.getParentContainer() instanceof WorkflowProcess) {
                isContainerActive = true;
            } else if (eventSubProcessNode.getParentContainer() instanceof CompositeNode) {
                isContainerActive = !getNodeInstances(((CompositeNode) eventSubProcessNode.getParentContainer()).getId()).isEmpty();
            }
            if (isContainerActive) {
                Node startNode = eventSubProcessNode.findStartNode();
                Map<Timer, ProcessAction> timers = eventSubProcessNode.getTimers();
                if (timers != null && !timers.isEmpty()) {
                    getNodeInstances(eventSubProcessNode.getId()).forEach(ni -> {
                        Map<String, String> timerProperties = ((StateBasedNodeInstance) ni).extractTimerEventInformation();
                        if (timerProperties != null) {
                            eventDesciptions.add(new BaseEventDescription("timerTriggered", (String) startNode.getMetaData().get("UniqueId"), startNode.getName(), "timer", ni.getId(), getId(), null, timerProperties));
                        }
                    });
                } else {
                    for (String eventName : eventSubProcessNode.getEvents()) {
                        if ("variableChanged".equals(eventName)) {
                            continue;
                        }
                        eventDesciptions.add(new BaseEventDescription(eventName, (String) startNode.getMetaData().get("UniqueId"), startNode.getName(), "signal", null, getId(), dataType));
                    }
                }
            }
        } else if (n instanceof EventNode) {
            NamedDataType finalDataType = dataType;
            getNodeInstances(n.getId()).forEach(ni -> eventDesciptions.add(new BaseEventDescription(((EventNode) n).getType(), (String) n.getMetaData().get(UNIQUE_ID), n.getName(), (String) n.getMetaData().getOrDefault(EVENT_TYPE, EVENT_TYPE_SIGNAL), ni.getId(), getId(), finalDataType)));
        } else if (n instanceof StateNode) {
            getNodeInstances(n.getId()).forEach(ni -> eventDesciptions.add(new BaseEventDescription((String) n.getMetaData().get(CONDITION), (String) n.getMetaData().get(UNIQUE_ID), n.getName(), (String) n.getMetaData().getOrDefault(EVENT_TYPE, EVENT_TYPE_SIGNAL), ni.getId(), getId(), null)));
        }
    });
    return eventDesciptions;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) StateBasedNode(io.automatiko.engine.workflow.process.core.node.StateBasedNode) Metadata(io.automatiko.engine.workflow.process.executable.core.Metadata) COMPLETED(io.automatiko.engine.api.workflow.flexible.ItemDescription.Status.COMPLETED) NodeImpl(io.automatiko.engine.workflow.process.core.impl.NodeImpl) Matcher(java.util.regex.Matcher) ContextContainer(io.automatiko.engine.workflow.base.core.ContextContainer) Map(java.util.Map) IS_FOR_COMPENSATION(io.automatiko.engine.workflow.process.executable.core.Metadata.IS_FOR_COMPENSATION) PrintWriter(java.io.PrintWriter) AdHocFragment(io.automatiko.engine.api.workflow.flexible.AdHocFragment) MilestoneNode(io.automatiko.engine.workflow.process.core.node.MilestoneNode) EventBasedNodeInstanceInterface(io.automatiko.engine.workflow.process.instance.node.EventBasedNodeInstanceInterface) IdentityProvider(io.automatiko.engine.api.auth.IdentityProvider) Set(java.util.Set) VariableScope(io.automatiko.engine.workflow.base.core.context.variable.VariableScope) CORRELATION_KEY(io.automatiko.engine.workflow.process.executable.core.Metadata.CORRELATION_KEY) EventSubProcessNode(io.automatiko.engine.workflow.process.core.node.EventSubProcessNode) StateNode(io.automatiko.engine.workflow.process.core.node.StateNode) Stream(java.util.stream.Stream) CONDITION(io.automatiko.engine.workflow.process.executable.core.Metadata.CONDITION) Variable(io.automatiko.engine.workflow.base.core.context.variable.Variable) ProcessInstanceJobDescription(io.automatiko.engine.api.jobs.ProcessInstanceJobDescription) WorkflowProcessInstance(io.automatiko.engine.workflow.process.instance.WorkflowProcessInstance) EventSubProcessNodeInstance(io.automatiko.engine.workflow.process.instance.node.EventSubProcessNodeInstance) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Timer(io.automatiko.engine.workflow.base.core.timer.Timer) CorrelationKey(io.automatiko.engine.services.correlation.CorrelationKey) Node(io.automatiko.engine.api.definition.process.Node) ArrayList(java.util.ArrayList) CUSTOM_ASYNC(io.automatiko.engine.workflow.process.executable.core.Metadata.CUSTOM_ASYNC) EventListener(io.automatiko.engine.api.runtime.process.EventListener) LinkedHashSet(java.util.LinkedHashSet) NodeInstance(io.automatiko.engine.workflow.process.instance.NodeInstance) DynamicNode(io.automatiko.engine.workflow.process.core.node.DynamicNode) ExecutionsErrorInfo(io.automatiko.engine.api.workflow.ExecutionsErrorInfo) VariableResolverFactory(org.mvel2.integration.VariableResolverFactory) StringWriter(java.io.StringWriter) TrustedIdentityProvider(io.automatiko.engine.api.auth.TrustedIdentityProvider) DateTimeUtils(io.automatiko.engine.workflow.base.core.timer.DateTimeUtils) CUSTOM_SLA_DUE_DATE(io.automatiko.engine.workflow.process.executable.core.Metadata.CUSTOM_SLA_DUE_DATE) NodeInstanceContainer(io.automatiko.engine.api.runtime.process.NodeInstanceContainer) AVAILABLE(io.automatiko.engine.api.workflow.flexible.ItemDescription.Status.AVAILABLE) EventNodeInstanceInterface(io.automatiko.engine.workflow.process.instance.node.EventNodeInstanceInterface) EMPTY_EVENT_LISTENER(io.automatiko.engine.workflow.process.instance.impl.DummyEventListener.EMPTY_EVENT_LISTENER) ContextInstance(io.automatiko.engine.workflow.base.instance.ContextInstance) StartNode(io.automatiko.engine.workflow.process.core.node.StartNode) EventDescription(io.automatiko.engine.api.workflow.EventDescription) EndNode(io.automatiko.engine.workflow.process.core.node.EndNode) EventNode(io.automatiko.engine.workflow.process.core.node.EventNode) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) EVENT_TYPE(io.automatiko.engine.workflow.process.executable.core.Metadata.EVENT_TYPE) TagInstance(io.automatiko.engine.workflow.base.instance.TagInstance) NamedDataType(io.automatiko.engine.api.workflow.NamedDataType) FaultNodeInstance(io.automatiko.engine.workflow.process.instance.node.FaultNodeInstance) VariableScopeInstance(io.automatiko.engine.workflow.base.instance.context.variable.VariableScopeInstance) BaseEventDescription(io.automatiko.engine.api.workflow.BaseEventDescription) ProcessInstance(io.automatiko.engine.api.runtime.process.ProcessInstance) EventNodeInterface(io.automatiko.engine.workflow.process.core.node.EventNodeInterface) TagDefinition(io.automatiko.engine.workflow.base.core.TagDefinition) Collection(java.util.Collection) Tag(io.automatiko.engine.api.workflow.Tag) ProcessAction(io.automatiko.engine.workflow.process.core.ProcessAction) ActionNode(io.automatiko.engine.workflow.process.core.node.ActionNode) ExecutableProcessInstance(io.automatiko.engine.workflow.process.executable.instance.ExecutableProcessInstance) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) WorkItemExecutionError(io.automatiko.engine.api.workflow.workitem.WorkItemExecutionError) Objects(java.util.Objects) NodeContainer(io.automatiko.engine.api.definition.process.NodeContainer) List(java.util.List) PatternConstants(io.automatiko.engine.workflow.util.PatternConstants) EVENT_TYPE_SIGNAL(io.automatiko.engine.workflow.process.executable.core.Metadata.EVENT_TYPE_SIGNAL) ItemDescription(io.automatiko.engine.api.workflow.flexible.ItemDescription) Entry(java.util.Map.Entry) Optional(java.util.Optional) Milestone(io.automatiko.engine.api.workflow.flexible.Milestone) CompositeNodeInstance(io.automatiko.engine.workflow.process.instance.node.CompositeNodeInstance) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) StartNodeInstance(io.automatiko.engine.workflow.process.instance.node.StartNodeInstance) CompositeNode(io.automatiko.engine.workflow.process.core.node.CompositeNode) UNIQUE_ID(io.automatiko.engine.workflow.process.executable.core.Metadata.UNIQUE_ID) HashMap(java.util.HashMap) Function(java.util.function.Function) DurationExpirationTime(io.automatiko.engine.api.jobs.DurationExpirationTime) ProcessInstanceImpl(io.automatiko.engine.workflow.base.instance.impl.ProcessInstanceImpl) ExpressionEvaluator(io.automatiko.engine.api.expression.ExpressionEvaluator) EndNodeInstance(io.automatiko.engine.workflow.process.instance.node.EndNodeInstance) InternalProcessRuntime(io.automatiko.engine.workflow.base.instance.InternalProcessRuntime) BoundaryEventNode(io.automatiko.engine.workflow.process.core.node.BoundaryEventNode) COMPENSATION(io.automatiko.engine.workflow.process.executable.core.Metadata.COMPENSATION) ACTIVE(io.automatiko.engine.api.workflow.flexible.ItemDescription.Status.ACTIVE) Logger(org.slf4j.Logger) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess) TimerInstance(io.automatiko.engine.services.time.TimerInstance) EventNodeInstance(io.automatiko.engine.workflow.process.instance.node.EventNodeInstance) Process(io.automatiko.engine.workflow.base.core.Process) EventTrigger(io.automatiko.engine.workflow.process.core.node.EventTrigger) Collections(java.util.Collections) Variable(io.automatiko.engine.workflow.base.core.context.variable.Variable) HashMap(java.util.HashMap) EventSubProcessNode(io.automatiko.engine.workflow.process.core.node.EventSubProcessNode) StateBasedNode(io.automatiko.engine.workflow.process.core.node.StateBasedNode) MilestoneNode(io.automatiko.engine.workflow.process.core.node.MilestoneNode) EventSubProcessNode(io.automatiko.engine.workflow.process.core.node.EventSubProcessNode) StateNode(io.automatiko.engine.workflow.process.core.node.StateNode) Node(io.automatiko.engine.api.definition.process.Node) DynamicNode(io.automatiko.engine.workflow.process.core.node.DynamicNode) StartNode(io.automatiko.engine.workflow.process.core.node.StartNode) EndNode(io.automatiko.engine.workflow.process.core.node.EndNode) EventNode(io.automatiko.engine.workflow.process.core.node.EventNode) ActionNode(io.automatiko.engine.workflow.process.core.node.ActionNode) CompositeNode(io.automatiko.engine.workflow.process.core.node.CompositeNode) BoundaryEventNode(io.automatiko.engine.workflow.process.core.node.BoundaryEventNode) StateNode(io.automatiko.engine.workflow.process.core.node.StateNode) EventNode(io.automatiko.engine.workflow.process.core.node.EventNode) BoundaryEventNode(io.automatiko.engine.workflow.process.core.node.BoundaryEventNode) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) List(java.util.List) EventListener(io.automatiko.engine.api.runtime.process.EventListener) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess) StateBasedNodeInstance(io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance) EventNodeInterface(io.automatiko.engine.workflow.process.core.node.EventNodeInterface) BaseEventDescription(io.automatiko.engine.api.workflow.BaseEventDescription) BoundaryEventNode(io.automatiko.engine.workflow.process.core.node.BoundaryEventNode) CompositeNode(io.automatiko.engine.workflow.process.core.node.CompositeNode) NamedDataType(io.automatiko.engine.api.workflow.NamedDataType) EventDescription(io.automatiko.engine.api.workflow.EventDescription) BaseEventDescription(io.automatiko.engine.api.workflow.BaseEventDescription) Map(java.util.Map) HashMap(java.util.HashMap) VariableScope(io.automatiko.engine.workflow.base.core.context.variable.VariableScope)

Aggregations

Timer (io.automatiko.engine.workflow.base.core.timer.Timer)3 StateBasedNodeInstance (io.automatiko.engine.workflow.process.instance.node.StateBasedNodeInstance)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Model (io.automatiko.engine.api.Model)2 ExpirationTime (io.automatiko.engine.api.jobs.ExpirationTime)2 JobsService (io.automatiko.engine.api.jobs.JobsService)2 ProcessInstanceJobDescription (io.automatiko.engine.api.jobs.ProcessInstanceJobDescription)2 WorkflowProcessInstance (io.automatiko.engine.api.runtime.process.WorkflowProcessInstance)2 ExportedProcessInstance (io.automatiko.engine.api.workflow.ExportedProcessInstance)2 ProcessInstance (io.automatiko.engine.api.workflow.ProcessInstance)2 Collection (java.util.Collection)2 List (java.util.List)2 MessageOrBuilder (com.google.protobuf.MessageOrBuilder)1 JsonFormat (com.google.protobuf.util.JsonFormat)1 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