review Findings
This commit is contained in:
parent
1dfe54c0b6
commit
969d3eeff6
|
@ -330,15 +330,11 @@ public interface TaskService {
|
|||
*
|
||||
* @param taskQuery the task query.
|
||||
* @return the task that got selected and claimed
|
||||
* @throws TaskNotFoundException if the task with taskId was not found
|
||||
* @throws InvalidStateException if the state of the task with taskId is not READY
|
||||
* @throws InvalidOwnerException if the task with taskId is claimed by someone else
|
||||
* @throws NotAuthorizedException if the current user has no read permission for the
|
||||
* workbasket the task is in
|
||||
* @throws InvalidOwnerException if the task is claimed by someone else
|
||||
* @throws NotAuthorizedException if the current user has no read permission for the workbasket
|
||||
* the task is in
|
||||
*/
|
||||
Task selectAndClaim(TaskQuery taskQuery)
|
||||
throws TaskNotFoundException, NotAuthorizedException, InvalidStateException,
|
||||
InvalidOwnerException;
|
||||
Task selectAndClaim(TaskQuery taskQuery) throws NotAuthorizedException, InvalidOwnerException;
|
||||
|
||||
/**
|
||||
* Deletes a list of tasks.
|
||||
|
|
|
@ -1110,6 +1110,8 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
}
|
||||
}
|
||||
|
||||
// optimized query for db2 can't be used for now in case of selectAndClaim because of temporary
|
||||
// tables and the "for update" clause clashing in db2
|
||||
public String getLinkToMapperScript() {
|
||||
if (DB.DB2.dbProductId.equals(getDatabaseId()) && !selectAndClaim) {
|
||||
return LINK_TO_MAPPER_DB2;
|
||||
|
|
|
@ -479,8 +479,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
|
||||
@Override
|
||||
public Task selectAndClaim(TaskQuery taskQuery)
|
||||
throws TaskNotFoundException, NotAuthorizedException, InvalidStateException,
|
||||
InvalidOwnerException {
|
||||
throws NotAuthorizedException, InvalidOwnerException {
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("entry to selectAndClaim(taskQuery = {})", taskQuery);
|
||||
|
@ -502,6 +501,8 @@ public class TaskServiceImpl implements TaskService {
|
|||
|
||||
return claim(taskSummary.getId());
|
||||
|
||||
} catch (InvalidStateException | TaskNotFoundException e) {
|
||||
throw new SystemException("Caught exception ", e);
|
||||
} finally {
|
||||
LOGGER.debug("exit from selectAndClaim()");
|
||||
taskanaEngine.returnConnection();
|
||||
|
|
|
@ -50,14 +50,14 @@ class SelectAndClaimTaskAccTest extends AbstractAccTest {
|
|||
threads[i].join();
|
||||
}
|
||||
|
||||
assertThat(selectedAndClaimedTasks.stream().map(Task::getId))
|
||||
assertThat(selectedAndClaimedTasks).extracting(Task::getId)
|
||||
.containsExactlyInAnyOrder(
|
||||
"TKI:000000000000000000000000000000000003",
|
||||
"TKI:000000000000000000000000000000000004",
|
||||
"TKI:000000000000000000000000000000000005",
|
||||
"TKI:000000000000000000000000000000000006");
|
||||
|
||||
assertThat(selectedAndClaimedTasks.stream().map(Task::getOwner))
|
||||
assertThat(selectedAndClaimedTasks).extracting(Task::getOwner)
|
||||
.containsExactlyInAnyOrder("admin", "taskadmin", "teamlead-1", "teamlead-2");
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ public class TaskController extends AbstractPagingController {
|
|||
params.remove(EXTERNAL_ID);
|
||||
}
|
||||
|
||||
for (int i = 1; i < 17; i++) {
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
if (params.containsKey(CUSTOM + i)) {
|
||||
String[] customValues = extractCommaSeparatedFields(params.get(CUSTOM + i));
|
||||
taskQuery.customAttributeIn(String.valueOf(i), customValues);
|
||||
|
|
Loading…
Reference in New Issue