Search in sources :

Example 1 with TaskExecutionService

use of org.dkpro.lab.engine.TaskExecutionService in project dkpro-lab by dkpro.

the class BatchTaskEngine method runNewExecution.

/**
 * Execute the given task with the given task configuration.
 *
 * @param aContext
 *            the context of the current batch task.
 * @param aTask
 *            the the task whose task to be executed.
 * @param aConfig
 *            the current parameter configuration.
 * @return the context meta data.
 */
protected TaskContextMetadata runNewExecution(TaskContext aContext, Task aTask, Map<String, Object> aConfig, Set<String> aScope) throws ExecutionException, LifeCycleException {
    TaskExecutionService execService = aContext.getExecutionService();
    TaskExecutionEngine engine = execService.createEngine(aTask);
    engine.setContextFactory(new ScopedTaskContextFactory(contextFactory, aConfig, aScope));
    String uuid = engine.run(aTask);
    return aContext.getStorageService().getContext(uuid);
}
Also used : TaskExecutionService(org.dkpro.lab.engine.TaskExecutionService) TaskExecutionEngine(org.dkpro.lab.engine.TaskExecutionEngine)

Aggregations

TaskExecutionEngine (org.dkpro.lab.engine.TaskExecutionEngine)1 TaskExecutionService (org.dkpro.lab.engine.TaskExecutionService)1