use of io.vertigo.dynamo.task.model.TaskResult 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.model.TaskResult in project vertigo by KleeGroup.
the class AbstractStoreManagerTest method nativeInsertCar.
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,MANUFACTURER, MODEL, DESCRIPTION, YEAR, KILO, PRICE, MTY_CD) values " + "(NEXT VALUE FOR SEQ_CAR, #DTO_CAR.FAM_ID#, #DTO_CAR.MANUFACTURER#, #DTO_CAR.MODEL#, #DTO_CAR.DESCRIPTION#, #DTO_CAR.YEAR#, #DTO_CAR.KILO#, #DTO_CAR.PRICE#, #DTO_CAR.MTY_CD#)").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.model.TaskResult in project vertigo by KleeGroup.
the class TaskProxyMethod method invoke.
@Override
public Object invoke(final Method method, final Object[] args) {
final TaskDefinition taskDefinition = createTaskDefinition(method);
final Task task = createTask(taskDefinition, method, args);
final TaskResult taskResult = getTaskManager().execute(task);
if (taskDefinition.getOutAttributeOption().isPresent()) {
return taskResult.getResult();
}
return Void.TYPE;
}
Aggregations