Search in sources :

Example 31 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class KogitoWorkingMemoryLogger method createNodeInstanceId.

private String createNodeInstanceId(NodeInstance nodeInstance) {
    String nodeInstanceId = "" + ((KogitoNodeInstance) nodeInstance).getStringId();
    NodeInstanceContainer nodeContainer = nodeInstance.getNodeInstanceContainer();
    while (nodeContainer != null) {
        if (nodeContainer instanceof NodeInstance) {
            nodeInstance = (NodeInstance) nodeContainer;
            nodeInstanceId = ((KogitoNodeInstance) nodeInstance).getStringId() + ":" + nodeInstanceId;
            nodeContainer = nodeInstance.getNodeInstanceContainer();
        } else {
            break;
        }
    }
    return nodeInstanceId;
}
Also used : NodeInstanceContainer(org.kie.api.runtime.process.NodeInstanceContainer) KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) NodeInstance(org.kie.api.runtime.process.NodeInstance)

Example 32 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class JsonNodeJsonPathResolverTest method setup.

@BeforeEach
void setup() {
    workItem = mock(KogitoWorkItem.class);
    KogitoNodeInstance ni = mock(KogitoNodeInstance.class);
    when(workItem.getNodeInstance()).thenReturn(ni);
    WorkflowProcessInstance pi = mock(WorkflowProcessInstance.class, withSettings().extraInterfaces(ProcessInstance.class));
    when(ni.getProcessInstance()).thenReturn(pi);
    Process process = mock(Process.class);
    when(pi.getProcess()).thenReturn(process);
    when(process.getMetaData()).thenReturn(Collections.emptyMap());
}
Also used : KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) ProcessInstance(org.jbpm.process.instance.ProcessInstance) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) Process(org.kie.api.definition.process.Process) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 33 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class JsonNodeJqResolverTest method setup.

@BeforeEach
void setup() {
    workItem = mock(KogitoWorkItem.class);
    KogitoNodeInstance ni = mock(KogitoNodeInstance.class);
    when(workItem.getNodeInstance()).thenReturn(ni);
    WorkflowProcessInstance pi = mock(WorkflowProcessInstance.class, withSettings().extraInterfaces(ProcessInstance.class));
    when(ni.getProcessInstance()).thenReturn(pi);
    Process process = mock(Process.class);
    when(pi.getProcess()).thenReturn(process);
    when(process.getMetaData()).thenReturn(Collections.emptyMap());
}
Also used : KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) ProcessInstance(org.jbpm.process.instance.ProcessInstance) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) Process(org.kie.api.definition.process.Process) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

KogitoNodeInstance (org.kie.kogito.internal.process.runtime.KogitoNodeInstance)33 KogitoWorkItem (org.kie.kogito.internal.process.runtime.KogitoWorkItem)15 KogitoProcessInstance (org.kie.kogito.internal.process.runtime.KogitoProcessInstance)14 Map (java.util.Map)12 SLAViolatedEvent (org.kie.api.event.process.SLAViolatedEvent)12 KogitoProcessEventListener (org.kie.kogito.internal.process.event.KogitoProcessEventListener)12 List (java.util.List)11 HumanTaskWorkItem (org.kie.kogito.process.workitem.HumanTaskWorkItem)9 WorkUnit (org.kie.kogito.uow.WorkUnit)9 AbstractEventSupport (org.drools.core.event.AbstractEventSupport)8 MessageEventImpl (org.drools.core.event.MessageEventImpl)8 ProcessCompletedEventImpl (org.drools.core.event.ProcessCompletedEventImpl)8 ProcessStartedEventImpl (org.drools.core.event.ProcessStartedEventImpl)8 SLAViolatedEventImpl (org.drools.core.event.SLAViolatedEventImpl)8 SignalEventImpl (org.drools.core.event.SignalEventImpl)8 Date (java.util.Date)7 ExclusiveGroupInstance (org.jbpm.process.instance.context.exclusive.ExclusiveGroupInstance)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 MessageEvent (org.kie.api.event.process.MessageEvent)5