use of org.kie.camel.container.api.ExecutionServerCommand in project droolsjbpm-integration by kiegroup.
the class AbstractRemoteIntegrationTest method findActiveProcesses.
protected List<ProcessInstance> findActiveProcesses() {
final List<Integer> statuses = Arrays.asList(org.kie.api.runtime.process.ProcessInstance.STATE_ACTIVE);
final Map<String, Object> parameters = new HashMap<>();
parameters.put("status", statuses);
parameters.put("page", "0");
parameters.put("pageSize", "100");
final ExecutionServerCommand executionServerCommand = new ExecutionServerCommand();
executionServerCommand.setClient("query");
executionServerCommand.setOperation("findProcessInstancesByStatus");
executionServerCommand.setParameters(parameters);
final Object response = runOnExecutionServer(executionServerCommand);
final List<ProcessInstance> processInstances = (List<ProcessInstance>) response;
return processInstances;
}
use of org.kie.camel.container.api.ExecutionServerCommand in project droolsjbpm-integration by kiegroup.
the class AbstractRemoteIntegrationTest method teardown.
@After
public void teardown() {
final ExecutionServerCommand executionServerCommand = new ExecutionServerCommand();
executionServerCommand.setClient("kieServices");
executionServerCommand.setOperation("disposeContainer");
executionServerCommand.addParameter("id", CONTAINER_ID);
runOnExecutionServer(executionServerCommand);
}
use of org.kie.camel.container.api.ExecutionServerCommand in project droolsjbpm-integration by kiegroup.
the class AbstractRemoteIntegrationTest method sendSignalToProcessInstance.
protected void sendSignalToProcessInstance(final String containerId, final Long processInstanceId, final String signalName) {
final Map<String, Object> parameters = new HashMap<>();
parameters.put("containerId", containerId);
parameters.put("processInstanceId", processInstanceId);
parameters.put("signalName", signalName);
parameters.put("event", null);
final ExecutionServerCommand executionServerCommand = new ExecutionServerCommand();
executionServerCommand.setClient("process");
executionServerCommand.setOperation("signalProcessInstance");
executionServerCommand.setParameters(parameters);
runOnExecutionServer(executionServerCommand);
}
use of org.kie.camel.container.api.ExecutionServerCommand in project droolsjbpm-integration by kiegroup.
the class AbstractRemoteIntegrationTest method startProcess.
protected Long startProcess(final String containerId, final String processId) {
final Map<String, Object> parameters = new HashMap<>();
parameters.put("containerId", containerId);
parameters.put("processId", processId);
final ExecutionServerCommand executionServerCommand = new ExecutionServerCommand();
executionServerCommand.setClient("process");
executionServerCommand.setOperation("startProcess");
executionServerCommand.setParameters(parameters);
final Object response = runOnExecutionServer(executionServerCommand);
Assertions.assertThat(response).isNotNull();
Assertions.assertThat(response).isInstanceOf(Long.class);
final Long processInstanceId = (Long) response;
Assertions.assertThat(processInstanceId).isGreaterThan(0);
return processInstanceId;
}
use of org.kie.camel.container.api.ExecutionServerCommand in project droolsjbpm-integration by kiegroup.
the class DMNClientIntegrationTest method testEvaluateAll.
@Test
public void testEvaluateAll() {
final DMNContext dmnContext = createDMNContext();
dmnContext.set("a", 10);
dmnContext.set("b", 5);
final Map<String, Object> parameters = new HashMap<>();
parameters.put("containerId", CONTAINER_ID);
final ExecutionServerCommand executionServerCommand = new ExecutionServerCommand();
executionServerCommand.setClient("dmn");
executionServerCommand.setOperation("evaluateAll");
executionServerCommand.setParameters(parameters);
executionServerCommand.setBody(dmnContext);
final Object results = runOnExecutionServer(executionServerCommand);
Assertions.assertThat(results).isNotNull();
Assertions.assertThat(results).isInstanceOf(DMNResult.class);
final DMNResult dmnResult = (DMNResult) results;
Map<String, Object> map = (Map<String, Object>) dmnResult.getContext().get("Math");
Assertions.assertThat(map.get("Sum")).isEqualTo(BigDecimal.valueOf(15));
}
Aggregations