Search in sources :

Example 1 with TaskInfo

use of cern.modesti.workflow.task.TaskInfo in project modesti by jlsalmon.

the class CoreWorkflowServiceTest method assertTaskNameAndRequestStatus.

/**
 * @param requestId
 * @param taskName
 * @param status
 */
private void assertTaskNameAndRequestStatus(String requestId, String taskName, String status) {
    if (taskName != null) {
        TaskInfo task = taskService.getTask(requestId, taskName);
        assertEquals(taskName, task.getName());
    }
    Request request = requestRepository.findOneByRequestId(requestId);
    assertEquals(status, request.getStatus());
}
Also used : TaskInfo(cern.modesti.workflow.task.TaskInfo) Request(cern.modesti.request.Request)

Example 2 with TaskInfo

use of cern.modesti.workflow.task.TaskInfo in project modesti by jlsalmon.

the class CoreWorkflowServiceTest method claimCurrentTask.

/**
 * @param requestId
 * @param taskName
 * @param user
 */
private void claimCurrentTask(String requestId, String taskName, User user) {
    TaskInfo task = taskService.getTask(requestId, taskName);
    taskService.execute(requestId, task.getName(), new TaskAction(ASSIGN, user.getUsername()), user);
}
Also used : TaskInfo(cern.modesti.workflow.task.TaskInfo) TaskAction(cern.modesti.workflow.task.TaskAction)

Example 3 with TaskInfo

use of cern.modesti.workflow.task.TaskInfo in project modesti by jlsalmon.

the class CoreWorkflowServiceTest method completeCurrentTask.

/**
 * @param requestId
 * @param taskName
 * @param user
 */
private void completeCurrentTask(String requestId, String taskName, User user) {
    TaskInfo task = taskService.getTask(requestId, taskName);
    taskService.execute(requestId, task.getName(), new TaskAction(COMPLETE, user.getUsername()), user);
}
Also used : TaskInfo(cern.modesti.workflow.task.TaskInfo) TaskAction(cern.modesti.workflow.task.TaskAction)

Example 4 with TaskInfo

use of cern.modesti.workflow.task.TaskInfo in project modesti by jlsalmon.

the class BaseIntegrationTest method assertTaskNameAndRequestStatus.

public void assertTaskNameAndRequestStatus(String requestId, String taskName, String status) {
    TaskInfo task = taskService.getActiveTask(requestId);
    assertNotNull(task);
    assertEquals(taskName, task.getName());
    Request request = requestService.findOneByRequestId(requestId);
    assertEquals(status, request.getStatus());
}
Also used : TaskInfo(cern.modesti.workflow.task.TaskInfo) Request(cern.modesti.request.Request)

Example 5 with TaskInfo

use of cern.modesti.workflow.task.TaskInfo in project modesti by jlsalmon.

the class BaseIntegrationTest method assertTaskNameAndRequestStatus.

public void assertTaskNameAndRequestStatus(String requestId, String taskName, String status) {
    TaskInfo task = taskService.getActiveTask(requestId);
    assertNotNull(task);
    assertEquals(taskName, task.getName());
    Request request = requestService.findOneByRequestId(requestId);
    assertEquals(status, request.getStatus());
}
Also used : TaskInfo(cern.modesti.workflow.task.TaskInfo) Request(cern.modesti.request.Request)

Aggregations

TaskInfo (cern.modesti.workflow.task.TaskInfo)5 Request (cern.modesti.request.Request)3 TaskAction (cern.modesti.workflow.task.TaskAction)2