use of io.automatiko.engine.services.io.ClassPathResource in project automatiko-engine by automatiko-io.
the class FileSystemProcessInstancesTest method createProcess.
private BpmnProcess createProcess(ProcessConfig config, String fileName) {
BpmnProcess process = BpmnProcess.from(config, new ClassPathResource(fileName)).get(0);
process.setProcessInstancesFactory(new FileSystemProcessInstancesFactory());
process.configure();
process.instances().values(ProcessInstanceReadMode.MUTABLE, 1, 10).forEach(p -> p.abort());
return process;
}
use of io.automatiko.engine.services.io.ClassPathResource in project automatiko-engine by automatiko-io.
the class PredictionAwareHumanTaskLifeCycleTest method testUserTaskWithPredictionService.
@Test
public void testUserTaskWithPredictionService() {
predictNow.set(true);
BpmnProcess process = (BpmnProcess) BpmnProcess.from(config, new ClassPathResource("BPMN2-UserTask.bpmn2")).get(0);
process.configure();
ProcessInstance<BpmnVariables> processInstance = process.createInstance(BpmnVariables.create(Collections.singletonMap("test", "test")));
processInstance.start();
assertEquals(STATE_COMPLETED, processInstance.status());
Model result = (Model) processInstance.variables();
assertEquals(2, result.toMap().size());
assertEquals("predicted value", result.toMap().get("s"));
assertEquals(0, trainedTasks.size());
}
use of io.automatiko.engine.services.io.ClassPathResource in project automatiko-engine by automatiko-io.
the class SmileRandomForestPredictionTest method testUserTaskWithPredictionService.
@Test
public void testUserTaskWithPredictionService() {
BpmnProcess process = (BpmnProcess) BpmnProcess.from(config, new ClassPathResource("BPMN2-UserTask.bpmn2")).get(0);
process.configure();
ProcessInstance<BpmnVariables> processInstance = process.createInstance(BpmnVariables.create(Collections.singletonMap("test", "test")));
processInstance.start();
assertEquals(STATE_COMPLETED, processInstance.status());
Model result = (Model) processInstance.variables();
assertEquals(2, result.toMap().size());
assertEquals("predicted value", result.toMap().get("s"));
}
Aggregations