use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class AbstractStoreManagerTest method nativeLoadCarList.
protected final DtList<Car> nativeLoadCarList() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Domain doCarList = definitionSpace.resolve("DO_DT_CAR_DTC", Domain.class);
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_LOAD_ALL_CARS").withEngine(TaskEngineSelect.class).withRequest("select * from CAR").withOutRequired("dtc", doCarList).build();
final Task task = Task.builder(taskDefinition).build();
return taskManager.execute(task).getResult();
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class OracleSqlStoreManagerTest method nativeInsertCar.
@Override
protected void nativeInsertCar(final Car car) {
Assertion.checkArgument(car.getId() == null, "L'id n'est pas null {0}", car.getId());
// -----
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Domain doCar = definitionSpace.resolve("DO_DT_CAR_DTO", Domain.class);
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_INSERT_CAR").withEngine(TaskEngineProc.class).withRequest("insert into CAR (ID, FAM_ID,MAKE, MODEL, DESCRIPTION, YEAR, KILO, PRICE, MOTOR_TYPE) values " + "(SEQ_CAR.nextval, #DTO_CAR.FAM_ID#, #DTO_CAR.MAKE#, #DTO_CAR.MODEL#, #DTO_CAR.DESCRIPTION#, #DTO_CAR.YEAR#, #DTO_CAR.KILO#, #DTO_CAR.PRICE#, #DTO_CAR.MOTOR_TYPE#)").addInRequired("DTO_CAR", doCar).build();
final Task task = Task.builder(taskDefinition).addValue("DTO_CAR", car).build();
final TaskResult taskResult = taskManager.execute(task);
nop(taskResult);
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class ItemSearchLoader method loadItems.
private DtList<Item> loadItems(final SearchChunk<Item> searchChunk) {
final TaskDefinition taskDefinition = getTaskDefinition(searchChunk);
final Task task = Task.builder(taskDefinition).build();
return getTaskManager().execute(task).getResult();
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskManagerTest method testExecuteMulti.
/**
* Checks the use case of an multiplication with several inputs and an output
*/
@Test
public void testExecuteMulti() {
final TaskDefinition taskDefinition = getTaskDefinition(TaskDefinitionProvider.TK_MULTIPLICATION);
Assert.assertEquals(Integer.valueOf(30), executeTask(taskDefinition, 5, 2, 3));
}
use of io.vertigo.dynamo.task.metamodel.TaskDefinition in project vertigo by KleeGroup.
the class TaskManagerTest method testExecuteNull.
/**
* Checks that an exception is thrown
* when a null is given to a required task
*/
@Test(expected = NullPointerException.class)
public void testExecuteNull() {
final TaskDefinition taskDefinition = getTaskDefinition(TaskDefinitionProvider.TK_MULTIPLICATION);
// on vérifie que le passage d'un paramètre null déclenche une assertion
executeTask(taskDefinition, null, 2, 3);
}
Aggregations