Search in sources :

Example 1 with ProcessInstanceDataEvent

use of org.kie.kogito.event.process.ProcessInstanceDataEvent in project kogito-apps by kiegroup.

the class AbstractGraphQLRuntimesQueriesIT method testProcessInstanceDiagram.

@Test
void testProcessInstanceDiagram() {
    String processInstanceId = UUID.randomUUID().toString();
    ProcessInstanceDataEvent startEvent = getProcessCloudEvent(processId, processInstanceId, ACTIVE, null, null, null);
    indexProcessCloudEvent(startEvent);
    checkOkResponse("{ \"query\" : \"query { ProcessInstances (where: { id: {equal: \\\"" + processInstanceId + "\\\"}}) {diagram} }\" }");
    verify(dataIndexApiClient).getProcessInstanceDiagram(eq("http://localhost:8080"), eq(getProcessInstance(processId, processInstanceId, 1, null, null)));
}
Also used : ProcessInstanceDataEvent(org.kie.kogito.event.process.ProcessInstanceDataEvent) Test(org.junit.jupiter.api.Test)

Example 2 with ProcessInstanceDataEvent

use of org.kie.kogito.event.process.ProcessInstanceDataEvent in project kogito-apps by kiegroup.

the class AbstractGraphQLRuntimesQueriesIT method testProcessInstanceAbort.

@Test
void testProcessInstanceAbort() {
    String processInstanceId = UUID.randomUUID().toString();
    ProcessInstanceDataEvent startEvent = getProcessCloudEvent(processId, processInstanceId, ACTIVE, null, null, null);
    indexProcessCloudEvent(startEvent);
    checkOkResponse("{ \"query\" : \"mutation{ ProcessInstanceAbort ( id: \\\"" + processInstanceId + "\\\")}\"}");
    verify(dataIndexApiClient).abortProcessInstance(eq("http://localhost:8080"), eq(getProcessInstance(processId, processInstanceId, 1, null, null)));
}
Also used : ProcessInstanceDataEvent(org.kie.kogito.event.process.ProcessInstanceDataEvent) Test(org.junit.jupiter.api.Test)

Example 3 with ProcessInstanceDataEvent

use of org.kie.kogito.event.process.ProcessInstanceDataEvent in project kogito-apps by kiegroup.

the class AbstractGraphQLRuntimesQueriesIT method testNodeInstanceCancel.

@Test
void testNodeInstanceCancel() {
    String nodeInstanceId = "nodeInstanceIdToCancel";
    String processInstanceId = UUID.randomUUID().toString();
    ProcessInstanceDataEvent startEvent = getProcessCloudEvent(processId, processInstanceId, ACTIVE, null, null, null);
    indexProcessCloudEvent(startEvent);
    checkOkResponse("{ \"query\" : \"mutation{ NodeInstanceCancel ( id: \\\"" + processInstanceId + "\\\", nodeInstanceId: \\\"" + nodeInstanceId + "\\\")}\"}");
    verify(dataIndexApiClient).cancelNodeInstance(eq("http://localhost:8080"), eq(getProcessInstance(processId, processInstanceId, 1, null, null)), eq(nodeInstanceId));
}
Also used : ProcessInstanceDataEvent(org.kie.kogito.event.process.ProcessInstanceDataEvent) Test(org.junit.jupiter.api.Test)

Example 4 with ProcessInstanceDataEvent

use of org.kie.kogito.event.process.ProcessInstanceDataEvent in project kogito-apps by kiegroup.

the class AbstractGraphQLRuntimesQueriesIT method testNodeInstanceTrigger.

@Test
void testNodeInstanceTrigger() {
    String nodeId = "nodeIdToTrigger";
    String processInstanceId = UUID.randomUUID().toString();
    ProcessInstanceDataEvent startEvent = getProcessCloudEvent(processId, processInstanceId, ACTIVE, null, null, null);
    indexProcessCloudEvent(startEvent);
    checkOkResponse("{ \"query\" : \"mutation{ NodeInstanceTrigger ( id: \\\"" + processInstanceId + "\\\", nodeId: \\\"" + nodeId + "\\\")}\"}");
    verify(dataIndexApiClient).triggerNodeInstance(eq("http://localhost:8080"), eq(getProcessInstance(processId, processInstanceId, 1, null, null)), eq(nodeId));
}
Also used : ProcessInstanceDataEvent(org.kie.kogito.event.process.ProcessInstanceDataEvent) Test(org.junit.jupiter.api.Test)

Example 5 with ProcessInstanceDataEvent

use of org.kie.kogito.event.process.ProcessInstanceDataEvent in project kogito-apps by kiegroup.

the class AbstractGraphQLRuntimesQueriesIT method testNodeInstanceRetrigger.

@Test
void testNodeInstanceRetrigger() {
    String nodeInstanceId = "nodeInstanceIdToRetrigger";
    String processInstanceId = UUID.randomUUID().toString();
    ProcessInstanceDataEvent startEvent = getProcessCloudEvent(processId, processInstanceId, ACTIVE, null, null, null);
    indexProcessCloudEvent(startEvent);
    checkOkResponse("{ \"query\" : \"mutation{ NodeInstanceRetrigger ( id: \\\"" + processInstanceId + "\\\", nodeInstanceId: \\\"" + nodeInstanceId + "\\\")}\"}");
    verify(dataIndexApiClient).retriggerNodeInstance(eq("http://localhost:8080"), eq(getProcessInstance(processId, processInstanceId, 1, null, null)), eq(nodeInstanceId));
}
Also used : ProcessInstanceDataEvent(org.kie.kogito.event.process.ProcessInstanceDataEvent) Test(org.junit.jupiter.api.Test)

Aggregations

ProcessInstanceDataEvent (org.kie.kogito.event.process.ProcessInstanceDataEvent)35 Test (org.junit.jupiter.api.Test)29 ProcessInstanceEventBody (org.kie.kogito.event.process.ProcessInstanceEventBody)10 UserTaskInstanceDataEvent (org.kie.kogito.event.process.UserTaskInstanceDataEvent)10 Collection (java.util.Collection)9 HashMap (java.util.HashMap)9 ArrayList (java.util.ArrayList)7 Application (org.kie.kogito.Application)6 Model (org.kie.kogito.Model)6 DataEvent (org.kie.kogito.event.DataEvent)6 VariableInstanceDataEvent (org.kie.kogito.event.process.VariableInstanceDataEvent)6 Processes (org.kie.kogito.process.Processes)6 UnitOfWork (org.kie.kogito.uow.UnitOfWork)6 List (java.util.List)5 Map (java.util.Map)4 Date (java.util.Date)3 Person (org.kie.kogito.codegen.data.Person)3 VariableInstanceEventBody (org.kie.kogito.event.process.VariableInstanceEventBody)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 JsonObject (io.vertx.core.json.JsonObject)2