use of io.automatiko.engine.workflow.bpmn2.BpmnProcess 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.workflow.bpmn2.BpmnProcess 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