Adding a method to pass in taskName for new empty TaskExecution

Resolves #298

Added test and add param to javadoc
This commit is contained in:
Thomas Risberg
2017-03-29 11:33:29 -04:00
committed by Glenn Renfro
parent ad6ce32750
commit fec40fd3f8
3 changed files with 38 additions and 2 deletions

View File

@@ -70,6 +70,19 @@ public interface TaskRepository {
@Transactional
TaskExecution createTaskExecution(TaskExecution taskExecution);
/**
* Creates an empty TaskExecution with just an id and name provided. This is intended to be
* utilized in systems where the request of launching a task is separate from the
* actual start of a task (the underlying system may need to deploy the task prior to
* launching, etc).
*
* @param name task name to be associated with the task execution.
*
* @return the initial {@link TaskExecution}
*/
@Transactional
TaskExecution createTaskExecution(String name);
/**
* Creates an empty TaskExecution with just an id provided. This is intended to be
* utilized in systems where the request of launching a task is separate from the

View File

@@ -115,15 +115,20 @@ public class SimpleTaskRepository implements TaskRepository {
}
@Override
public TaskExecution createTaskExecution() {
public TaskExecution createTaskExecution(String name) {
initialize();
TaskExecution taskExecution =
taskExecutionDao.createTaskExecution(null, null,
taskExecutionDao.createTaskExecution(name, null,
Collections.<String>emptyList(), null);
logger.debug("Creating: " + taskExecution.toString());
return taskExecution;
}
@Override
public TaskExecution createTaskExecution() {
return createTaskExecution((String)null);
}
@Override
public TaskExecution startTaskExecution(long executionid, String taskName, Date startTime, List<String> arguments,
String externalExecutionId) {