reformat java code

This commit is contained in:
arolfes 2023-10-04 08:10:48 +02:00
parent 0f1d39d06e
commit b6da50d543
38 changed files with 522 additions and 216 deletions

View File

@ -35,8 +35,7 @@ public interface PropertyParser<T> {
new SimpleParser<>(Long.class, Long::parseLong),
new SimpleParser<>(String.class, Function.identity()),
new SimpleParser<>(ZoneId.class, ZoneId::of))
.collect(
Collectors.toUnmodifiableMap(PropertyParser::getTargetClass, t -> t));
.collect(Collectors.toUnmodifiableMap(PropertyParser::getTargetClass, t -> t));
static PropertyParser<?> getPropertyParser(Class<?> forClass) {
forClass = ReflectionUtil.wrap(forClass);

View File

@ -436,6 +436,7 @@ public class ComparableVersion implements Comparable<ComparableVersion> {
Arrays.asList("alpha", "beta", "milestone", "rc", "snapshot", "", "sp");
private static final Properties ALIASES = new Properties();
/**
* A comparable value for the empty-string qualifier. This one is used to determine if a given
* qualifier makes the version older than one without a qualifier, or more recent.

View File

@ -10,58 +10,83 @@ public class TaskHistoryEventRepresentationModel
/** Unique Id. */
private String taskHistoryId;
/** The Id of the business process. */
private String businessProcessId;
/** The Id of the parent business process. */
private String parentBusinessProcessId;
/** The Id of the task. */
private String taskId;
/** The type of the event. */
private String eventType;
/**
* The time of event creation.
*
* <p>The format is ISO-8601.
*/
private Instant created;
/** The Id of the user. */
private String userId;
/** The long name of the user. */
private String userLongName;
/** Domain. */
private String domain;
/** The key of the Workbasket. */
private String workbasketKey;
/** The company the referenced primary object belongs to. */
private String porCompany;
/** The type of the referenced primary object (contract, claim, policy, customer, ...). */
private String porType;
/** The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, ...). */
private String porSystem;
/** The instance of the system where the referenced primary object is located. */
private String porInstance;
/** The value of the primary object reference. */
private String porValue;
/** The long name of the task owner. */
private String taskOwnerLongName;
/** The key of the task's classification. */
private String taskClassificationKey;
/** The category of the task's classification. */
private String taskClassificationCategory;
/** The classification key of the task's attachment. */
private String attachmentClassificationKey;
/** The old value. */
private String oldValue;
/** The new value. */
private String newValue;
/** A custom property with name "1". */
private String custom1;
/** A custom property with name "2". */
private String custom2;
/** A custom property with name "3". */
private String custom3;
/** A custom property with name "4". */
private String custom4;
/** details of changes within the task. */
private String details;

View File

@ -205,7 +205,8 @@ class UpdateClassificationAccTest {
.permission(WorkbasketPermission.APPEND)
.buildAndStore(workbasketService, "businessadmin");
Task task = new TaskBuilder()
Task task =
new TaskBuilder()
.classificationSummary(classification.asSummary())
.workbasketSummary(workbasketSummary)
.primaryObjRef(defaultTestObjectReference().build())

View File

@ -105,32 +105,6 @@ class AbstractTaskanaJobAccTest {
assertThat(jobsToRun).doesNotContainAnyElementsOf(taskCleanupJobs);
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
class CleanCompletedTasks implements TaskanaConfigurationModifier {
@TaskanaInject TaskanaEngine taskanaEngine;
@TaskanaInject JobMapper jobMapper;
@Override
public Builder modify(Builder builder) {
return builder
.taskCleanupJobEnabled(true)
.jobRunEvery(Duration.ofMillis(1))
.jobFirstRun(Instant.now().plus(5, ChronoUnit.MINUTES));
}
@WithAccessId(user = "admin")
@Test
void should_FindNoJobsToRunUntilFirstRunIsReached_When_CleanupScheduleIsInitialized()
throws Exception {
AbstractTaskanaJob.initializeSchedule(taskanaEngine, TaskCleanupJob.class);
List<ScheduledJob> nextJobs = jobMapper.findJobsToRun(Instant.now());
assertThat(nextJobs).isEmpty();
}
}
@Test
void should_CreateSampleTaskanaJob_When_JobHasMoreThenOneConstructor() {
@ -172,4 +146,30 @@ class AbstractTaskanaJobAccTest {
@Override
protected void execute() throws TaskanaException {}
}
@Nested
@TestInstance(Lifecycle.PER_CLASS)
class CleanCompletedTasks implements TaskanaConfigurationModifier {
@TaskanaInject TaskanaEngine taskanaEngine;
@TaskanaInject JobMapper jobMapper;
@Override
public Builder modify(Builder builder) {
return builder
.taskCleanupJobEnabled(true)
.jobRunEvery(Duration.ofMillis(1))
.jobFirstRun(Instant.now().plus(5, ChronoUnit.MINUTES));
}
@WithAccessId(user = "admin")
@Test
void should_FindNoJobsToRunUntilFirstRunIsReached_When_CleanupScheduleIsInitialized()
throws Exception {
AbstractTaskanaJob.initializeSchedule(taskanaEngine, TaskCleanupJob.class);
List<ScheduledJob> nextJobs = jobMapper.findJobsToRun(Instant.now());
assertThat(nextJobs).isEmpty();
}
}
}

View File

@ -244,15 +244,11 @@ class UserServiceAccTest {
.areExactly(
6,
new Condition<>(
domains ->
Set.of(workbasketDomainA.getDomain())
.equals(domains), "DOMAIN_A"))
domains -> Set.of(workbasketDomainA.getDomain()).equals(domains), "DOMAIN_A"))
.areExactly(
4,
new Condition<>(
domains ->
Set.of(workbasketDomainB.getDomain())
.equals(domains), "DOMAIN_B"));
domains -> Set.of(workbasketDomainB.getDomain()).equals(domains), "DOMAIN_B"));
}
@WithAccessId(user = "user-1-1")
@ -634,9 +630,8 @@ class UserServiceAccTest {
t -> {
Set<String> existingPerms = t.getMiddle();
Set<String> newPerms = t.getMiddle();
User userToUpdate = randomTestUser()
.permissions(existingPerms)
.buildAndStore(userService);
User userToUpdate =
randomTestUser().permissions(existingPerms).buildAndStore(userService);
userToUpdate.setPermissions(newPerms);
userService.updateUser(userToUpdate);
@ -1053,8 +1048,8 @@ class UserServiceAccTest {
.buildAndStore(userService, "businessadmin");
Workbasket workbasket =
defaultTestWorkbasket().buildAndStore(workbasketService, "businessadmin");
createAccessItem(permissionsId,
workbasket, WorkbasketPermission.OPEN, WorkbasketPermission.READ);
createAccessItem(
permissionsId, workbasket, WorkbasketPermission.OPEN, WorkbasketPermission.READ);
User userInDatabase = userService.getUser(user.getId());
@ -1258,10 +1253,8 @@ class UserServiceAccTest {
.buildAndStore(userService, "businessadmin");
Workbasket workbasket =
defaultTestWorkbasket().buildAndStore(workbasketService, "businessadmin");
createAccessItem(permissionId,
workbasket,
WorkbasketPermission.OPEN,
WorkbasketPermission.READ);
createAccessItem(
permissionId, workbasket, WorkbasketPermission.OPEN, WorkbasketPermission.READ);
User userInDatabase = userService.getUser(user.getId());
@ -1299,7 +1292,6 @@ class UserServiceAccTest {
assertThat(userInDatabase.getDomains()).containsExactly(workbasket.getDomain());
}
}
@Nested
@ -1346,8 +1338,7 @@ class UserServiceAccTest {
@WithAccessId(user = "user-1-1")
@Test
void should_ReturnEmptyDomains_When_PropertyIsNotSetAndPermission()
throws Exception {
void should_ReturnEmptyDomains_When_PropertyIsNotSetAndPermission() throws Exception {
String permissionId = UUID.randomUUID().toString();
User user =
randomTestUser()
@ -1355,10 +1346,8 @@ class UserServiceAccTest {
.buildAndStore(userService, "businessadmin");
Workbasket workbasket =
defaultTestWorkbasket().buildAndStore(workbasketService, "businessadmin");
createAccessItem(permissionId,
workbasket,
WorkbasketPermission.OPEN,
WorkbasketPermission.READ);
createAccessItem(
permissionId, workbasket, WorkbasketPermission.OPEN, WorkbasketPermission.READ);
User userInDatabase = userService.getUser(user.getId());

View File

@ -134,6 +134,7 @@ public class TaskanaConfiguration {
// region custom configuration
private final Map<String, String> properties;
// endregion
private TaskanaConfiguration(Builder builder) {
@ -717,11 +718,13 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.servicelevel.validation.enforce")
private boolean enforceServiceLevel = true;
// endregion
// region authentication configuration
@TaskanaProperty("taskana.roles")
private Map<TaskanaRole, Set<String>> roleMap = new EnumMap<>(TaskanaRole.class);
// endregion
// region classification configuration
@ -730,6 +733,7 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.classification.categories")
private Map<String, List<String>> classificationCategoriesByType = new HashMap<>();
// endregion
// region working time configuration
@ -752,6 +756,7 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.workingTime.holidays.german.corpus-christi.enabled")
private boolean germanPublicHolidaysCorpusChristiEnabled = false;
// endregion
// region history configuration
@ -760,6 +765,7 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.history.logger.name")
private String logHistoryLoggerName = null; // default value will be set in the logger class.
// endregion
// region job configuration
@ -852,6 +858,7 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.jobs.customJobs")
private Set<String> customJobs = new HashSet<>();
// endregion
// region user configuration
@ -860,15 +867,18 @@ public class TaskanaConfiguration {
@TaskanaProperty("taskana.user.minimalPermissionsToAssignDomains")
private Set<WorkbasketPermission> minimalPermissionsToAssignDomains = new HashSet<>();
// endregion
// region database configuration
@TaskanaProperty("taskana.feature.useSpecificDb2Taskquery")
private boolean useSpecificDb2Taskquery = true;
// endregion
// region custom configuration
private Map<String, String> properties = Collections.emptyMap();
// endregion
public Builder(DataSource dataSource, boolean useManagedTransactions, String schemaName) {

View File

@ -179,8 +179,11 @@ public class ClassificationServiceImpl implements ClassificationService {
@Override
public Classification createClassification(Classification classification)
throws ClassificationAlreadyExistException, DomainNotFoundException, InvalidArgumentException,
MalformedServiceLevelException, NotAuthorizedException {
throws ClassificationAlreadyExistException,
DomainNotFoundException,
InvalidArgumentException,
MalformedServiceLevelException,
NotAuthorizedException {
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
if (!taskanaEngine.domainExists(classification.getDomain())
&& !MASTER_DOMAIN.equals(classification.getDomain())) {
@ -235,8 +238,11 @@ public class ClassificationServiceImpl implements ClassificationService {
@Override
public Classification updateClassification(Classification classification)
throws ConcurrencyException, ClassificationNotFoundException, InvalidArgumentException,
MalformedServiceLevelException, NotAuthorizedException {
throws ConcurrencyException,
ClassificationNotFoundException,
InvalidArgumentException,
MalformedServiceLevelException,
NotAuthorizedException {
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
ClassificationImpl classificationImpl;
try {

View File

@ -975,6 +975,7 @@ public interface TaskQuery extends BaseQuery<TaskSummary, TaskQueryColumnName> {
* @return the query
*/
TaskQuery primaryObjectReferenceIn(ObjectReference... objectReferences);
// endregion
// region primaryObjectReferenceCompany

View File

@ -219,6 +219,10 @@ public class TaskSummaryImpl implements TaskSummary {
return this.groupByCount;
}
public void setGroupByCount(Integer n) {
groupByCount = n;
}
@Override
public Instant getDue() {
return due != null ? due.truncatedTo(ChronoUnit.MILLIS) : null;
@ -493,10 +497,6 @@ public class TaskSummaryImpl implements TaskSummary {
setWorkbasketSummary(workbasketSummary);
}
public void setGroupByCount(Integer n) {
groupByCount = n;
}
public void addAttachmentSummary(AttachmentSummary attachmentSummary) {
if (this.attachmentSummaries == null) {
this.attachmentSummaries = new ArrayList<>();

View File

@ -16,7 +16,9 @@ public interface UserMapper {
@SelectProvider(type = UserMapperSqlProvider.class, method = "findById")
@Result(property = "id", column = "USER_ID")
@Result(property = "groups", column = "USER_ID", many = @Many(select = "findGroupsById"))
@Result(property = "permissions", column = "USER_ID",
@Result(
property = "permissions",
column = "USER_ID",
many = @Many(select = "findPermissionsById"))
@Result(property = "firstName", column = "FIRST_NAME")
@Result(property = "lastName", column = "LASTNAME")
@ -34,7 +36,9 @@ public interface UserMapper {
@Result(property = "id", column = "USER_ID")
@Result(property = "groups", column = "USER_ID", many = @Many(select = "findGroupsById"))
@Result(property = "permissions", column = "USER_ID",
@Result(
property = "permissions",
column = "USER_ID",
many = @Many(select = "findPermissionsById"))
@Result(property = "firstName", column = "FIRST_NAME")
@Result(property = "lastName", column = "LASTNAME")

View File

@ -424,6 +424,7 @@ public interface WorkbasketService {
* pro.taskana.common.api.TaskanaRole#BUSINESS_ADMIN business-admin}
*/
WorkbasketAccessItemQuery createWorkbasketAccessItemQuery() throws NotAuthorizedException;
// endregion
// region Permission and Authorization

View File

@ -90,6 +90,7 @@ public class ClassificationQueryFilterParameter
*/
@JsonProperty("custom-6-like")
private final String[] custom6Like;
/**
* Filter by the value of the field custom7. This results in a substring search.. (% is appended
* to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will

View File

@ -8,18 +8,21 @@ public class ClassificationRepresentationModel extends ClassificationSummaryRepr
/** True, if this classification to objects in this domain. */
private Boolean isValidInDomain;
/**
* The creation timestamp of the classification in the system.
*
* <p>The format is ISO-8601.
*/
private Instant created;
/**
* The timestamp of the last modification.
*
* <p>The format is ISO-8601.
*/
private Instant modified;
/** The description of the classification. */
private String description;

View File

@ -10,53 +10,71 @@ public class ClassificationSummaryRepresentationModel
/** Unique Id. */
@NotNull protected String classificationId;
/**
* The key of the Classification. This is typically an externally known code or abbreviation of
* the Classification.
*/
@NotNull protected String key;
/**
* The logical name of the entry point. This is needed by the task list application to determine
* the redirect to work on a task of this Classification.
*/
protected String applicationEntryPoint;
/**
* The category of the classification. Categories can be configured in the file
* 'taskana.properties'.
*/
@NotNull protected String category;
/** The domain for which this classification is specified. */
protected String domain;
/** The name of the classification. */
@NotNull protected String name;
/** The Id of the parent classification. Empty string ("") if this is a root classification. */
protected String parentId;
/** The key of the parent classification. Empty string ("") if this is a root classification. */
protected String parentKey;
/** The priority of the classification. */
@NotNull protected int priority;
/**
* The service level of the classification.
*
* <p>This is stated according to ISO 8601.
*/
@NotNull protected String serviceLevel;
/** The type of classification. Types can be configured in the file 'taskana.properties'. */
protected String type;
/** A custom property with name "1". */
protected String custom1;
/** A custom property with name "2". */
protected String custom2;
/** A custom property with name "3". */
protected String custom3;
/** A custom property with name "4". */
protected String custom4;
/** A custom property with name "5". */
protected String custom5;
/** A custom property with name "6". */
protected String custom6;
/** A custom property with name "7". */
protected String custom7;
/** A custom property with name "8". */
protected String custom8;

View File

@ -8,6 +8,7 @@ public class AccessIdRepresentationModel extends RepresentationModel<AccessIdRep
/** The name of this Access Id. */
private String name;
/**
* The value of the Access Id. This value will be used to determine the access to a workbasket.
*/

View File

@ -12,10 +12,13 @@ public class PageMetadata {
/** The element size of the page. */
private final long size;
/** The total number of elements available. */
private final long totalElements;
/** Amount of pages that are available in total. */
private final long totalPages;
/** The current page number. */
private final long number;

View File

@ -12,8 +12,10 @@ public class TaskanaUserInfoRepresentationModel
/** The user Id of the current user. */
private String userId;
/** All groups the current user is a member of. */
private List<String> groupIds = new ArrayList<>();
/** All taskana roles the current user fulfills. */
private List<TaskanaRole> roles = new ArrayList<>();

View File

@ -13,8 +13,10 @@ public class ReportRepresentationModel extends RepresentationModel<ReportReprese
/** Object holding meta info on the report. */
private final MetaInformation meta;
/** Array holding the rows of the report. */
private final List<RowRepresentationModel> rows;
/** Array holding the sums in the columns over all rows. */
private final List<RowRepresentationModel> sumRow;
@ -45,12 +47,16 @@ public class ReportRepresentationModel extends RepresentationModel<ReportReprese
/** Array holding all the cell values of the given row. */
private final int[] cells;
/** Sum of all values of the given row. */
private final int total;
/** Depth of the row. If the depth is > 0, then this row is a sub-row of a prior row */
private final int depth;
/** Array containing description of the row. */
private final String[] desc;
/** Boolean identifying if the given row should be initially displayed or not. */
private final boolean display;
@ -105,12 +111,16 @@ public class ReportRepresentationModel extends RepresentationModel<ReportReprese
/** Name of the report. */
private final String name;
/** Date of the report creation. */
private final Instant date;
/** Column headers of the report. */
private final String[] header;
/** Descriptions for the rows of the report. */
private final String[] rowDesc;
/** Description for the sum column. */
private final String sumRowDesc;

View File

@ -111,7 +111,8 @@ public class TaskController {
if (!taskRepresentationModel.getAttachments().stream()
.filter(att -> Objects.nonNull(att.getTaskId()))
.filter(att -> !att.getTaskId().equals(taskRepresentationModel.getTaskId()))
.collect(Collectors.toList()).isEmpty()) {
.collect(Collectors.toList())
.isEmpty()) {
throw new InvalidArgumentException(
"An attachments' taskId must be empty or equal to the id of the task it belongs to");
}
@ -599,7 +600,8 @@ public class TaskController {
if (!taskRepresentationModel.getAttachments().stream()
.filter(att -> Objects.nonNull(att.getTaskId()))
.filter(att -> !att.getTaskId().equals(taskRepresentationModel.getTaskId()))
.collect(Collectors.toList()).isEmpty()) {
.collect(Collectors.toList())
.isEmpty()) {
throw new InvalidArgumentException(
"An attachments' taskId must be empty or equal to the id of the task it belongs to");
}

View File

@ -395,6 +395,7 @@ public class TaskQueryFilterCustomFields implements QueryParameter<TaskQuery, Vo
/** Filter out by values of the field custom16 of the Task. This is an exact match. */
@JsonProperty("custom-16-not")
private final String[] custom16NotIn;
/**
* Filter by the custom16 field of the Task. This results in a substring search (% is appended to
* the front and end of the requested value). Further SQL "LIKE" wildcard characters will be

View File

@ -21,12 +21,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Filter by the value of the field customInt1 of the Task. This is an exact match. */
@JsonProperty("custom-int-1")
private final Integer[] customInt1In;
/** Exclude values of the field customInt1 of the Task. */
@JsonProperty("custom-int-1-not")
private final Integer[] customInt1NotIn;
/** Filter by the range of value of the field customInt1 of the Task. */
@JsonProperty("custom-int-1-within")
private final Integer[] customInt1Within;
/** Exclude range of values of the field customInt1 of the Task. */
@JsonProperty("custom-int-1-not-within")
private final Integer[] customInt1NotWithin;
@ -38,9 +41,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-1-from")
private final Integer customInt1From;
/** Exclude values from a lower bound of the field customInt1 of the Task. */
@JsonProperty("custom-int-1-from-not")
private final Integer customInt1FromNot;
/**
* Filter by upper bound of customInt1.
*
@ -60,12 +65,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt2 of the Task. */
@JsonProperty("custom-int-2-not")
private final Integer[] customInt2NotIn;
/** Filter by the range of value of the field customInt2 of the Task. */
@JsonProperty("custom-int-2-within")
private final Integer[] customInt2Within;
/** Exclude range of values of the field customInt2 of the Task. */
@JsonProperty("custom-int-2-not-within")
private final Integer[] customInt2NotWithin;
/**
* Filter by lower bound of customInt2.
*
@ -73,9 +81,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-2-from")
private final Integer customInt2From;
/** Exclude values from a lower bound of the field customInt2 of the Task. */
@JsonProperty("custom-int-2-from-not")
private final Integer customInt2FromNot;
/**
* Filter by upper bound of customInt2.
*
@ -83,9 +93,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-2-to")
private final Integer customInt2To;
/** Exclude values to an upper bound of the field customInt2 of the Task. */
@JsonProperty("custom-int-2-to-not")
private final Integer customInt2ToNot;
/** Filter by the value of the field customInt3 of the Task. This is an exact match. */
@JsonProperty("custom-int-3")
private final Integer[] customInt3In;
@ -93,12 +105,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt3 of the Task. */
@JsonProperty("custom-int-3-not")
private final Integer[] customInt3NotIn;
/** Filter by the range of value of the field customInt3 of the Task. */
@JsonProperty("custom-int-3-within")
private final Integer[] customInt3Within;
/** Exclude range of values of the field customInt3 of the Task. */
@JsonProperty("custom-int-3-not-within")
private final Integer[] customInt3NotWithin;
/**
* Filter by lower bound of customInt3.
*
@ -106,9 +121,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-3-from")
private final Integer customInt3From;
/** Exclude values from a lower bound of the field customInt3 of the Task. */
@JsonProperty("custom-int-3-from-not")
private final Integer customInt3FromNot;
/**
* Filter by upper bound of customInt3.
*
@ -116,9 +133,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-3-to")
private final Integer customInt3To;
/** Exclude values to an upper bound of the field customInt3 of the Task. */
@JsonProperty("custom-int-3-to-not")
private final Integer customInt3ToNot;
/** Filter by the value of the field customInt4 of the Task. This is an exact match. */
@JsonProperty("custom-int-4")
private final Integer[] customInt4In;
@ -126,12 +145,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt4 of the Task. */
@JsonProperty("custom-int-4-not")
private final Integer[] customInt4NotIn;
/** Filter by the range of value of the field customInt4 of the Task. */
@JsonProperty("custom-int-4-within")
private final Integer[] customInt4Within;
/** Exclude range of values of the field customInt4 of the Task. */
@JsonProperty("custom-int-4-not-within")
private final Integer[] customInt4NotWithin;
/**
* Filter by lower bound of customInt4.
*
@ -139,9 +161,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-4-from")
private final Integer customInt4From;
/** Exclude values from a lower bound of the field customInt4 of the Task. */
@JsonProperty("custom-int-4-from-not")
private final Integer customInt4FromNot;
/**
* Filter by upper bound of customInt4.
*
@ -149,9 +173,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-4-to")
private final Integer customInt4To;
/** Exclude values to an upper bound of the field customInt4 of the Task. */
@JsonProperty("custom-int-4-to-not")
private final Integer customInt4ToNot;
/** Filter by the value of the field customInt5 of the Task. This is an exact match. */
@JsonProperty("custom-int-5")
private final Integer[] customInt5In;
@ -159,12 +185,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt5 of the Task. */
@JsonProperty("custom-int-5-not")
private final Integer[] customInt5NotIn;
/** Filter by the range of value of the field customInt5 of the Task. */
@JsonProperty("custom-int-5-within")
private final Integer[] customInt5Within;
/** Exclude range of values of the field customInt5 of the Task. */
@JsonProperty("custom-int-5-not-within")
private final Integer[] customInt5NotWithin;
/**
* Filter by lower bound of customInt5.
*
@ -172,9 +201,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-5-from")
private final Integer customInt5From;
/** Exclude values from a lower bound of the field customInt5 of the Task. */
@JsonProperty("custom-int-5-from-not")
private final Integer customInt5FromNot;
/**
* Filter by upper bound of customInt5.
*
@ -182,9 +213,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-5-to")
private final Integer customInt5To;
/** Exclude values to an upper bound of the field customInt5 of the Task. */
@JsonProperty("custom-int-5-to-not")
private final Integer customInt5ToNot;
/** Filter by the value of the field customInt6 of the Task. This is an exact match. */
@JsonProperty("custom-int-6")
private final Integer[] customInt6In;
@ -192,12 +225,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt6 of the Task. */
@JsonProperty("custom-int-6-not")
private final Integer[] customInt6NotIn;
/** Filter by the range of value of the field customInt6 of the Task. */
@JsonProperty("custom-int-6-within")
private final Integer[] customInt6Within;
/** Exclude range of values of the field customInt6 of the Task. */
@JsonProperty("custom-int-6-not-within")
private final Integer[] customInt6NotWithin;
/**
* Filter by lower bound of customInt6.
*
@ -205,9 +241,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-6-from")
private final Integer customInt6From;
/** Exclude values from a lower bound of the field customInt6 of the Task. */
@JsonProperty("custom-int-6-from-not")
private final Integer customInt6FromNot;
/**
* Filter by upper bound of customInt6.
*
@ -215,9 +253,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-6-to")
private final Integer customInt6To;
/** Exclude values to an upper bound of the field customInt6 of the Task. */
@JsonProperty("custom-int-6-to-not")
private final Integer customInt6ToNot;
/** Filter by the value of the field customInt7 of the Task. This is an exact match. */
@JsonProperty("custom-int-7")
private final Integer[] customInt7In;
@ -225,12 +265,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt7 of the Task. */
@JsonProperty("custom-int-7-not")
private final Integer[] customInt7NotIn;
/** Filter by the range of value of the field customInt7 of the Task. */
@JsonProperty("custom-int-7-within")
private final Integer[] customInt7Within;
/** Exclude range of values of the field customInt7 of the Task. */
@JsonProperty("custom-int-7-not-within")
private final Integer[] customInt7NotWithin;
/**
* Filter by lower bound of customInt7.
*
@ -238,9 +281,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-7-from")
private final Integer customInt7From;
/** Exclude values from a lower bound of the field customInt7 of the Task. */
@JsonProperty("custom-int-7-from-not")
private final Integer customInt7FromNot;
/**
* Filter by upper bound of customInt7.
*
@ -248,9 +293,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-7-to")
private final Integer customInt7To;
/** Exclude values to an upper bound of the field customInt7 of the Task. */
@JsonProperty("custom-int-7-to-not")
private final Integer customInt7ToNot;
/** Filter by the value of the field customInt8 of the Task. This is an exact match. */
@JsonProperty("custom-int-8")
private final Integer[] customInt8In;
@ -258,12 +305,15 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
/** Exclude values of the field customInt8 of the Task. */
@JsonProperty("custom-int-8-not")
private final Integer[] customInt8NotIn;
/** Filter by the range of value of the field customInt8 of the Task. */
@JsonProperty("custom-int-8-within")
private final Integer[] customInt8Within;
/** Exclude range of values of the field customInt8 of the Task. */
@JsonProperty("custom-int-8-not-within")
private final Integer[] customInt8NotWithin;
/**
* Filter by lower bound of customInt8.
*
@ -271,9 +321,11 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-8-from")
private final Integer customInt8From;
/** Exclude values from a lower bound of the field customInt8 of the Task. */
@JsonProperty("custom-int-8-from-not")
private final Integer customInt8FromNot;
/**
* Filter by upper bound of customInt8.
*
@ -281,6 +333,7 @@ public class TaskQueryFilterCustomIntFields implements QueryParameter<TaskQuery,
*/
@JsonProperty("custom-int-8-to")
private final Integer customInt8To;
/** Exclude values to an upper bound of the field customInt8 of the Task. */
@JsonProperty("custom-int-8-to-not")
private final Integer customInt8ToNot;

View File

@ -28,6 +28,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the task id shouldn't be. This is an exact match. */
@JsonProperty("task-id-not")
private final String[] taskIdNotIn;
// endregion
// region externalId
/** Filter by the external id of the Task. This is an exact match. */
@ -37,6 +38,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the external id of the Task shouldn't be. This is an exact match. */
@JsonProperty("external-id-not")
private final String[] externalIdNotIn;
// endregion
// region received
/**
@ -101,6 +103,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("received-until-not")
private final Instant receivedUntilNot;
// endregion
// region created
/**
@ -164,6 +167,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("created-until-not")
private final Instant createdUntilNot;
// endregion
// region claimed
/**
@ -183,6 +187,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("claimed-not")
private final Instant[] claimedNotWithin;
// endregion
// region modified
/**
@ -202,6 +207,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("modified-not")
private final Instant[] modifiedNotWithin;
// endregion
// region planned
/**
@ -265,6 +271,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("planned-until-not")
private final Instant plannedUntilNot;
// endregion
// region due
/**
@ -328,6 +335,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("due-until-not")
private final Instant dueUntilNot;
// endregion
// region completed
/**
@ -392,6 +400,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("completed-until-not")
private final Instant completedUntilNot;
// endregion
// region name
/** Filter by the name of the Task. This is an exact match. */
@ -417,6 +426,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("name-not-like")
private final String[] nameNotLike;
// endregion
// region creator
/** Filter by creator of the Task. This is an exact match. */
@ -442,6 +452,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("creator-not-like")
private final String[] creatorNotLike;
// endregion
// region note
/**
@ -459,6 +470,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("note-not-like")
private final String[] noteNotLike;
// endregion
// region description
/**
@ -476,6 +488,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("description-not-like")
private final String[] descriptionNotLike;
// endregion
// region priority
/** Filter by the priority of the Task. This is an exact match. */
@ -509,6 +522,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by excluding priority up to the given value (inclusive). */
@JsonProperty("priority-not-until")
private final Integer priorityNotUntil;
// endregion
// region state
/** Filter by the Task state. This is an exact match. */
@ -518,6 +532,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the Task state shouldn't be. This is an exact match. */
@JsonProperty("state-not")
private final TaskState[] stateNotIn;
// endregion
// region classificationId
/** Filter by the classification id of the Task. This is an exact match. */
@ -527,6 +542,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the classification id of the Task shouldn't be. This is an exact match. */
@JsonProperty("classification-id-not")
private final String[] classificationIdNotIn;
// endregion
// region classificationKey
/** Filter by the classification key of the Task. This is an exact match. */
@ -552,6 +568,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("classification-key-not-like")
private final String[] classificationKeyNotLike;
// endregion
// region classificationParentKey
/**
@ -583,6 +600,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("classification-parent-key-not-like")
private final String[] classificationParentKeyNotLike;
// endregion
// region classificationCategory
/** Filter by the classification category of the Task. This is an exact match. */
@ -610,6 +628,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("classification-category-not-like")
private final String[] classificationCategoryNotLike;
// endregion
// region classificationName
/** Filter by the classification name of the Task. This is an exact match. */
@ -635,6 +654,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("classification-name-not-like")
private final String[] classificationNameNotLike;
// endregion
// region workbasketId
/** Filter by workbasket id of the Task. This is an exact match. */
@ -644,6 +664,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the workbasket id of the Task shouldn't be. This is an exact match. */
@JsonProperty("workbasket-id-not")
private final String[] workbasketIdNotIn;
// endregion
// region workbasketKeyDomain
/**
@ -663,6 +684,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by domain of the Task. This is an exact match. */
@JsonProperty("domain")
private final String domain;
// endregion
// region businessProcessId
/** Filter by the business process id of the Task. This is an exact match. */
@ -749,6 +771,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("owner-is-null")
private final String ownerNull;
// endregion
// region primaryObjectReference
/**
@ -759,6 +782,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por")
private final ObjectReference[] primaryObjectReferenceIn;
// endregion
// region primaryObjectReferenceCompany
/** Filter by the company of the primary object reference of the Task. This is an exact match. */
@ -787,6 +811,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por-company-not-like")
private final String[] porCompanyNotLike;
// endregion
// region primaryObjectReferenceSystem
/** Filter by the system of the primary object reference of the Task. This is an exact match. */
@ -815,6 +840,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por-system-not-like")
private final String[] porSystemNotLike;
// endregion
// region primaryObjectReferenceSystemInstance
/**
@ -846,6 +872,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por-instance-not-like")
private final String[] porInstanceNotLike;
// endregion
// region primaryObjectReferenceSystemType
/** Filter by the type of the primary object reference of the Task. This is an exact match. */
@ -874,6 +901,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por-type-not-like")
private final String[] porTypeNotLike;
// endregion
// region primaryObjectReferenceSystemValue
/** Filter by the value of the primary object reference of the Task. This is an exact match. */
@ -902,6 +930,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("por-value-not-like")
private final String[] porValueNotLike;
// endregion
// region secondaryObjectReference
/**
@ -912,6 +941,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("sor")
private final ObjectReference[] secondaryObjectReferenceIn;
// endregion
// region secondaryObjectReferenceCompany
/**
@ -992,11 +1022,13 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by the is read flag of the Task. This is an exact match. */
@JsonProperty("is-read")
private final Boolean isRead;
// endregion
// region transferred
/** Filter by the is transferred flag of the Task. This is an exact match. */
@JsonProperty("is-transferred")
private final Boolean isTransferred;
// endregion
// region attachmentClassificationId
/** Filter by the attachment classification id of the Task. This is an exact match. */
@ -1009,6 +1041,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-classification-id-not")
private final String[] attachmentClassificationIdNotIn;
// endregion
// region attachmentClassificationKey
/** Filter by the attachment classification key of the Task. This is an exact match. */
@ -1037,6 +1070,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-classification-key-not-like")
private final String[] attachmentClassificationKeyNotLike;
// endregion
// region attachmentClassificationName
/** Filter by the attachment classification name of the Task. This is an exact match. */
@ -1065,6 +1099,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-classification-name-not-like")
private final String[] attachmentClassificationNameNotLike;
// endregion
// region attachmentChannel
/** Filter by the attachment channel of the Task. This is an exact match. */
@ -1090,6 +1125,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-channel-not-like")
private final String[] attachmentChannelNotLike;
// endregion
// region attachmentReferenceValue
/** Filter by the attachment reference of the Task. This is an exact match. */
@ -1115,6 +1151,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-reference-not-like")
private final String[] attachmentReferenceNotLike;
// endregion
// region attachmentReceived
/**
@ -1134,6 +1171,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("attachment-received-not")
private final Instant[] attachmentReceivedNotWithin;
// endregion
// region withoutAttachment
/**
@ -1142,6 +1180,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("without-attachment")
private final Boolean withoutAttachment;
// endregion
// region callbackState
/** Filter by the callback state of the Task. This is an exact match. */
@ -1151,6 +1190,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
/** Filter by what the callback state of the Task shouldn't be. This is an exact match. */
@JsonProperty("callback-state-not")
private final CallbackState[] callbackStateNotIn;
// endregion
// region wildcardSearchValue
/**
@ -1168,6 +1208,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
*/
@JsonProperty("wildcard-search-value")
private final String wildcardSearchValue;
// endregion
// region constructor

View File

@ -9,6 +9,43 @@ import pro.taskana.common.rest.QueryParameter;
import pro.taskana.task.api.TaskQuery;
public class TaskQueryGroupByParameter implements QueryParameter<TaskQuery, Void> {
// region groupBy
@JsonProperty("group-by")
private final TaskQueryGroupBy groupByPor;
@JsonProperty("group-by-sor")
private final String groupBySor;
@ConstructorProperties({"group-by", "group-by-sor"})
public TaskQueryGroupByParameter(TaskQueryGroupBy groupBy, String groupBySor)
throws InvalidArgumentException {
this.groupByPor = groupBy;
this.groupBySor = groupBySor;
validateGroupByParameters();
}
// endregion
// region constructor
@Override
public Void apply(TaskQuery query) {
Optional.ofNullable(groupBySor).ifPresent(query::groupBySor);
Optional.ofNullable(groupByPor)
.ifPresent(taskQueryGroupBy -> taskQueryGroupBy.applyGroupByForQuery(query));
return null;
}
// endregion
private void validateGroupByParameters() throws InvalidArgumentException {
if (groupByPor != null && groupBySor != null) {
throw new InvalidArgumentException(
"Only one of the following can be provided: Either group-by or group-by-sor");
}
}
public enum TaskQueryGroupBy {
POR_VALUE(TaskQuery::groupByPor);
private final Consumer<TaskQuery> consumer;
@ -21,41 +58,4 @@ public class TaskQueryGroupByParameter implements QueryParameter<TaskQuery, Void
consumer.accept(query);
}
}
// region groupBy
@JsonProperty("group-by")
private final TaskQueryGroupBy groupByPor;
@JsonProperty("group-by-sor")
private final String groupBySor;
// endregion
// region constructor
@ConstructorProperties({"group-by", "group-by-sor"})
public TaskQueryGroupByParameter(TaskQueryGroupBy groupBy, String groupBySor)
throws InvalidArgumentException {
this.groupByPor = groupBy;
this.groupBySor = groupBySor;
validateGroupByParameters();
}
// endregion
@Override
public Void apply(TaskQuery query) {
Optional.ofNullable(groupBySor).ifPresent(query::groupBySor);
Optional.ofNullable(groupByPor)
.ifPresent(taskQueryGroupBy -> taskQueryGroupBy.applyGroupByForQuery(query));
return null;
}
private void validateGroupByParameters() throws InvalidArgumentException {
if (groupByPor != null && groupBySor != null) {
throw new InvalidArgumentException(
"Only one of the following can be provided: Either group-by or group-by-sor");
}
}
}

View File

@ -11,18 +11,25 @@ public class AttachmentSummaryRepresentationModel
/** Unique Id. */
protected String attachmentId;
/** the referenced task id. */
protected String taskId;
/** The creation timestamp in the system. */
protected Instant created;
/** The timestamp of the last modification. */
protected Instant modified;
/** The timestamp of the entry date. */
protected Instant received;
/** The classification of this attachment. */
protected ClassificationSummaryRepresentationModel classificationSummary;
/** The Objects primary ObjectReference. */
protected ObjectReferenceRepresentationModel objectReference;
/** Determines on which channel this attachment was received. */
protected String channel;

View File

@ -10,14 +10,19 @@ public class ObjectReferenceRepresentationModel
/** Task Id. */
private String taskId;
/** The company the referenced primary object belongs to. */
private String company;
/** The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, ...). */
private String system;
/** The instance of the system where the referenced primary object is located. */
private String systemInstance;
/** The type of the referenced primary object (contract, claim, policy, customer, ...). */
private String type;
/** The value of the primary object reference. */
private String value;

View File

@ -10,16 +10,22 @@ public class TaskCommentRepresentationModel
/** Unique Id. */
private String taskCommentId;
/** Task Id. Can identify the task the comment belongs to. */
private String taskId;
/** The content of the comment. */
private String textField;
/** The creator of the task comment. */
private String creator;
/** The long name of the task comment creator. */
private String creatorFullName;
/** The creation timestamp in the system. */
private Instant created;
/** Timestamp of the last task comment modification. */
private Instant modified;

View File

@ -53,6 +53,7 @@ public class TaskRepresentationModel extends TaskSummaryRepresentationModel {
/** the key of the custom attribute. */
private String key;
/** the value of the custom attribute. */
private String value;

View File

@ -16,121 +16,172 @@ public class TaskSummaryRepresentationModel
/** Unique Id. */
protected String taskId;
/**
* External Id. Can be used to enforce idempotence at task creation. Can identify an external
* task.
*/
protected String externalId;
/** The creation timestamp in the system. */
protected Instant created;
/** The timestamp of the last claim-operation. */
protected Instant claimed;
/** The timestamp of the completion. */
protected Instant completed;
/** The timestamp of the last modification. */
protected Instant modified;
/**
* Planned start of the task. The actual completion of the task should be between PLANNED and DUE.
*/
protected Instant planned;
/**
* Timestamp when the task has been received. It notes when the surrounding process started and
* not just when the actual task was created.
*/
protected Instant received;
/**
* Timestamp when the task is due. The actual completion of the task should be between PLANNED and
* DUE.
*/
protected Instant due;
/** The name of the task. */
protected String name;
/** the creator of the task. */
protected String creator;
/** note. */
protected String note;
/** The description of the task. */
protected String description;
/** The priority of the task. */
protected int priority;
/**
* The manual priority of the task. If the value of manualPriority is zero or greater, the
* priority is automatically set to manualPriority. In this case, all computations of priority are
* disabled. If the value of manualPriority is negative, Tasks are not prioritized manually.
*/
protected int manualPriority = DEFAULT_MANUAL_PRIORITY;
/** The current task state. */
protected TaskState state;
/** The classification of this task. */
@NotNull protected ClassificationSummaryRepresentationModel classificationSummary;
/** The workbasket this task resides in. */
@NotNull protected WorkbasketSummaryRepresentationModel workbasketSummary;
/** The business process id. */
protected String businessProcessId;
/** the parent business process id. */
protected String parentBusinessProcessId;
/** The owner of the task. The owner is set upon claiming of the task. */
protected String owner;
/** The long name of the task owner. */
protected String ownerLongName;
/** The Objects primary ObjectReference. */
@NotNull protected ObjectReferenceRepresentationModel primaryObjRef;
/** Indicator if the task has been read. */
protected boolean isRead;
/** Indicator if the task has been transferred. */
protected boolean isTransferred;
/** Number of Tasks that are grouped together with this Task during a groupBy. */
protected Integer groupByCount;
/** A custom property with name "1". */
protected String custom1;
/** A custom property with name "2". */
protected String custom2;
/** A custom property with name "3". */
protected String custom3;
/** A custom property with name "4". */
protected String custom4;
/** A custom property with name "5". */
protected String custom5;
/** A custom property with name "6". */
protected String custom6;
/** A custom property with name "7". */
protected String custom7;
/** A custom property with name "8". */
protected String custom8;
/** A custom property with name "9". */
protected String custom9;
/** A custom property with name "10". */
protected String custom10;
/** A custom property with name "11". */
protected String custom11;
/** A custom property with name "12". */
protected String custom12;
/** A custom property with name "13". */
protected String custom13;
/** A custom property with name "14". */
protected String custom14;
/** A custom property with name "15". */
protected String custom15;
/** A custom property with name "16". */
protected String custom16;
/** A custom int property with name "1". */
protected Integer customInt1;
/** A custom int property with name "2". */
protected Integer customInt2;
/** A custom int property with name "3". */
protected Integer customInt3;
/** A custom int property with name "4". */
protected Integer customInt4;
/** A custom int property with name "5". */
protected Integer customInt5;
/** A custom int property with name "6". */
protected Integer customInt6;
/** A custom int property with name "7". */
protected Integer customInt7;
/** A custom int property with name "8". */
protected Integer customInt8;
/** Secondary object references of the task. */
protected List<ObjectReferenceRepresentationModel> secondaryObjectReferences = new ArrayList<>();
/** The attachment summaries of this task. */
private List<AttachmentSummaryRepresentationModel> attachmentSummaries = new ArrayList<>();

View File

@ -41,7 +41,8 @@ public class UserController {
private final CurrentUserContext currentUserContext;
@Autowired
UserController(UserService userService,
UserController(
UserService userService,
UserRepresentationModelAssembler userAssembler,
CurrentUserContext currentUserContext) {
this.userService = userService;
@ -68,8 +69,8 @@ public class UserController {
/**
* This endpoint retrieves multiple Users. If a userId can't be found in the database it will be
* ignored. If none of the given userIds is valid, the returned list will be empty.
* If currentUser is set, the current User from the context will be retrieved as well
* ignored. If none of the given userIds is valid, the returned list will be empty. If currentUser
* is set, the current User from the context will be retrieved as well
*
* @title Get multiple Users
* @param request the HttpServletRequest of the request itself

View File

@ -12,10 +12,13 @@ public class UserRepresentationModel extends RepresentationModel<UserRepresentat
/** Unique Id. */
@NotNull private String userId;
/** The groups of the User. */
private Set<String> groups;
/** The permissions of the User. */
private Set<String> permissions;
/**
* The domains of the User.
*
@ -23,28 +26,40 @@ public class UserRepresentationModel extends RepresentationModel<UserRepresentat
* taskana.user.minimalPermissionsToAssignDomains
*/
private Set<String> domains = Collections.emptySet();
/** The first name of the User. */
private String firstName;
/** The last name of the User. */
private String lastName;
/** The full name of the User. */
private String fullName;
/** The long name of the User. */
private String longName;
/** The email of the User. */
private String email;
/** The phone number of the User. */
private String phone;
/** The mobile phone number of the User. */
private String mobilePhone;
/** The fourth organisation level of the User. */
private String orgLevel4;
/** The third organisation level of the User. */
private String orgLevel3;
/** The second organisation level of the User. */
private String orgLevel2;
/** The first organisation level of the User. */
private String orgLevel1;
/** The data of the User. This field is used for additional information about the User. */
private String data;

View File

@ -9,52 +9,75 @@ public class WorkbasketAccessItemRepresentationModel
/** Unique Id. */
private String accessItemId;
/** The workbasket Id. */
private String workbasketId;
/** The Access Id. This could be either a user Id or a full qualified group Id. */
private String accessId;
/** The workbasket key. */
private String workbasketKey;
/** The name. */
private String accessName;
/** The permission to read the information about the workbasket. */
private boolean permRead;
/** The permission to access a task from the workbasket. */
private boolean permReadTasks;
/** The permission to view the content (the tasks) of a workbasket. */
private boolean permOpen;
/**
* The permission to add tasks to the workbasket. Required for creation and transferring of tasks.
*/
private boolean permAppend;
/** The permission to edit a task from the workbasket. */
private boolean permEditTasks;
/** The permission to transfer tasks (out of the current workbasket). */
private boolean permTransfer;
/** The permission to distribute tasks from the workbasket. */
private boolean permDistribute;
/** The custom permission with the name "1". */
private boolean permCustom1;
/** The custom permission with the name "2". */
private boolean permCustom2;
/** The custom permission with the name "3". */
private boolean permCustom3;
/** The custom permission with the name "4". */
private boolean permCustom4;
/** The custom permission with the name "5". */
private boolean permCustom5;
/** The custom permission with the name "6". */
private boolean permCustom6;
/** The custom permission with the name "7". */
private boolean permCustom7;
/** The custom permission with the name "8". */
private boolean permCustom8;
/** The custom permission with the name "9". */
private boolean permCustom9;
/** The custom permission with the name "10". */
private boolean permCustom10;
/** The custom permission with the name "11". */
private boolean permCustom11;
/** The custom permission with the name "12". */
private boolean permCustom12;

View File

@ -14,8 +14,10 @@ public class WorkbasketDefinitionRepresentationModel
/** The workbasket which is represented. */
@JsonIgnoreProperties("_links")
private WorkbasketRepresentationModel workbasket;
/** The workbasket authorizations. */
private Collection<WorkbasketAccessItemRepresentationModel> authorizations = new ArrayList<>();
/** The distribution targets for this workbasket. */
private Set<String> distributionTargets = new HashSet<>();

View File

@ -12,6 +12,7 @@ public class WorkbasketRepresentationModel extends WorkbasketSummaryRepresentati
* <p>The format is ISO-8601.
*/
private Instant created;
/**
* The timestamp of the last modification.
*

View File

@ -10,37 +10,52 @@ public class WorkbasketSummaryRepresentationModel
/** Unique Id. */
protected String workbasketId;
/** the professional key for the workbasket. */
protected String key;
/** The name of the workbasket. */
protected String name;
/** The domain the workbasket belongs to. */
protected String domain;
/** The type of the workbasket. */
protected WorkbasketType type;
/** the description of the workbasket. */
protected String description;
/**
* The owner of the workbasket. The owner is responsible for the on-time completion of all tasks
* in the workbasket.
*/
protected String owner;
/** A custom property with name "1". */
protected String custom1;
/** A custom property with name "2". */
protected String custom2;
/** A custom property with name "3". */
protected String custom3;
/** A custom property with name "4". */
protected String custom4;
/** A custom property with name "5". */
protected String custom5;
/** A custom property with name "6". */
protected String custom6;
/** A custom property with name "7". */
protected String custom7;
/** A custom property with name "8". */
protected String custom8;
/**
* The first Org Level (the top one).
*
@ -49,12 +64,16 @@ public class WorkbasketSummaryRepresentationModel
* tasks in the workbasket.
*/
protected String orgLevel1;
/** The second Org Level. */
protected String orgLevel2;
/** The third Org Level. */
protected String orgLevel3;
/** The fourth Org Level (the lowest one). */
protected String orgLevel4;
/** Identifier to tell if this workbasket can be deleted. */
private boolean markedForDeletion;

View File

@ -61,7 +61,6 @@ import pro.taskana.workbasket.rest.models.WorkbasketSummaryRepresentationModel;
@TaskanaSpringBootTest
class TaskControllerIntTest {
@Autowired TaskanaConfiguration taskanaConfiguration;
private static final ParameterizedTypeReference<TaskSummaryPagedRepresentationModel>
TASK_SUMMARY_PAGE_MODEL_TYPE = new ParameterizedTypeReference<>() {};
private static final ParameterizedTypeReference<TaskSummaryCollectionRepresentationModel>
@ -71,6 +70,7 @@ class TaskControllerIntTest {
private final RestHelper restHelper;
private final DataSource dataSource;
private final String schemaName;
@Autowired TaskanaConfiguration taskanaConfiguration;
@Autowired
TaskControllerIntTest(

View File

@ -85,7 +85,8 @@ class UserControllerIntTest {
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
ThrowingCallable httpCall =
() -> TEMPLATE.exchange(
() ->
TEMPLATE.exchange(
url,
HttpMethod.GET,
auth,
@ -103,7 +104,8 @@ class UserControllerIntTest {
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
ThrowingCallable httpCall =
() -> TEMPLATE.exchange(
() ->
TEMPLATE.exchange(
url,
HttpMethod.GET,
auth,
@ -133,7 +135,8 @@ class UserControllerIntTest {
@Test
void should_ReturnExistingUsersAndCurrentUser() throws Exception {
String url = restHelper.toUrl(RestEndpoints.URL_USERS)
String url =
restHelper.toUrl(RestEndpoints.URL_USERS)
+ "?user-id=user-1-1&user-id=USER-1-2&current-user";
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));