TSK-134: Updated to Java 8 Time-API. Removed valid_from/valid_until from
classification.
This commit is contained in:
parent
e396adf040
commit
fa917953e8
|
@ -64,8 +64,7 @@ public class TaskanaProducersTest {
|
|||
resultCount++;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertEquals(1, resultCount);
|
||||
Assert.assertEquals(0, resultCount);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.4.4</version>
|
||||
<version>3.4.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
import pro.taskana.model.ObjectReference;
|
||||
|
@ -27,16 +27,16 @@ public interface Attachment {
|
|||
/**
|
||||
* Returns the time when the attachment was created.
|
||||
*
|
||||
* @return the created time as {@link Timestamp}
|
||||
* @return the created time as {@link Instant}
|
||||
*/
|
||||
Timestamp getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Returns the time when the attachment was last modified.
|
||||
*
|
||||
* @return modified {@link Timestamp} of the attachment
|
||||
* @return modified {@link Instant} of the attachment
|
||||
*/
|
||||
Timestamp getModified();
|
||||
Instant getModified();
|
||||
|
||||
/**
|
||||
* Returns the classification summary of the attachment.
|
||||
|
@ -86,17 +86,17 @@ public interface Attachment {
|
|||
/**
|
||||
* Returns the time when this attachment was received.
|
||||
*
|
||||
* @return received time as exact {@link Timestamp}
|
||||
* @return received time as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getReceived();
|
||||
Instant getReceived();
|
||||
|
||||
/**
|
||||
* Sets the time when the attachment was received.
|
||||
*
|
||||
* @param received
|
||||
* the time as {@link Timestamp} when the attachment was received
|
||||
* the time as {@link Instant} when the attachment was received
|
||||
**/
|
||||
void setReceived(Timestamp received);
|
||||
void setReceived(Instant received);
|
||||
|
||||
/**
|
||||
* Returns the custom attributes of this attachment.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Interface for AttachmentSummaries. This is a specific short model-object which only contains the most important
|
||||
|
@ -25,16 +25,16 @@ public interface AttachmentSummary {
|
|||
/**
|
||||
* Gets the time when the attachment was created.
|
||||
*
|
||||
* @return the created timestamp
|
||||
* @return the created Instant
|
||||
*/
|
||||
Timestamp getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Gets the time when the attachment was last modified.
|
||||
*
|
||||
* @return the last modified timestamp
|
||||
* @return the last modified Instant
|
||||
*/
|
||||
Timestamp getModified();
|
||||
Instant getModified();
|
||||
|
||||
/**
|
||||
* Gets the classificationSummary of the attachment.
|
||||
|
@ -46,8 +46,7 @@ public interface AttachmentSummary {
|
|||
/**
|
||||
* Gets the time when the attachment was received.
|
||||
*
|
||||
* @return received timestamp
|
||||
* @return received Instant
|
||||
*/
|
||||
Timestamp getReceived();
|
||||
|
||||
Instant getReceived();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Interface used to specify the Classification-Model.
|
||||
|
@ -79,9 +79,9 @@ public interface Classification {
|
|||
/**
|
||||
* Get the Date when this classification was as created.
|
||||
*
|
||||
* @return created as date
|
||||
* @return created as instant
|
||||
*/
|
||||
Date getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Get the classification name.
|
||||
|
@ -279,25 +279,10 @@ public interface Classification {
|
|||
*/
|
||||
void setCustom8(String custom8);
|
||||
|
||||
/**
|
||||
* Get the sql-date since/when the classification is valid from.
|
||||
*
|
||||
* @return validFrom
|
||||
*/
|
||||
Date getValidFrom();
|
||||
|
||||
/**
|
||||
* Get the sql-date until the classification is valid.
|
||||
*
|
||||
* @return validUntil
|
||||
*/
|
||||
Date getValidUntil();
|
||||
|
||||
/**
|
||||
* Return a summary of the current Classification.
|
||||
*
|
||||
* @return the ClassificationSummary object for the current classification
|
||||
*/
|
||||
ClassificationSummary asSummary();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* ClassificationQuery for generating dynamic sql.
|
||||
|
@ -65,10 +65,10 @@ public interface ClassificationQuery extends BaseQuery<ClassificationSummary> {
|
|||
* Add your created-Dates to your query.
|
||||
*
|
||||
* @param created
|
||||
* date of classification creation.
|
||||
* date (as instant) of classification creation.
|
||||
* @return the query
|
||||
*/
|
||||
ClassificationQuery created(Date... created);
|
||||
ClassificationQuery created(Instant... created);
|
||||
|
||||
/**
|
||||
* Add your name to your query.
|
||||
|
@ -124,22 +124,4 @@ public interface ClassificationQuery extends BaseQuery<ClassificationSummary> {
|
|||
* @return the query
|
||||
*/
|
||||
ClassificationQuery customFields(String... customFields);
|
||||
|
||||
/**
|
||||
* Define after which date the classifications should be valid.
|
||||
*
|
||||
* @param validFrom
|
||||
* date when the classification was valid from
|
||||
* @return the query
|
||||
*/
|
||||
ClassificationQuery validFrom(Date... validFrom);
|
||||
|
||||
/**
|
||||
* Define until which date the classifications should be valid.
|
||||
*
|
||||
* @param validUntil
|
||||
* date until the classification will be or was valid
|
||||
* @return the query
|
||||
*/
|
||||
ClassificationQuery validUntil(Date... validUntil);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* Interface for ClassificationSummaries. This is a specific short model-object which only requieres the most important
|
||||
* informations. Specific ones can be load afterwards via ID.
|
||||
|
@ -49,11 +47,4 @@ public interface ClassificationSummary {
|
|||
* @return classificationName
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets the timestamp until the classification is/was valid.
|
||||
*
|
||||
* @return validUntil as timestamp
|
||||
*/
|
||||
Timestamp getValidUntil();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -22,52 +22,52 @@ public interface Task {
|
|||
/**
|
||||
* Returns the time when the task was {@link TaskState#READY}.
|
||||
*
|
||||
* @return created as exact {@link Timestamp}
|
||||
* @return created as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Returns the time when the task was set to {@link TaskState#CLAIMED} by/to a user.
|
||||
*
|
||||
* @return claimed as exact {@link Timestamp}
|
||||
* @return claimed as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getClaimed();
|
||||
Instant getClaimed();
|
||||
|
||||
/**
|
||||
* Returns the time when the task was set into {@link TaskState#COMPLETED}.
|
||||
*
|
||||
* @return completed as exact {@link Timestamp}
|
||||
* @return completed as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getCompleted();
|
||||
Instant getCompleted();
|
||||
|
||||
/**
|
||||
* Returns the time when the task was modified the last time.
|
||||
*
|
||||
* @return modified as exact {@link Timestamp}
|
||||
* @return modified as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getModified();
|
||||
Instant getModified();
|
||||
|
||||
/**
|
||||
* Returns the time when the work on this task was planned to be started.
|
||||
*
|
||||
* @return planned as exact {@link Timestamp}
|
||||
* @return planned as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getPlanned();
|
||||
Instant getPlanned();
|
||||
|
||||
/**
|
||||
* Sets the time when the work on this task should be started.
|
||||
*
|
||||
* @param planned
|
||||
* as exact {@link Timestamp}
|
||||
* as exact {@link Instant}
|
||||
*/
|
||||
void setPlanned(Timestamp planned);
|
||||
void setPlanned(Instant planned);
|
||||
|
||||
/**
|
||||
* Returns the time when this task should be finished.
|
||||
*
|
||||
* @return due as exact {@link Timestamp}
|
||||
* @return due as exact {@link Instant}
|
||||
*/
|
||||
Timestamp getDue();
|
||||
Instant getDue();
|
||||
|
||||
/**
|
||||
* Return the name of the current task.
|
||||
|
|
|
@ -60,5 +60,4 @@ public interface TaskMonitorService {
|
|||
* @return a {@link Report} object
|
||||
*/
|
||||
Report getWorkbasketLevelReport(List<Workbasket> workbaskets, List<TaskState> states);
|
||||
|
||||
}
|
||||
|
|
|
@ -221,5 +221,4 @@ public interface TaskQuery extends BaseQuery<TaskSummary> {
|
|||
* @return a {@link ObjectReferenceQuery}
|
||||
*/
|
||||
ObjectReferenceQuery createObjectReferenceQuery();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
|
||||
import pro.taskana.model.ObjectReference;
|
||||
import pro.taskana.model.TaskState;
|
||||
|
@ -20,44 +20,44 @@ public interface TaskSummary {
|
|||
/**
|
||||
* Gets the time when the task was created.
|
||||
*
|
||||
* @return the created timestamp
|
||||
* @return the created Instant
|
||||
*/
|
||||
Timestamp getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Gets the time when the task was claimed.
|
||||
*
|
||||
* @return the claimed timestamp
|
||||
* @return the claimed Instant
|
||||
*/
|
||||
Timestamp getClaimed();
|
||||
Instant getClaimed();
|
||||
|
||||
/**
|
||||
* Gets the time when the task was completed.
|
||||
*
|
||||
* @return the completed timestamp
|
||||
* @return the completed Instant
|
||||
*/
|
||||
Timestamp getCompleted();
|
||||
Instant getCompleted();
|
||||
|
||||
/**
|
||||
* Gets the time when the task was last modified.
|
||||
*
|
||||
* @return the last modified timestamp
|
||||
* @return the last modified Instant
|
||||
*/
|
||||
Timestamp getModified();
|
||||
Instant getModified();
|
||||
|
||||
/**
|
||||
* Gets the time when the task is planned to be executed.
|
||||
*
|
||||
* @return the planned timestamp
|
||||
* @return the planned Instant
|
||||
*/
|
||||
Timestamp getPlanned();
|
||||
Instant getPlanned();
|
||||
|
||||
/**
|
||||
* Gets the time when the task is due.
|
||||
*
|
||||
* @return the due timestamp
|
||||
* @return the due Instant
|
||||
*/
|
||||
Timestamp getDue();
|
||||
Instant getDue();
|
||||
|
||||
/**
|
||||
* Gets the name of the task.
|
||||
|
@ -219,5 +219,4 @@ public interface TaskSummary {
|
|||
* @return the task's custom10 property
|
||||
*/
|
||||
String getCustom10();
|
||||
|
||||
}
|
||||
|
|
|
@ -80,5 +80,4 @@ public interface TaskanaEngine {
|
|||
AUTOCOMMIT,
|
||||
EXPLICIT
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import pro.taskana.model.WorkbasketType;
|
||||
|
@ -18,11 +18,11 @@ public interface Workbasket {
|
|||
String getId();
|
||||
|
||||
/**
|
||||
* Returns the timestamp when the workbasket was created.
|
||||
* Returns the date when the workbasket was created.
|
||||
*
|
||||
* @return created timestamp
|
||||
* @return created as Instant
|
||||
*/
|
||||
Timestamp getCreated();
|
||||
Instant getCreated();
|
||||
|
||||
/**
|
||||
* Returns the key of the workbasket.
|
||||
|
@ -70,19 +70,19 @@ public interface Workbasket {
|
|||
void setType(WorkbasketType type);
|
||||
|
||||
/**
|
||||
* Returns the timestamp when the workbasket was modified the last time.
|
||||
* Returns the date when the workbasket was modified the last time.
|
||||
*
|
||||
* @return modified timestamp
|
||||
* @return modified as Instant
|
||||
*/
|
||||
Timestamp getModified();
|
||||
Instant getModified();
|
||||
|
||||
/**
|
||||
* Sets the time when the workbasket was modified the last time.
|
||||
*
|
||||
* @param modified
|
||||
* the timestamp when the workbasket was last modified
|
||||
* as Instant
|
||||
*/
|
||||
void setModified(Timestamp modified);
|
||||
void setModified(Instant modified);
|
||||
|
||||
/**
|
||||
* Returns the name of the workbasket.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana;
|
||||
|
||||
import java.util.Date;
|
||||
import java.time.Instant;
|
||||
|
||||
import pro.taskana.exceptions.InvalidArgumentException;
|
||||
import pro.taskana.model.WorkbasketAuthorization;
|
||||
|
@ -51,37 +51,37 @@ public interface WorkbasketQuery extends BaseQuery<WorkbasketSummary> {
|
|||
* Add your createdAfter-Date to your query.
|
||||
*
|
||||
* @param createdAfter
|
||||
* the date after which the searched Workbaskets are created
|
||||
* as Instant
|
||||
* @return the query
|
||||
*/
|
||||
WorkbasketQuery createdAfter(Date createdAfter);
|
||||
WorkbasketQuery createdAfter(Instant createdAfter);
|
||||
|
||||
/**
|
||||
* Add your createdBefore-Date to your query.
|
||||
*
|
||||
* @param createdBefore
|
||||
* the date before which the searched Workbaskets are created
|
||||
* as Instant
|
||||
* @return the query
|
||||
*/
|
||||
WorkbasketQuery createdBefore(Date createdBefore);
|
||||
WorkbasketQuery createdBefore(Instant createdBefore);
|
||||
|
||||
/**
|
||||
* Add your modifiedAfter-Date to your query.
|
||||
*
|
||||
* @param modifiedAfter
|
||||
* the date after which the searched Workbaskets are modified
|
||||
* as Instant
|
||||
* @return the query
|
||||
*/
|
||||
WorkbasketQuery modifiedAfter(Date modifiedAfter);
|
||||
WorkbasketQuery modifiedAfter(Instant modifiedAfter);
|
||||
|
||||
/**
|
||||
* Add your modifiedBefore-Date to your query.
|
||||
*
|
||||
* @param modifiedBefore
|
||||
* the date before which the searched Workbaskets are modified
|
||||
* as Instant
|
||||
* @return the query
|
||||
*/
|
||||
WorkbasketQuery modifiedBefore(Date modifiedBefore);
|
||||
WorkbasketQuery modifiedBefore(Instant modifiedBefore);
|
||||
|
||||
/**
|
||||
* Add your description to your query. It will be compared in SQL with an LIKE. If you use a wildcard like % tehn it
|
||||
|
|
|
@ -18,13 +18,10 @@ import org.slf4j.LoggerFactory;
|
|||
public class DbSchemaCreator {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DbSchemaCreator.class);
|
||||
|
||||
private static final String SQL = "/sql";
|
||||
private static final String DB_SCHEMA = SQL + "/taskana-schema.sql";
|
||||
private static final String DB_SCHEMA_DETECTION = SQL + "/schema-detection.sql";
|
||||
|
||||
private DataSource dataSource;
|
||||
|
||||
private StringWriter outWriter = new StringWriter();
|
||||
private PrintWriter logWriter = new PrintWriter(outWriter);
|
||||
private StringWriter errorWriter = new StringWriter();
|
||||
|
@ -37,7 +34,9 @@ public class DbSchemaCreator {
|
|||
|
||||
/**
|
||||
* Run all db scripts.
|
||||
* @throws SQLException TODO
|
||||
*
|
||||
* @throws SQLException
|
||||
* TODO
|
||||
*/
|
||||
public void run() throws SQLException {
|
||||
Connection connection = dataSource.getConnection();
|
||||
|
|
|
@ -22,7 +22,6 @@ public class TaskanaEngineConfiguration {
|
|||
private static final String USER_PASSWORD = "sa";
|
||||
private static final String JDBC_H2_MEM_TASKANA = "jdbc:h2:mem:taskana";
|
||||
private static final String H2_DRIVER = "org.h2.Driver";
|
||||
|
||||
protected DataSource dataSource;
|
||||
protected DbSchemaCreator dbScriptRunner;
|
||||
|
||||
|
@ -107,5 +106,4 @@ public class TaskanaEngineConfiguration {
|
|||
public static boolean shouldUseLowerCaseForAccessIds() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,5 +12,4 @@ public class ConcurrencyException extends TaskanaException {
|
|||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
|
@ -13,5 +13,4 @@ public class InvalidWorkbasketException extends TaskanaException {
|
|||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,5 +10,4 @@ public class SystemException extends TaskanaRuntimeException {
|
|||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
|
@ -28,5 +28,4 @@ public class TaskanaException extends Exception {
|
|||
public TaskanaException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,5 +29,4 @@ public class TaskanaRuntimeException extends RuntimeException {
|
|||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -18,13 +18,13 @@ public class AttachmentImpl implements Attachment {
|
|||
|
||||
private String id;
|
||||
private String taskId;
|
||||
private Timestamp created;
|
||||
private Timestamp modified;
|
||||
private Instant created;
|
||||
private Instant modified;
|
||||
private String classificationKey;
|
||||
private ClassificationSummary classificationSummary;
|
||||
private ObjectReference objectReference;
|
||||
private String channel;
|
||||
private Timestamp received;
|
||||
private Instant received;
|
||||
private Map<String, Object> customAttributes = Collections.emptyMap();
|
||||
|
||||
AttachmentImpl() {
|
||||
|
@ -49,20 +49,20 @@ public class AttachmentImpl implements Attachment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Timestamp created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getModified() {
|
||||
public Instant getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Timestamp modified) {
|
||||
public void setModified(Instant modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
|
@ -107,12 +107,12 @@ public class AttachmentImpl implements Attachment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getReceived() {
|
||||
public Instant getReceived() {
|
||||
return received;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReceived(Timestamp received) {
|
||||
public void setReceived(Instant received) {
|
||||
this.received = received;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class AttachmentImpl implements Attachment {
|
|||
builder.append(", taskId=");
|
||||
builder.append(taskId);
|
||||
builder.append(", created=");
|
||||
builder.append(created);
|
||||
builder.append(created.toString());
|
||||
builder.append(", modified=");
|
||||
builder.append(modified);
|
||||
builder.append(", classificationKey=");
|
||||
|
@ -164,5 +164,4 @@ public class AttachmentImpl implements Attachment {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
|
||||
import pro.taskana.AttachmentSummary;
|
||||
import pro.taskana.ClassificationSummary;
|
||||
|
@ -12,10 +12,10 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
|||
|
||||
private String id;
|
||||
private String taskId;
|
||||
private Timestamp created;
|
||||
private Timestamp modified;
|
||||
private Instant created;
|
||||
private Instant modified;
|
||||
private ClassificationSummary classificationSummary;
|
||||
private Timestamp received;
|
||||
private Instant received;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -48,11 +48,11 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
|||
* @see pro.taskana.impl.AttachmentSummary#getCreated()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Timestamp created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,11 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
|||
* @see pro.taskana.impl.AttachmentSummary#getModified()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getModified() {
|
||||
public Instant getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Timestamp modified) {
|
||||
public void setModified(Instant modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
|
@ -97,11 +97,11 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
|||
* @see pro.taskana.impl.AttachmentSummary#getReceived()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getReceived() {
|
||||
public Instant getReceived() {
|
||||
return received;
|
||||
}
|
||||
|
||||
public void setReceived(Timestamp received) {
|
||||
public void setReceived(Instant received) {
|
||||
this.received = received;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
|
||||
import pro.taskana.Classification;
|
||||
import pro.taskana.ClassificationSummary;
|
||||
|
@ -19,7 +18,7 @@ public class ClassificationImpl implements Classification {
|
|||
private String type;
|
||||
private String domain;
|
||||
private Boolean isValidInDomain;
|
||||
private Date created;
|
||||
private Instant created;
|
||||
private String name;
|
||||
private String description;
|
||||
private int priority;
|
||||
|
@ -33,8 +32,6 @@ public class ClassificationImpl implements Classification {
|
|||
private String custom6;
|
||||
private String custom7;
|
||||
private String custom8;
|
||||
private Date validFrom;
|
||||
private Date validUntil;
|
||||
|
||||
ClassificationImpl() {
|
||||
}
|
||||
|
@ -106,11 +103,11 @@ public class ClassificationImpl implements Classification {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Date getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
@ -249,24 +246,6 @@ public class ClassificationImpl implements Classification {
|
|||
this.custom8 = custom8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(Date validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public void setValidUntil(Date validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationSummary asSummary() {
|
||||
ClassificationSummaryImpl summary = new ClassificationSummaryImpl();
|
||||
|
@ -276,9 +255,6 @@ public class ClassificationImpl implements Classification {
|
|||
summary.setKey(this.key);
|
||||
summary.setName(this.name);
|
||||
summary.setType(this.type);
|
||||
if (this.validUntil != null) {
|
||||
summary.setValidUntil(new Timestamp(this.validUntil.getTime()));
|
||||
}
|
||||
return summary;
|
||||
}
|
||||
|
||||
|
@ -300,7 +276,7 @@ public class ClassificationImpl implements Classification {
|
|||
builder.append(", isValidInDomain=");
|
||||
builder.append(isValidInDomain);
|
||||
builder.append(", created=");
|
||||
builder.append(created);
|
||||
builder.append(created.toString());
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", description=");
|
||||
|
@ -327,10 +303,6 @@ public class ClassificationImpl implements Classification {
|
|||
builder.append(custom7);
|
||||
builder.append(", custom8=");
|
||||
builder.append(custom8);
|
||||
builder.append(", validFrom=");
|
||||
builder.append(validFrom);
|
||||
builder.append(", validUntil=");
|
||||
builder.append(validUntil);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
@ -29,15 +29,12 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
private String[] type;
|
||||
private String[] domain;
|
||||
private Boolean validInDomain;
|
||||
private Date[] created;
|
||||
private Instant[] created;
|
||||
private String[] name;
|
||||
private String description;
|
||||
private int[] priority;
|
||||
private String[] serviceLevel;
|
||||
private String[] customFields;
|
||||
private Date[] validFrom;
|
||||
private Date[] validUntil;
|
||||
|
||||
private String[] applicationEntryPoint;
|
||||
|
||||
public ClassificationQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
|
@ -81,7 +78,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery created(Date... created) {
|
||||
public ClassificationQuery created(Instant... created) {
|
||||
this.created = created;
|
||||
return this;
|
||||
}
|
||||
|
@ -122,18 +119,6 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery validFrom(Date... validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery validUntil(Date... validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClassificationSummary> list() {
|
||||
LOGGER.debug("entry to list(), this = {}", this);
|
||||
|
@ -265,11 +250,11 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
this.validInDomain = validInDomain;
|
||||
}
|
||||
|
||||
public Date[] getCreated() {
|
||||
public Instant[] getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date[] created) {
|
||||
public void setCreated(Instant[] created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
@ -289,22 +274,6 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
this.customFields = customFields;
|
||||
}
|
||||
|
||||
public Date[] getValidFrom() {
|
||||
return validFrom;
|
||||
}
|
||||
|
||||
public void setValidFrom(Date[] validFrom) {
|
||||
this.validFrom = validFrom;
|
||||
}
|
||||
|
||||
public Date[] getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public void setValidUntil(Date[] validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
@ -332,10 +301,6 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
builder.append(Arrays.toString(serviceLevel));
|
||||
builder.append(", customFields=");
|
||||
builder.append(Arrays.toString(customFields));
|
||||
builder.append(", validFrom=");
|
||||
builder.append(Arrays.toString(validFrom));
|
||||
builder.append(", validUntil=");
|
||||
builder.append(Arrays.toString(validUntil));
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -27,7 +26,6 @@ import pro.taskana.model.mappings.ClassificationMapper;
|
|||
*/
|
||||
public class ClassificationServiceImpl implements ClassificationService {
|
||||
|
||||
public static final Date CURRENT_CLASSIFICATIONS_VALID_UNTIL = Date.valueOf("9999-12-31");
|
||||
private static final String ID_PREFIX_CLASSIFICATION = "CLI";
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationServiceImpl.class);
|
||||
private ClassificationMapper classificationMapper;
|
||||
|
@ -47,7 +45,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
taskanaEngineImpl.openConnection();
|
||||
rootClassificationSumamries = this.createClassificationQuery()
|
||||
.parentClassificationKey("")
|
||||
.validUntil(CURRENT_CLASSIFICATIONS_VALID_UNTIL)
|
||||
.list();
|
||||
rootClassificationSumamries = this.populateChildClassifications(rootClassificationSumamries);
|
||||
return rootClassificationSumamries;
|
||||
|
@ -75,7 +72,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
for (ClassificationSummary classification : classificationSumamries) {
|
||||
List<ClassificationSummary> childClassifications = this.createClassificationQuery()
|
||||
.parentClassificationKey(classification.getKey())
|
||||
.validUntil(CURRENT_CLASSIFICATIONS_VALID_UNTIL)
|
||||
.list();
|
||||
children.addAll(populateChildClassifications(childClassifications));
|
||||
}
|
||||
|
@ -154,24 +150,21 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
classificationImpl = (ClassificationImpl) classification;
|
||||
this.initDefaultClassificationValues(classificationImpl);
|
||||
|
||||
ClassificationImpl oldClassification = null;
|
||||
// UPDATE/INSERT classification
|
||||
try {
|
||||
oldClassification = (ClassificationImpl) this.getClassification(classificationImpl.getKey(),
|
||||
classificationImpl.getDomain());
|
||||
LOGGER.debug("Method updateClassification() inserted classification {}.", classificationImpl);
|
||||
// ! If you update an classification twice the same day,
|
||||
// the older version is valid from today until yesterday.
|
||||
if (!oldClassification.getDomain().equals(classificationImpl.getDomain())) {
|
||||
addClassificationToDomain(classificationImpl);
|
||||
} else {
|
||||
updateExistingClassification(oldClassification, classificationImpl);
|
||||
}
|
||||
this.getClassification(classificationImpl.getKey(), classificationImpl.getDomain());
|
||||
classificationMapper.update(classificationImpl);
|
||||
LOGGER.debug("Method updateClassification() updated the classification {}.",
|
||||
classificationImpl);
|
||||
} catch (ClassificationNotFoundException e) {
|
||||
classificationImpl.setId(IdGenerator.generateWithPrefix(ID_PREFIX_CLASSIFICATION)); // TODO
|
||||
classificationImpl.setCreated(Date.valueOf(LocalDate.now()));
|
||||
classificationImpl.setCreated(Instant.now());
|
||||
classificationMapper.insert(classificationImpl);
|
||||
LOGGER.debug("Method updateClassification() inserted classification {}.", classificationImpl);
|
||||
LOGGER.debug(
|
||||
"Method updateClassification() inserted a unpersisted classification which was wanted to be updated {}.",
|
||||
classificationImpl);
|
||||
}
|
||||
|
||||
// CHECK if classification does exist now
|
||||
try {
|
||||
Classification updatedClassification = this.getClassification(classificationImpl.getKey(),
|
||||
classificationImpl.getDomain());
|
||||
|
@ -194,13 +187,12 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
* @param classification
|
||||
*/
|
||||
private void initDefaultClassificationValues(ClassificationImpl classification) throws IllegalStateException {
|
||||
classification.setId(IdGenerator.generateWithPrefix(ID_PREFIX_CLASSIFICATION));
|
||||
|
||||
classification.setValidFrom(Date.valueOf(LocalDate.now()));
|
||||
classification.setValidUntil(CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
if (classification.getId() == null) {
|
||||
classification.setId(IdGenerator.generateWithPrefix(ID_PREFIX_CLASSIFICATION));
|
||||
}
|
||||
|
||||
if (classification.getCreated() == null) {
|
||||
classification.setCreated(Date.valueOf(LocalDate.now()));
|
||||
classification.setCreated(Instant.now());
|
||||
}
|
||||
|
||||
if (classification.getIsValidInDomain() == null) {
|
||||
|
@ -228,33 +220,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new Classification if this Classification Key is not yet specified for this domain.
|
||||
*
|
||||
* @param classification
|
||||
*/
|
||||
private void addClassificationToDomain(ClassificationImpl classification) {
|
||||
classification.setCreated(Date.valueOf(LocalDate.now()));
|
||||
classificationMapper.insert(classification);
|
||||
LOGGER.debug("Method updateClassification() inserted classification {}.", classification);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the validUntil-Date of the oldClassification to yesterday and inserts the new Classification.
|
||||
*
|
||||
* @param oldClassification
|
||||
* @param newClassification
|
||||
*/
|
||||
private Classification updateExistingClassification(ClassificationImpl oldClassification,
|
||||
ClassificationImpl newClassification) {
|
||||
oldClassification.setValidUntil(Date.valueOf(LocalDate.now().minusDays(1)));
|
||||
classificationMapper.update(oldClassification);
|
||||
classificationMapper.insert(newClassification);
|
||||
LOGGER.debug("Method updateClassification() updated old classification {} and inserted new {}.",
|
||||
oldClassification, newClassification);
|
||||
return newClassification;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClassificationSummary> getAllClassifications(String key, String domain) {
|
||||
LOGGER.debug("entry to getAllClassificationsWithKey(key = {}, domain = {})", key, domain);
|
||||
|
@ -285,9 +250,9 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
Classification result = null;
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
result = classificationMapper.findByKeyAndDomain(key, domain, CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
result = classificationMapper.findByKeyAndDomain(key, domain);
|
||||
if (result == null) {
|
||||
result = classificationMapper.findByKeyAndDomain(key, "", CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
result = classificationMapper.findByKeyAndDomain(key, "");
|
||||
if (result == null) {
|
||||
throw new ClassificationNotFoundException("Classification for key " + key + " was not found");
|
||||
}
|
||||
|
@ -316,7 +281,7 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
private boolean doesClassificationExist(String key, String domain) {
|
||||
boolean isExisting = false;
|
||||
try {
|
||||
if (classificationMapper.findByKeyAndDomain(key, domain, CURRENT_CLASSIFICATIONS_VALID_UNTIL) != null) {
|
||||
if (classificationMapper.findByKeyAndDomain(key, domain) != null) {
|
||||
isExisting = true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
@ -326,5 +291,4 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
return isExisting;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import pro.taskana.ClassificationSummary;
|
||||
|
||||
/**
|
||||
|
@ -15,7 +13,6 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
private String type;
|
||||
private String domain;
|
||||
private String name;
|
||||
private Timestamp validUntil;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
|
@ -71,15 +68,6 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getValidUntil() {
|
||||
return validUntil;
|
||||
}
|
||||
|
||||
public void setValidUntil(Timestamp validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
@ -90,7 +78,6 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
result = prime * result + ((key == null) ? 0 : key.hashCode());
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
result = prime * result + ((type == null) ? 0 : type.hashCode());
|
||||
result = prime * result + ((validUntil == null) ? 0 : validUntil.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -148,13 +135,6 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
} else if (!type.equals(other.type)) {
|
||||
return false;
|
||||
}
|
||||
if (validUntil == null) {
|
||||
if (other.validUntil != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!validUntil.equals(other.validUntil)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -173,8 +153,6 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
builder.append(domain);
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", validUntil=");
|
||||
builder.append(validUntil);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -21,12 +21,12 @@ import pro.taskana.model.TaskState;
|
|||
public class TaskImpl implements Task {
|
||||
|
||||
private String id;
|
||||
private Timestamp created;
|
||||
private Timestamp claimed;
|
||||
private Timestamp completed;
|
||||
private Timestamp modified;
|
||||
private Timestamp planned;
|
||||
private Timestamp due;
|
||||
private Instant created;
|
||||
private Instant claimed;
|
||||
private Instant completed;
|
||||
private Instant modified;
|
||||
private Instant planned;
|
||||
private Instant due;
|
||||
private String name;
|
||||
private String description;
|
||||
private String note;
|
||||
|
@ -70,57 +70,57 @@ public class TaskImpl implements Task {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Timestamp created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getClaimed() {
|
||||
public Instant getClaimed() {
|
||||
return claimed;
|
||||
}
|
||||
|
||||
public void setClaimed(Timestamp claimed) {
|
||||
public void setClaimed(Instant claimed) {
|
||||
this.claimed = claimed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getCompleted() {
|
||||
public Instant getCompleted() {
|
||||
return completed;
|
||||
}
|
||||
|
||||
public void setCompleted(Timestamp completed) {
|
||||
public void setCompleted(Instant completed) {
|
||||
this.completed = completed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getModified() {
|
||||
public Instant getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Timestamp modified) {
|
||||
public void setModified(Instant modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getPlanned() {
|
||||
public Instant getPlanned() {
|
||||
return planned;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlanned(Timestamp planned) {
|
||||
public void setPlanned(Instant planned) {
|
||||
this.planned = planned;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getDue() {
|
||||
public Instant getDue() {
|
||||
return due;
|
||||
}
|
||||
|
||||
public void setDue(Timestamp due) {
|
||||
public void setDue(Instant due) {
|
||||
this.due = due;
|
||||
}
|
||||
|
||||
|
@ -449,17 +449,17 @@ public class TaskImpl implements Task {
|
|||
builder.append("TaskImpl [id=");
|
||||
builder.append(id);
|
||||
builder.append(", created=");
|
||||
builder.append(created);
|
||||
builder.append(created.toString());
|
||||
builder.append(", claimed=");
|
||||
builder.append(claimed);
|
||||
builder.append(claimed.toString());
|
||||
builder.append(", completed=");
|
||||
builder.append(completed);
|
||||
builder.append(completed.toString());
|
||||
builder.append(", modified=");
|
||||
builder.append(modified);
|
||||
builder.append(modified.toString());
|
||||
builder.append(", planned=");
|
||||
builder.append(planned);
|
||||
builder.append(planned.toString());
|
||||
builder.append(", due=");
|
||||
builder.append(due);
|
||||
builder.append(due.toString());
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", description=");
|
||||
|
@ -519,5 +519,4 @@ public class TaskImpl implements Task {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
@ -64,9 +64,7 @@ public class TaskMonitorServiceImpl implements TaskMonitorService {
|
|||
long result = -1;
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
LocalDate time = LocalDate.now();
|
||||
time = time.minusDays(daysInPast);
|
||||
Date fromDate = Date.valueOf(time);
|
||||
Instant fromDate = Instant.now().minus(Duration.ofDays(daysInPast));
|
||||
result = taskMonitorMapper.getTaskCountForWorkbasketByDaysInPastAndState(workbasketId, fromDate, states);
|
||||
return result;
|
||||
} finally {
|
||||
|
@ -85,9 +83,7 @@ public class TaskMonitorServiceImpl implements TaskMonitorService {
|
|||
List<DueWorkbasketCounter> result = null;
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
LocalDate time = LocalDate.now();
|
||||
time = time.minusDays(daysInPast);
|
||||
Date fromDate = Date.valueOf(time);
|
||||
Instant fromDate = Instant.now().minus(Duration.ofDays(daysInPast));
|
||||
result = taskMonitorMapper.getTaskCountByWorkbasketIdAndDaysInPastAndState(fromDate, states);
|
||||
return result;
|
||||
} finally {
|
||||
|
@ -127,5 +123,4 @@ public class TaskMonitorServiceImpl implements TaskMonitorService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -367,6 +367,8 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
builder.append(Arrays.toString(name));
|
||||
builder.append(", description=");
|
||||
builder.append(description);
|
||||
builder.append(", note=");
|
||||
builder.append(note);
|
||||
builder.append(", priority=");
|
||||
builder.append(Arrays.toString(priority));
|
||||
builder.append(", states=");
|
||||
|
@ -406,5 +408,4 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -98,7 +97,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
taskId, task.getOwner());
|
||||
throw new InvalidOwnerException("Task is already claimed by user " + task.getOwner());
|
||||
}
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
Instant now = Instant.now();
|
||||
task.setOwner(userId);
|
||||
task.setModified(now);
|
||||
task.setClaimed(now);
|
||||
|
@ -148,7 +147,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
task = (TaskImpl) this.claim(taskId, true);
|
||||
}
|
||||
}
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
Instant now = Instant.now();
|
||||
task.setCompleted(now);
|
||||
task.setModified(now);
|
||||
task.setState(TaskState.COMPLETED);
|
||||
|
@ -258,7 +257,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
task.setWorkbasketKey(destinationWorkbasketKey);
|
||||
task.setWorkbasketSummary(destinationWorkbasket.asSummary());
|
||||
task.setDomain(destinationWorkbasket.getDomain());
|
||||
task.setModified(Timestamp.valueOf(LocalDateTime.now()));
|
||||
task.setModified(Instant.now());
|
||||
taskMapper.update(task);
|
||||
|
||||
result = getTask(taskId);
|
||||
|
@ -280,7 +279,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
taskanaEngineImpl.openConnection();
|
||||
TaskImpl task = (TaskImpl) getTask(taskId);
|
||||
task.setRead(true);
|
||||
task.setModified(Timestamp.valueOf(LocalDateTime.now()));
|
||||
task.setModified(Instant.now());
|
||||
taskMapper.update(task);
|
||||
result = getTask(taskId);
|
||||
LOGGER.debug("Method setTaskRead() set read property of Task '{}' to {} ", result, isRead);
|
||||
|
@ -345,7 +344,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
}
|
||||
|
||||
private void standardSettings(TaskImpl task, Classification classification) {
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
Instant now = Instant.now();
|
||||
task.setId(IdGenerator.generateWithPrefix(ID_PREFIX_TASK));
|
||||
task.setState(TaskState.READY);
|
||||
task.setCreated(now);
|
||||
|
@ -367,8 +366,8 @@ public class TaskServiceImpl implements TaskService {
|
|||
if (classification != null) {
|
||||
if (classification.getServiceLevel() != null) {
|
||||
Duration serviceLevel = Duration.parse(classification.getServiceLevel());
|
||||
LocalDateTime due = task.getPlanned().toLocalDateTime().plus(serviceLevel);
|
||||
task.setDue(Timestamp.valueOf(due));
|
||||
Instant due = task.getPlanned().plus(serviceLevel);
|
||||
task.setDue(due);
|
||||
}
|
||||
|
||||
if (task.getName() == null) {
|
||||
|
@ -733,8 +732,8 @@ public class TaskServiceImpl implements TaskService {
|
|||
if (newClassification != null) {
|
||||
if (newClassification.getServiceLevel() != null) {
|
||||
Duration serviceLevel = Duration.parse(newClassification.getServiceLevel());
|
||||
LocalDateTime due = newTaskImpl.getPlanned().toLocalDateTime().plus(serviceLevel);
|
||||
newTaskImpl.setDue(Timestamp.valueOf(due));
|
||||
Instant due = newTaskImpl.getPlanned().plus(serviceLevel);
|
||||
newTaskImpl.setDue(due);
|
||||
}
|
||||
|
||||
if (newTaskImpl.getName() == null) {
|
||||
|
@ -749,9 +748,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
newTaskImpl.setPriority(newClassification.getPriority());
|
||||
}
|
||||
}
|
||||
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
newTaskImpl.setModified(now);
|
||||
newTaskImpl.setModified(Instant.now());
|
||||
}
|
||||
|
||||
AttachmentMapper getAttachmentMapper() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -17,12 +17,12 @@ import pro.taskana.model.TaskState;
|
|||
public class TaskSummaryImpl implements TaskSummary {
|
||||
|
||||
private String taskId;
|
||||
private Timestamp created;
|
||||
private Timestamp claimed;
|
||||
private Timestamp completed;
|
||||
private Timestamp modified;
|
||||
private Timestamp planned;
|
||||
private Timestamp due;
|
||||
private Instant created;
|
||||
private Instant claimed;
|
||||
private Instant completed;
|
||||
private Instant modified;
|
||||
private Instant planned;
|
||||
private Instant due;
|
||||
private String name;
|
||||
private String note;
|
||||
private int priority;
|
||||
|
@ -67,11 +67,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getCreated()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Timestamp created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
|
@ -80,11 +80,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getClaimed()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getClaimed() {
|
||||
public Instant getClaimed() {
|
||||
return claimed;
|
||||
}
|
||||
|
||||
public void setClaimed(Timestamp claimed) {
|
||||
public void setClaimed(Instant claimed) {
|
||||
this.claimed = claimed;
|
||||
}
|
||||
|
||||
|
@ -93,11 +93,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getCompleted()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getCompleted() {
|
||||
public Instant getCompleted() {
|
||||
return completed;
|
||||
}
|
||||
|
||||
public void setCompleted(Timestamp completed) {
|
||||
public void setCompleted(Instant completed) {
|
||||
this.completed = completed;
|
||||
}
|
||||
|
||||
|
@ -106,11 +106,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getModified()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getModified() {
|
||||
public Instant getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
public void setModified(Timestamp modified) {
|
||||
public void setModified(Instant modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
|
@ -119,11 +119,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getPlanned()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getPlanned() {
|
||||
public Instant getPlanned() {
|
||||
return planned;
|
||||
}
|
||||
|
||||
public void setPlanned(Timestamp planned) {
|
||||
public void setPlanned(Instant planned) {
|
||||
this.planned = planned;
|
||||
}
|
||||
|
||||
|
@ -132,11 +132,11 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
* @see pro.taskana.impl.TaskSummary#getDue()
|
||||
*/
|
||||
@Override
|
||||
public Timestamp getDue() {
|
||||
public Instant getDue() {
|
||||
return due;
|
||||
}
|
||||
|
||||
public void setDue(Timestamp due) {
|
||||
public void setDue(Instant due) {
|
||||
this.due = due;
|
||||
}
|
||||
|
||||
|
@ -796,5 +796,4 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,21 +39,13 @@ import pro.taskana.model.mappings.WorkbasketMapper;
|
|||
public class TaskanaEngineImpl implements TaskanaEngine {
|
||||
|
||||
private static final String DEFAULT = "default";
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineImpl.class);
|
||||
|
||||
protected static ThreadLocal<Stack<SqlSessionManager>> sessionStack = new ThreadLocal<Stack<SqlSessionManager>>();
|
||||
|
||||
protected TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||
|
||||
protected TransactionFactory transactionFactory;
|
||||
|
||||
protected SqlSessionManager sessionManager;
|
||||
|
||||
protected SqlSessionFactory sessionFactory;
|
||||
|
||||
protected ConnectionManagementMode mode = ConnectionManagementMode.PARTICIPATE;
|
||||
|
||||
protected java.sql.Connection connection = null;
|
||||
|
||||
public TaskanaEngineImpl(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -15,8 +15,8 @@ public class WorkbasketImpl implements Workbasket {
|
|||
|
||||
private String id;
|
||||
private String key;
|
||||
private Timestamp created;
|
||||
private Timestamp modified;
|
||||
private Instant created;
|
||||
private Instant modified;
|
||||
private String name;
|
||||
private String description;
|
||||
private String owner;
|
||||
|
@ -55,21 +55,21 @@ public class WorkbasketImpl implements Workbasket {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getCreated() {
|
||||
public Instant getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Timestamp created) {
|
||||
public void setCreated(Instant created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timestamp getModified() {
|
||||
public Instant getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModified(Timestamp modified) {
|
||||
public void setModified(Instant modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
|
@ -237,9 +237,9 @@ public class WorkbasketImpl implements Workbasket {
|
|||
builder.append(", key=");
|
||||
builder.append(key);
|
||||
builder.append(", created=");
|
||||
builder.append(created);
|
||||
builder.append(created.toString());
|
||||
builder.append(", modified=");
|
||||
builder.append(modified);
|
||||
builder.append(modified.toString());
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", description=");
|
||||
|
@ -271,5 +271,4 @@ public class WorkbasketImpl implements Workbasket {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
@ -34,10 +34,10 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
private String[] key;
|
||||
private String[] domain;
|
||||
private WorkbasketType[] type;
|
||||
private Date createdAfter;
|
||||
private Date createdBefore;
|
||||
private Date modifiedAfter;
|
||||
private Date modifiedBefore;
|
||||
private Instant createdAfter;
|
||||
private Instant createdBefore;
|
||||
private Instant modifiedAfter;
|
||||
private Instant modifiedBefore;
|
||||
private String description;
|
||||
private String[] owner;
|
||||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
|
@ -71,25 +71,25 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public WorkbasketQuery createdAfter(Date createdAfter) {
|
||||
public WorkbasketQuery createdAfter(Instant createdAfter) {
|
||||
this.createdAfter = createdAfter;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkbasketQuery createdBefore(Date createdBefore) {
|
||||
public WorkbasketQuery createdBefore(Instant createdBefore) {
|
||||
this.createdBefore = createdBefore;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkbasketQuery modifiedAfter(Date modifiedAfter) {
|
||||
public WorkbasketQuery modifiedAfter(Instant modifiedAfter) {
|
||||
this.modifiedAfter = modifiedAfter;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkbasketQuery modifiedBefore(Date modifiedBefore) {
|
||||
public WorkbasketQuery modifiedBefore(Instant modifiedBefore) {
|
||||
this.modifiedBefore = modifiedBefore;
|
||||
return this;
|
||||
}
|
||||
|
@ -223,19 +223,19 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
return type;
|
||||
}
|
||||
|
||||
public Date getCreatedAfter() {
|
||||
public Instant getCreatedAfter() {
|
||||
return createdAfter;
|
||||
}
|
||||
|
||||
public Date getCreatedBefore() {
|
||||
public Instant getCreatedBefore() {
|
||||
return createdBefore;
|
||||
}
|
||||
|
||||
public Date getModifiedAfter() {
|
||||
public Instant getModifiedAfter() {
|
||||
return modifiedAfter;
|
||||
}
|
||||
|
||||
public Date getModifiedBefore() {
|
||||
public Instant getModifiedBefore() {
|
||||
return modifiedBefore;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -151,7 +151,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
|||
WorkbasketImpl workbasket = (WorkbasketImpl) newWorkbasket;
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
Instant now = Instant.now();
|
||||
workbasket.setCreated(now);
|
||||
workbasket.setModified(now);
|
||||
if (workbasket.getId() == null || workbasket.getId().isEmpty()) {
|
||||
|
@ -187,7 +187,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
|||
WorkbasketImpl workbasket = (WorkbasketImpl) workbasketToUpdate;
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
workbasket.setModified(new Timestamp(System.currentTimeMillis()));
|
||||
workbasket.setModified(Instant.now());
|
||||
workbasketMapper.update(workbasket);
|
||||
LOGGER.debug("Method updateWorkbasket() updated workbasket '{}'", workbasket.getId());
|
||||
List<String> oldDistributionTargets = distributionTargetMapper.findBySourceId(workbasket.getId());
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
/**
|
||||
* This Typehandler will transfer a Map into an xml blob and back.
|
||||
*
|
||||
* @author EH
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
|
|
@ -25,5 +25,4 @@ public final class IdGenerator {
|
|||
|
||||
private IdGenerator() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,8 @@ public final class LoggerUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* make a String for logging from a list of objects.
|
||||
* Creating an appended log-string of a list with generic type T. The logging does append informations using
|
||||
* toString() on the entries.
|
||||
*
|
||||
* @param list
|
||||
* the input list to be stringified
|
||||
|
@ -40,7 +41,8 @@ public final class LoggerUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* make a String for logging from a map.
|
||||
* Creating an appended log-string of a map with generic types K/V. The logging does append informations using
|
||||
* toString() on the entries.
|
||||
*
|
||||
* @param map
|
||||
* the map to be stringified
|
||||
|
@ -68,6 +70,5 @@ public final class LoggerUtils {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package pro.taskana.model;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* DueWorkbasketCounter entity.
|
||||
*/
|
||||
public class DueWorkbasketCounter {
|
||||
|
||||
private Date due;
|
||||
private Instant due;
|
||||
private String workbasketId;
|
||||
private long taskCounter;
|
||||
|
||||
public Date getDue() {
|
||||
public Instant getDue() {
|
||||
return due;
|
||||
}
|
||||
|
||||
public void setDue(Date due) {
|
||||
public void setDue(Instant due) {
|
||||
this.due = due;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,5 +31,4 @@ public class Report {
|
|||
public void setSumLine(ReportLine sumLine) {
|
||||
this.sumLine = sumLine;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,5 +40,4 @@ public class ReportLine {
|
|||
public void setTotalCount(int totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,5 +24,4 @@ public class ReportLineItem {
|
|||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,5 +24,4 @@ public class ReportLineItemDefinition {
|
|||
public void setUpperLimit(int upperLimit) {
|
||||
this.upperLimit = upperLimit;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -194,5 +194,4 @@ public class WorkbasketAccessItem {
|
|||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
package pro.taskana.model;
|
||||
|
||||
/**
|
||||
* This entity contains the most important information about a workbasket.
|
||||
*
|
||||
* @author bbr
|
||||
*/
|
||||
public class WorkbasketSummary {
|
||||
|
||||
private String id;
|
||||
private String key;
|
||||
private String name;
|
||||
private String description;
|
||||
private String owner;
|
||||
private String domain;
|
||||
private WorkbasketType type;
|
||||
private String orgLevel1;
|
||||
private String orgLevel2;
|
||||
private String orgLevel3;
|
||||
private String orgLevel4;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public WorkbasketType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(WorkbasketType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getOrgLevel1() {
|
||||
return orgLevel1;
|
||||
}
|
||||
|
||||
public void setOrgLevel1(String orgLevel1) {
|
||||
this.orgLevel1 = orgLevel1;
|
||||
}
|
||||
|
||||
public String getOrgLevel2() {
|
||||
return orgLevel2;
|
||||
}
|
||||
|
||||
public void setOrgLevel2(String orgLevel2) {
|
||||
this.orgLevel2 = orgLevel2;
|
||||
}
|
||||
|
||||
public String getOrgLevel3() {
|
||||
return orgLevel3;
|
||||
}
|
||||
|
||||
public void setOrgLevel3(String orgLevel3) {
|
||||
this.orgLevel3 = orgLevel3;
|
||||
}
|
||||
|
||||
public String getOrgLevel4() {
|
||||
return orgLevel4;
|
||||
}
|
||||
|
||||
public void setOrgLevel4(String orgLevel4) {
|
||||
this.orgLevel4 = orgLevel4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("WorkbasketSummary [id=");
|
||||
builder.append(id);
|
||||
builder.append(", key=");
|
||||
builder.append(key);
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", description=");
|
||||
builder.append(description);
|
||||
builder.append(", owner=");
|
||||
builder.append(owner);
|
||||
builder.append(", domain=");
|
||||
builder.append(domain);
|
||||
builder.append(", type=");
|
||||
builder.append(type);
|
||||
builder.append(", orgLevel1=");
|
||||
builder.append(orgLevel1);
|
||||
builder.append(", orgLevel2=");
|
||||
builder.append(orgLevel2);
|
||||
builder.append(", orgLevel3=");
|
||||
builder.append(orgLevel3);
|
||||
builder.append(", orgLevel4=");
|
||||
builder.append(orgLevel4);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package pro.taskana.model.mappings;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
|
@ -18,13 +17,10 @@ import pro.taskana.impl.ClassificationSummaryImpl;
|
|||
*/
|
||||
public interface ClassificationMapper {
|
||||
|
||||
String VALID_UNTIL_MAX = "9999-12-31";
|
||||
|
||||
@Select("SELECT ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, VALID_FROM, VALID_UNTIL "
|
||||
@Select("SELECT ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
|
||||
+ "FROM CLASSIFICATION "
|
||||
+ "WHERE KEY = #{key}"
|
||||
+ "AND DOMAIN = #{domain}"
|
||||
+ "AND VALID_UNTIL = #{valid_until}")
|
||||
+ "AND DOMAIN = #{domain}")
|
||||
@Results({ @Result(property = "id", column = "ID"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "parentClassificationKey", column = "PARENT_CLASSIFICATION_KEY"),
|
||||
|
@ -45,42 +41,37 @@ public interface ClassificationMapper {
|
|||
@Result(property = "custom5", column = "CUSTOM_5"),
|
||||
@Result(property = "custom6", column = "CUSTOM_6"),
|
||||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "validFrom", column = "VALID_FROM"),
|
||||
@Result(property = "validUntil", column = "VALID_UNTIL") })
|
||||
ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain,
|
||||
@Param("valid_until") Date validUntil);
|
||||
@Result(property = "custom8", column = "CUSTOM_8") })
|
||||
ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain);
|
||||
|
||||
@Insert("INSERT INTO CLASSIFICATION (ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, VALID_FROM, VALID_UNTIL) VALUES (#{classification.id}, #{classification.key}, #{classification.parentClassificationKey}, #{classification.category}, #{classification.type}, #{classification.domain}, #{classification.isValidInDomain}, #{classification.created}, #{classification.name}, #{classification.description}, #{classification.priority}, #{classification.serviceLevel}, #{classification.applicationEntryPoint}, #{classification.custom1}, #{classification.custom2}, #{classification.custom3}, #{classification.custom4}, #{classification.custom5}, #{classification.custom6}, #{classification.custom7}, #{classification.custom8}, #{classification.validFrom}, #{classification.validUntil})")
|
||||
@Insert("INSERT INTO CLASSIFICATION (ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8) VALUES (#{classification.id}, #{classification.key}, #{classification.parentClassificationKey}, #{classification.category}, #{classification.type}, #{classification.domain}, #{classification.isValidInDomain}, #{classification.created}, #{classification.name}, #{classification.description}, #{classification.priority}, #{classification.serviceLevel}, #{classification.applicationEntryPoint}, #{classification.custom1}, #{classification.custom2}, #{classification.custom3}, #{classification.custom4}, #{classification.custom5}, #{classification.custom6}, #{classification.custom7}, #{classification.custom8})")
|
||||
void insert(@Param("classification") ClassificationImpl classification);
|
||||
|
||||
@Update(
|
||||
value = "UPDATE CLASSIFICATION SET KEY = #{classification.key}, PARENT_CLASSIFICATION_KEY = #{classification.parentClassificationKey}, CATEGORY = #{classification.category}, TYPE = #{classification.type}, NAME = #{classification.name}, DESCRIPTION = #{classification.description}, PRIORITY = #{classification.priority}, SERVICE_LEVEL = #{classification.serviceLevel}, DOMAIN = #{classification.domain}, VALID_IN_DOMAIN = #{classification.isValidInDomain}, APPLICATION_ENTRY_POINT = #{classification.applicationEntryPoint}, CUSTOM_1 = #{classification.custom1}, CUSTOM_2 = #{classification.custom2}, CUSTOM_3 = #{classification.custom3}, CUSTOM_4 = #{classification.custom4}, CUSTOM_5 = #{classification.custom5}, CUSTOM_6 = #{classification.custom6}, CUSTOM_7 = #{classification.custom7}, CUSTOM_8 = #{classification.custom8}, VALID_FROM = #{classification.validFrom}, VALID_UNTIL = #{classification.validUntil} WHERE ID = #{classification.id}")
|
||||
value = "UPDATE CLASSIFICATION SET KEY = #{classification.key}, PARENT_CLASSIFICATION_KEY = #{classification.parentClassificationKey}, CATEGORY = #{classification.category}, TYPE = #{classification.type}, NAME = #{classification.name}, DESCRIPTION = #{classification.description}, PRIORITY = #{classification.priority}, SERVICE_LEVEL = #{classification.serviceLevel}, DOMAIN = #{classification.domain}, VALID_IN_DOMAIN = #{classification.isValidInDomain}, APPLICATION_ENTRY_POINT = #{classification.applicationEntryPoint}, CUSTOM_1 = #{classification.custom1}, CUSTOM_2 = #{classification.custom2}, CUSTOM_3 = #{classification.custom3}, CUSTOM_4 = #{classification.custom4}, CUSTOM_5 = #{classification.custom5}, CUSTOM_6 = #{classification.custom6}, CUSTOM_7 = #{classification.custom7}, CUSTOM_8 = #{classification.custom8} WHERE ID = #{classification.id}")
|
||||
void update(@Param("classification") ClassificationImpl classification);
|
||||
|
||||
@Select("<script>"
|
||||
+ "SELECT ID, KEY, CATEGORY, TYPE, DOMAIN, NAME, VALID_UNTIL "
|
||||
+ "SELECT ID, KEY, CATEGORY, TYPE, DOMAIN, NAME "
|
||||
+ "FROM CLASSIFICATION "
|
||||
+ "WHERE KEY = #{key} "
|
||||
+ "AND DOMAIN = #{domain}"
|
||||
+ "ORDER BY VALID_FROM DESC"
|
||||
+ "ORDER BY KEY DESC"
|
||||
+ "</script>")
|
||||
@Results({ @Result(property = "id", column = "ID"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "category", column = "CATEGORY"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "domain", column = "DOMAIN"),
|
||||
@Result(property = "name", column = "NAME"),
|
||||
@Result(property = "validUntil", column = "VALID_UNTIL") })
|
||||
@Result(property = "name", column = "NAME") })
|
||||
List<ClassificationSummaryImpl> getAllClassificationsWithKey(@Param("key") String key,
|
||||
@Param("domain") String domain);
|
||||
|
||||
@Select("SELECT C.ID, C.KEY, C.PARENT_CLASSIFICATION_KEY, C.CATEGORY, C.TYPE, C.DOMAIN, C.VALID_IN_DOMAIN, C.CREATED, C.NAME, C.DESCRIPTION, C.PRIORITY, C.SERVICE_LEVEL, C.APPLICATION_ENTRY_POINT, "
|
||||
+ "C.CUSTOM_1, C.CUSTOM_2, C.CUSTOM_3, C.CUSTOM_4, C.CUSTOM_5, C.CUSTOM_6, C.CUSTOM_7, C.CUSTOM_8, C.VALID_FROM, C.VALID_UNTIL "
|
||||
+ "C.CUSTOM_1, C.CUSTOM_2, C.CUSTOM_3, C.CUSTOM_4, C.CUSTOM_5, C.CUSTOM_6, C.CUSTOM_7, C.CUSTOM_8 "
|
||||
+ "FROM CLASSIFICATION AS C LEFT JOIN WORKBASKET AS W ON C.DOMAIN = W.DOMAIN "
|
||||
+ "WHERE c.KEY = #{classificationKey}"
|
||||
+ "AND W.KEY = #{workbasketKey}"
|
||||
+ "AND VALID_UNTIL = #{valid_until}")
|
||||
+ "AND W.KEY = #{workbasketKey}")
|
||||
@Results({ @Result(property = "id", column = "ID"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "parentClassificationKey", column = "PARENT_CLASSIFICATION_KEY"),
|
||||
|
@ -101,10 +92,7 @@ public interface ClassificationMapper {
|
|||
@Result(property = "custom5", column = "CUSTOM_5"),
|
||||
@Result(property = "custom6", column = "CUSTOM_6"),
|
||||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "validFrom", column = "VALID_FROM"),
|
||||
@Result(property = "validUntil", column = "VALID_UNTIL") })
|
||||
@Result(property = "custom8", column = "CUSTOM_8") })
|
||||
ClassificationImpl findByTask(@Param("classificationKey") String classificationKey,
|
||||
@Param("workbasketKey") String workbasketKey,
|
||||
@Param("valid_until") Date validUntil);
|
||||
@Param("workbasketKey") String workbasketKey);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public interface QueryMapper {
|
|||
+ "<if test='customFields != null'>AND (t.CUSTOM_1 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_2 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_3 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_4 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_5 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_6 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_7 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_8 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_9 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR t.CUSTOM_10 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>))</if> "
|
||||
+ "</where>"
|
||||
+ "</script>")
|
||||
@Results(value = {@Result(property = "taskId", column = "ID"),
|
||||
@Results(value = { @Result(property = "taskId", column = "ID"),
|
||||
@Result(property = "created", column = "CREATED"),
|
||||
@Result(property = "claimed", column = "CLAIMED"),
|
||||
@Result(property = "completed", column = "COMPLETED"),
|
||||
|
@ -86,10 +86,10 @@ public interface QueryMapper {
|
|||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "custom9", column = "CUSTOM_9"),
|
||||
@Result(property = "custom10", column = "CUSTOM_10")})
|
||||
@Result(property = "custom10", column = "CUSTOM_10") })
|
||||
List<TaskSummaryImpl> queryTasks(TaskQueryImpl taskQuery);
|
||||
|
||||
@Select("<script>SELECT ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, VALID_FROM, VALID_UNTIL "
|
||||
@Select("<script>SELECT ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8 "
|
||||
+ "FROM CLASSIFICATION "
|
||||
+ "<where>"
|
||||
+ "<if test='key != null'>AND KEY IN(<foreach item='item' collection='key' separator=',' >#{item}</foreach>)</if> "
|
||||
|
@ -98,24 +98,21 @@ public interface QueryMapper {
|
|||
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='domain != null'>AND DOMAIN IN(<foreach item='item' collection='domain' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='validInDomain != null'>AND VALID_IN_DOMAIN = #{validInDomain}</if> "
|
||||
+ "<if test='created != null'>AND CREATED IN(<foreach item='item' collection='created' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='created != null'>AND CREATED IN(<foreach item='item' collection='created' separator=',' >SUBSTRING(#{item}, 1, 10)</foreach>)</if> "
|
||||
+ "<if test='name != null'>AND NAME IN(<foreach item='item' collection='name' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='description != null'>AND DESCRIPTION like #{description}</if> "
|
||||
+ "<if test='priority != null'>AND PRIORITY IN(<foreach item='item' collection='priority' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='serviceLevel != null'>AND SERVICE_LEVEL IN(<foreach item='item' collection='serviceLevel' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='applicationEntryPoint != null'>AND APPLICATION_ENTRY_POINT IN(<foreach item='item' collection='applicationEntryPoint' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='customFields != null'>AND (CUSTOM_1 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_2 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_3 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_4 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_5 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_6 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_7 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>) OR CUSTOM_8 IN(<foreach item='item' collection='customFields' separator=',' >#{item}</foreach>))</if> "
|
||||
+ "<if test='validFrom != null'>AND VALID_FROM IN(<foreach item='item' collection='validFrom' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "<if test='validUntil != null'>AND VALID_UNTIL IN(<foreach item='item' collection='validUntil' separator=',' >#{item}</foreach>)</if> "
|
||||
+ "</where>"
|
||||
+ "</script>")
|
||||
@Results({@Result(property = "id", column = "ID"),
|
||||
@Results({ @Result(property = "id", column = "ID"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "category", column = "CATEGORY"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "domain", column = "DOMAIN"),
|
||||
@Result(property = "name", column = "NAME"),
|
||||
@Result(property = "validUntil", column = "VALID_UNTIL")})
|
||||
@Result(property = "name", column = "NAME") })
|
||||
List<ClassificationSummaryImpl> queryClassification(ClassificationQueryImpl classificationQuery);
|
||||
|
||||
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
|
||||
|
@ -134,7 +131,7 @@ public interface QueryMapper {
|
|||
@Result(property = "system", column = "SYSTEM"),
|
||||
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "value", column = "VALUE")})
|
||||
@Result(property = "value", column = "VALUE") })
|
||||
List<ObjectReference> queryObjectReference(ObjectReferenceQueryImpl objectReference);
|
||||
|
||||
@Select("<script>SELECT w.ID, w.KEY, w.NAME, w.DOMAIN, W.TYPE, w.DESCRIPTION, w.OWNER, w.ORG_LEVEL_1, w.ORG_LEVEL_2, w.ORG_LEVEL_3, w.ORG_LEVEL_4 from WORKBASKET w "
|
||||
|
@ -179,6 +176,6 @@ public interface QueryMapper {
|
|||
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
|
||||
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
|
||||
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
|
||||
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
|
||||
@Result(property = "orgLevel4", column = "ORG_LEVEL_4") })
|
||||
List<WorkbasketSummaryImpl> queryWorkbasket(WorkbasketQueryImpl workbasketQuery);
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public interface TaskMapper {
|
|||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "custom9", column = "CUSTOM_9"),
|
||||
@Result(property = "custom10", column = "CUSTOM_10")})
|
||||
@Result(property = "custom10", column = "CUSTOM_10") })
|
||||
List<TaskSummaryImpl> findTasksByWorkbasketIdAndState(@Param("workbasketKey") String workbasketKey,
|
||||
@Param("taskState") TaskState taskState);
|
||||
|
||||
|
@ -168,6 +168,6 @@ public interface TaskMapper {
|
|||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8"),
|
||||
@Result(property = "custom9", column = "CUSTOM_9"),
|
||||
@Result(property = "custom10", column = "CUSTOM_10")})
|
||||
@Result(property = "custom10", column = "CUSTOM_10") })
|
||||
List<TaskSummaryImpl> findTaskSummariesByWorkbasketKey(@Param("workbasketKey") String workbasketKey);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package pro.taskana.model.mappings;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -36,7 +36,7 @@ public interface TaskMonitorMapper {
|
|||
+ "AND STATE IN (<foreach collection='status' item='state' separator=','>#{state}</foreach>)"
|
||||
+ "</script>")
|
||||
long getTaskCountForWorkbasketByDaysInPastAndState(@Param("workbasketId") String workbasketId,
|
||||
@Param("fromDate") Date fromDate, @Param("status") List<TaskState> states);
|
||||
@Param("fromDate") Instant fromDate, @Param("status") List<TaskState> states);
|
||||
|
||||
@Select("<script>"
|
||||
+ "SELECT CAST(DUE AS DATE) as DUE_DATE, WORKBASKETID, COUNT (*) as counter "
|
||||
|
@ -48,7 +48,7 @@ public interface TaskMonitorMapper {
|
|||
@Results({ @Result(column = "DUE_DATE", property = "due"),
|
||||
@Result(column = "WORKBASKETID", property = "workbasketId"),
|
||||
@Result(column = "counter", property = "taskCounter") })
|
||||
List<DueWorkbasketCounter> getTaskCountByWorkbasketIdAndDaysInPastAndState(@Param("fromDate") Date fromDate,
|
||||
List<DueWorkbasketCounter> getTaskCountByWorkbasketIdAndDaysInPastAndState(@Param("fromDate") Instant fromDate,
|
||||
@Param("status") List<TaskState> states);
|
||||
|
||||
@Select("<script>"
|
||||
|
@ -62,5 +62,4 @@ public interface TaskMonitorMapper {
|
|||
@Result(column = "counter", property = "totalCount") })
|
||||
List<ReportLine> getDetailLinesByWorkbasketIdsAndStates(@Param("workbaskets") List<Workbasket> workbaskets,
|
||||
@Param("status") List<TaskState> states);
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public interface WorkbasketAccessMapper {
|
|||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8") })
|
||||
WorkbasketAccessItem findById(@Param("id") String id);
|
||||
|
||||
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST WHERE ACCESS_ID = #{accessId}")
|
||||
|
@ -55,7 +55,7 @@ public interface WorkbasketAccessMapper {
|
|||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8") })
|
||||
List<WorkbasketAccessItem> findByAccessId(@Param("accessId") String accessId);
|
||||
|
||||
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_KEY = #{key}")
|
||||
|
@ -75,7 +75,7 @@ public interface WorkbasketAccessMapper {
|
|||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8") })
|
||||
List<WorkbasketAccessItem> findByWorkbasketKey(@Param("key") String key);
|
||||
|
||||
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST ORDER BY ID")
|
||||
|
@ -95,7 +95,7 @@ public interface WorkbasketAccessMapper {
|
|||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8") })
|
||||
List<WorkbasketAccessItem> findAll();
|
||||
|
||||
@Insert("INSERT INTO WORKBASKET_ACCESS_LIST (ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8) "
|
||||
|
@ -143,9 +143,8 @@ public interface WorkbasketAccessMapper {
|
|||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8") })
|
||||
List<WorkbasketAccessItem> findByWorkbasketAndAccessIdAndAuthorizations(
|
||||
@Param("workbasketKey") String workbasketKey, @Param("accessIds") List<String> accessIds,
|
||||
@Param("authorization") String authorization);
|
||||
|
||||
}
|
||||
|
|
|
@ -42,5 +42,4 @@ public class GroupPrincipal implements Group {
|
|||
public Enumeration<? extends Principal> members() {
|
||||
return Collections.enumeration(this.members);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,5 +17,4 @@ public class UserPrincipal implements Principal {
|
|||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -94,9 +94,7 @@ CREATE TABLE CLASSIFICATION(
|
|||
CUSTOM_5 VARCHAR(255) NULL,
|
||||
CUSTOM_6 VARCHAR(255) NULL,
|
||||
CUSTOM_7 VARCHAR(255) NULL,
|
||||
CUSTOM_8 VARCHAR(255) NULL,
|
||||
VALID_FROM DATE NOT NULL,
|
||||
VALID_UNTIL DATE NOT NULL
|
||||
CUSTOM_8 VARCHAR(255) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE WORKBASKET_ACCESS_LIST(
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package acceptance;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -27,7 +29,6 @@ import pro.taskana.model.ObjectReference;
|
|||
public abstract class AbstractAccTest {
|
||||
|
||||
protected static TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||
|
||||
protected static TaskanaEngine taskanaEngine;
|
||||
|
||||
@BeforeClass
|
||||
|
@ -76,13 +77,13 @@ public abstract class AbstractAccTest {
|
|||
taskanaEngine.getClassificationService().getClassification(classificationKey, "DOMAIN_A").asSummary());
|
||||
attachment.setObjectReference(objRef);
|
||||
attachment.setChannel(channel);
|
||||
Timestamp receivedTimestamp = null;
|
||||
Instant receivedTimestamp = null;
|
||||
if (receivedDate != null && receivedDate.length() < 11) {
|
||||
// contains only the date, not the time
|
||||
java.sql.Date date = java.sql.Date.valueOf(receivedDate);
|
||||
receivedTimestamp = new Timestamp(date.getTime());
|
||||
LocalDate date = LocalDate.parse(receivedDate);
|
||||
receivedTimestamp = date.atStartOfDay().toInstant(ZoneOffset.UTC);
|
||||
} else {
|
||||
receivedTimestamp = Timestamp.valueOf(receivedDate);
|
||||
receivedTimestamp = Instant.parse(receivedDate);
|
||||
}
|
||||
attachment.setReceived(receivedTimestamp);
|
||||
attachment.setCustomAttributes(customAttributes);
|
||||
|
|
|
@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,9 +43,6 @@ public class DeleteClassificationAccTest extends AbstractAccTest {
|
|||
"DOMAIN_A");
|
||||
ClassificationSummary temp = classifications.get(classifications.size() - 1);
|
||||
classification = classificationService.getClassification(temp.getKey(), temp.getDomain());
|
||||
|
||||
Date lastOneValidUntil = classification.getValidUntil();
|
||||
assertTrue(lastOneValidUntil.before(new Date(System.currentTimeMillis())));
|
||||
}
|
||||
|
||||
@Ignore
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package acceptance.classification;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.h2.store.fs.FileUtils;
|
||||
import org.junit.AfterClass;
|
||||
|
@ -18,7 +14,6 @@ import org.junit.Test;
|
|||
import acceptance.AbstractAccTest;
|
||||
import pro.taskana.Classification;
|
||||
import pro.taskana.ClassificationService;
|
||||
import pro.taskana.ClassificationSummary;
|
||||
import pro.taskana.exceptions.ClassificationNotFoundException;
|
||||
|
||||
/**
|
||||
|
@ -35,8 +30,8 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
String newName = "updated Name";
|
||||
String newEntryPoint = "updated EntryPoint";
|
||||
ClassificationService classificationService = taskanaEngine.getClassificationService();
|
||||
Classification oldClassification = classificationService.getClassification("T2100", "DOMAIN_A");
|
||||
Classification classification = classificationService.getClassification("T2100", "DOMAIN_A");
|
||||
|
||||
classification.setApplicationEntryPoint(newEntryPoint);
|
||||
classification.setCategory("PROCESS");
|
||||
classification.setCustom1("newCustom1");
|
||||
|
@ -52,8 +47,8 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
classification.setName(newName);
|
||||
classification.setParentClassificationKey("T2000");
|
||||
classification.setPriority(1000);
|
||||
|
||||
classification.setServiceLevel("P2DT3H4M");
|
||||
|
||||
classificationService.updateClassification(classification);
|
||||
|
||||
// Get and check the new value
|
||||
|
@ -61,23 +56,47 @@ public class UpdateClassificationAccTest extends AbstractAccTest {
|
|||
assertNotNull(updatedClassification);
|
||||
assertThat(updatedClassification.getName(), equalTo(newName));
|
||||
assertThat(updatedClassification.getApplicationEntryPoint(), equalTo(newEntryPoint));
|
||||
}
|
||||
|
||||
// Check that classification got historized
|
||||
List<ClassificationSummary> classifications = classificationService.getAllClassifications("T2100",
|
||||
"DOMAIN_A");
|
||||
assertEquals(2, classifications.size());
|
||||
for (ClassificationSummary classif : classifications) {
|
||||
if (classif.getId().equals(oldClassification.getId())) {
|
||||
assertEquals("MANUAL", classif.getCategory());
|
||||
// assert that the old one has the correct valid until information
|
||||
Date yesterday = Date.valueOf(LocalDate.now().minusDays(1));
|
||||
assertEquals(yesterday, classif.getValidUntil());
|
||||
} else {
|
||||
assertEquals("PROCESS", classif.getCategory());
|
||||
}
|
||||
@Test
|
||||
public void testUpdateUnpersistedClassification() throws SQLException, ClassificationNotFoundException {
|
||||
String newName = "updated Name";
|
||||
String newEntryPoint = "updated EntryPoint";
|
||||
ClassificationService classificationService = taskanaEngine.getClassificationService();
|
||||
Classification classification = classificationService.newClassification("OTHER_DOMAIN", "NO REGISTERED KEY",
|
||||
"DOCUMENT");
|
||||
classification.setApplicationEntryPoint(newEntryPoint);
|
||||
classification.setCategory("PROCESS");
|
||||
classification.setCustom1("newCustom1");
|
||||
classification.setCustom2("newCustom2");
|
||||
classification.setCustom3("newCustom3");
|
||||
classification.setCustom4("newCustom4");
|
||||
classification.setCustom5("newCustom5");
|
||||
classification.setCustom6("newCustom6");
|
||||
classification.setCustom7("newCustom7");
|
||||
classification.setCustom8("newCustom8");
|
||||
classification.setDescription("newDescription");
|
||||
classification.setIsValidInDomain(false);
|
||||
classification.setName(newName);
|
||||
classification.setParentClassificationKey("T2000");
|
||||
classification.setPriority(1000);
|
||||
classification.setServiceLevel("P2DT3H4M");
|
||||
|
||||
try {
|
||||
classification = classificationService.getClassification(classification.getKey(),
|
||||
classification.getDomain());
|
||||
fail("CLASSIFICATION SHOULD BE UNPERSISTED FOR THIS TESTCASE!");
|
||||
} catch (ClassificationNotFoundException ex) {
|
||||
}
|
||||
|
||||
assertThat(classifications.get(0).getValidUntil(), not(equalTo(classifications.get(1).getValidUntil())));
|
||||
classificationService.updateClassification(classification);
|
||||
|
||||
// Get and check the new value
|
||||
Classification persistedClassification = classificationService.getClassification(classification.getKey(),
|
||||
classification.getDomain());
|
||||
assertNotNull(persistedClassification);
|
||||
assertThat(persistedClassification.getName(), equalTo(newName));
|
||||
assertThat(persistedClassification.getApplicationEntryPoint(), equalTo(newEntryPoint));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
|
@ -2,6 +2,7 @@ package pro.taskana.impl;
|
|||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
|
@ -9,7 +10,7 @@ import static org.mockito.Mockito.times;
|
|||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -39,7 +40,7 @@ import pro.taskana.model.mappings.ClassificationMapper;
|
|||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class ClassificationServiceImplTest {
|
||||
|
||||
private final Date today = Date.valueOf(LocalDate.now());
|
||||
private final String todaysDate = LocalDate.now().toString().substring(0, 10);
|
||||
|
||||
@Spy
|
||||
@InjectMocks
|
||||
|
@ -66,8 +67,6 @@ public class ClassificationServiceImplTest {
|
|||
|
||||
doReturn(classificationQueryImplMock).when(cutSpy).createClassificationQuery();
|
||||
doReturn(classificationQueryImplMock).when(classificationQueryImplMock).parentClassificationKey("");
|
||||
doReturn(classificationQueryImplMock).when(classificationQueryImplMock)
|
||||
.validUntil(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
doReturn(classifications).when(classificationQueryImplMock).list();
|
||||
|
||||
List<ClassificationSummary> actaulResults = cutSpy.getClassificationTree();
|
||||
|
@ -75,8 +74,6 @@ public class ClassificationServiceImplTest {
|
|||
verify(taskanaEngineImplMock, times(2)).openConnection();
|
||||
verify(cutSpy, times(1)).createClassificationQuery();
|
||||
verify(classificationQueryImplMock, times(1)).parentClassificationKey("");
|
||||
verify(classificationQueryImplMock, times(1))
|
||||
.validUntil(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
verify(classificationQueryImplMock, times(1)).list();
|
||||
verify(taskanaEngineImplMock, times(2)).returnConnection();
|
||||
assertThat(actaulResults, equalTo(classifications));
|
||||
|
@ -87,14 +84,14 @@ public class ClassificationServiceImplTest {
|
|||
throws ClassificationAlreadyExistException, ClassificationNotFoundException {
|
||||
Classification classification = createDummyClassification();
|
||||
doReturn(classification).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
|
||||
try {
|
||||
cutSpy.createClassification(classification);
|
||||
} catch (ClassificationAlreadyExistException e) {
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
throw e;
|
||||
|
@ -103,119 +100,86 @@ public class ClassificationServiceImplTest {
|
|||
|
||||
@Test
|
||||
public void testCreateClassificationInOwnDomainButExistingInRoot()
|
||||
throws ClassificationAlreadyExistException, ClassificationNotFoundException {
|
||||
throws ClassificationAlreadyExistException, ClassificationNotFoundException, InterruptedException {
|
||||
Instant beforeTimestamp = Instant.now();
|
||||
Thread.sleep(10L);
|
||||
Classification classification = createDummyClassification();
|
||||
String domain = classification.getDomain();
|
||||
String key = classification.getKey();
|
||||
Date validUntil = ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL;
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
doReturn(classification).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
"", ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
doReturn(classification).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(), "");
|
||||
|
||||
cutSpy.createClassification(classification);
|
||||
classification = cutSpy.createClassification(classification);
|
||||
|
||||
verify(taskanaEngineImplMock, times(2)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, domain, validUntil);
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, "", validUntil);
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, domain);
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, "");
|
||||
verify(classificationMapperMock, times(1)).insert(any());
|
||||
verify(taskanaEngineImplMock, times(2)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(classification.getCreated(), equalTo(today));
|
||||
assertThat(classification.getCreated().toString().substring(0, 10), equalTo(todaysDate));
|
||||
assertTrue(classification.getCreated().isBefore(Instant.now()));
|
||||
assertTrue(classification.getCreated().isAfter(beforeTimestamp));
|
||||
assertThat(classification.getDomain(), equalTo(domain));
|
||||
assertThat(classification.getKey(), equalTo(key));
|
||||
assertThat(classification.getValidFrom(), equalTo(today));
|
||||
assertThat(classification.getValidUntil(),
|
||||
equalTo(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateClassificationInOwnDomainAndInRoot()
|
||||
public void testCreateClassificationInOwnDomainAndCopyInRootDomain()
|
||||
throws ClassificationAlreadyExistException {
|
||||
Classification classification = createDummyClassification();
|
||||
String domain = classification.getDomain();
|
||||
String key = classification.getKey();
|
||||
Date validUntil = ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL;
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
"", ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(), "");
|
||||
|
||||
cutSpy.createClassification(classification);
|
||||
classification = cutSpy.createClassification(classification);
|
||||
|
||||
verify(taskanaEngineImplMock, times(2)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, domain, validUntil);
|
||||
verify(classificationMapperMock, times(2)).findByKeyAndDomain(key, "", validUntil);
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(key, domain);
|
||||
verify(classificationMapperMock, times(2)).findByKeyAndDomain(key, "");
|
||||
verify(classificationMapperMock, times(2)).insert(any());
|
||||
verify(taskanaEngineImplMock, times(2)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(classification.getCreated(), equalTo(today));
|
||||
assertThat(classification.getCreated().toString().substring(0, 10), equalTo(todaysDate));
|
||||
assertThat(classification.getDomain(), equalTo(domain));
|
||||
assertThat(classification.getKey(), equalTo(key));
|
||||
assertThat(classification.getValidFrom(), equalTo(today));
|
||||
assertThat(classification.getValidUntil(),
|
||||
equalTo(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateClassificationIntoRootDomain()
|
||||
throws ClassificationAlreadyExistException {
|
||||
ClassificationImpl classification = (ClassificationImpl) createDummyClassification();
|
||||
((ClassificationImpl) classification).setDomain("");
|
||||
classification.setDomain("");
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
|
||||
cutSpy.createClassification(classification);
|
||||
classification = (ClassificationImpl) cutSpy.createClassification(classification);
|
||||
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
verify(classificationMapperMock, times(1)).insert(classification);
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(classification.getCreated(), equalTo(today));
|
||||
assertThat(classification.getValidFrom(), equalTo(today));
|
||||
assertThat(classification.getValidUntil(),
|
||||
equalTo(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL));
|
||||
assertThat(classification.getCreated().toString().substring(0, 10), equalTo(todaysDate));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateClassificationAtNewDomain() throws ClassificationNotFoundException {
|
||||
public void testUpdateExistingClassification() throws ClassificationNotFoundException {
|
||||
Classification classification = createDummyClassification();
|
||||
ClassificationImpl oldClassification = (ClassificationImpl) createDummyClassification();
|
||||
((ClassificationImpl) oldClassification).setDomain("");
|
||||
doReturn(oldClassification).when(cutSpy).getClassification(classification.getKey(), classification.getDomain());
|
||||
|
||||
cutSpy.updateClassification(classification);
|
||||
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(cutSpy, times(2)).getClassification(classification.getKey(), classification.getDomain());
|
||||
verify(classificationMapperMock, times(1)).insert((ClassificationImpl) classification);
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(classification.getCreated(), equalTo(today));
|
||||
assertThat(classification.getValidFrom(), equalTo(today));
|
||||
assertThat(classification.getValidUntil(),
|
||||
equalTo(ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateClassificationAtSameDomain() throws ClassificationNotFoundException {
|
||||
Classification classification = createDummyClassification();
|
||||
ClassificationImpl oldClassification = (ClassificationImpl) createDummyClassification();
|
||||
oldClassification.setValidUntil(Date.valueOf(LocalDate.now()));
|
||||
Date yesterday = Date.valueOf(LocalDate.now().minusDays(1));
|
||||
doReturn(oldClassification).when(cutSpy).getClassification(classification.getKey(), classification.getDomain());
|
||||
|
||||
cutSpy.updateClassification(classification);
|
||||
classification = cutSpy.updateClassification(classification);
|
||||
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(cutSpy, times(2)).getClassification(classification.getKey(), classification.getDomain());
|
||||
verify(classificationMapperMock, times(1)).update(any());
|
||||
verify(classificationMapperMock, times(1)).insert(any());
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(oldClassification.getValidUntil(), equalTo(yesterday));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -241,15 +205,14 @@ public class ClassificationServiceImplTest {
|
|||
public void testGetClassificationFromDomain() throws ClassificationNotFoundException {
|
||||
Classification expectedClassification = createDummyClassification();
|
||||
doReturn(expectedClassification).when(classificationMapperMock)
|
||||
.findByKeyAndDomain(expectedClassification.getKey(), expectedClassification.getDomain(),
|
||||
ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
.findByKeyAndDomain(expectedClassification.getKey(), expectedClassification.getDomain());
|
||||
|
||||
Classification actualClassification = cutSpy.getClassification(expectedClassification.getKey(),
|
||||
expectedClassification.getDomain());
|
||||
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(expectedClassification.getKey(),
|
||||
expectedClassification.getDomain(), ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
expectedClassification.getDomain());
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
assertThat(actualClassification, equalTo(expectedClassification));
|
||||
|
@ -259,22 +222,16 @@ public class ClassificationServiceImplTest {
|
|||
public void testGetClassificationThrowingNotFoundException() throws ClassificationNotFoundException {
|
||||
Classification classification = createDummyClassification();
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(),
|
||||
ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(),
|
||||
"",
|
||||
ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
doReturn(null).when(classificationMapperMock).findByKeyAndDomain(classification.getKey(), "");
|
||||
|
||||
try {
|
||||
cutSpy.getClassification(classification.getKey(), classification.getDomain());
|
||||
} catch (ClassificationNotFoundException e) {
|
||||
verify(taskanaEngineImplMock, times(1)).openConnection();
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(classification.getKey(),
|
||||
classification.getDomain(),
|
||||
ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(classification.getKey(),
|
||||
"",
|
||||
ClassificationServiceImpl.CURRENT_CLASSIFICATIONS_VALID_UNTIL);
|
||||
classification.getDomain());
|
||||
verify(classificationMapperMock, times(1)).findByKeyAndDomain(classification.getKey(), "");
|
||||
verify(taskanaEngineImplMock, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(classificationMapperMock, taskanaEngineImplMock, classificationQueryImplMock);
|
||||
throw e;
|
||||
|
@ -308,8 +265,4 @@ public class ClassificationServiceImplTest {
|
|||
classificationImpl.setParentClassificationKey("");
|
||||
return classificationImpl;
|
||||
}
|
||||
|
||||
private ClassificationImpl createDummyCLassificationImpl() {
|
||||
return (ClassificationImpl) createDummyClassification();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import static org.mockito.Mockito.times;
|
|||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -109,14 +109,15 @@ public class TaskMonitorServiceImplTest {
|
|||
List<TaskState> taskStates = Arrays.asList(TaskState.CLAIMED, TaskState.COMPLETED);
|
||||
List<DueWorkbasketCounter> expectedResult = new ArrayList<>();
|
||||
doReturn(expectedResult).when(taskMonitorMapperMock).getTaskCountByWorkbasketIdAndDaysInPastAndState(
|
||||
any(Date.class),
|
||||
any(Instant.class),
|
||||
any());
|
||||
|
||||
List<DueWorkbasketCounter> actualResult = cut.getTaskCountByWorkbasketAndDaysInPastAndState(daysInPast,
|
||||
taskStates);
|
||||
|
||||
verify(taskanaEngineImpl, times(1)).openConnection();
|
||||
verify(taskMonitorMapperMock, times(1)).getTaskCountByWorkbasketIdAndDaysInPastAndState(any(Date.class), any());
|
||||
verify(taskMonitorMapperMock, times(1)).getTaskCountByWorkbasketIdAndDaysInPastAndState(any(Instant.class),
|
||||
any());
|
||||
verify(taskanaEngineImpl, times(1)).returnConnection();
|
||||
verifyNoMoreInteractions(taskanaEngineConfigurationMock, taskanaEngineMock, taskanaEngineImpl,
|
||||
taskMonitorMapperMock, objectReferenceMapperMock, workbasketServiceMock);
|
||||
|
|
|
@ -13,8 +13,8 @@ import static org.mockito.Mockito.times;
|
|||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -291,7 +291,7 @@ public class TaskServiceImplTest {
|
|||
task2.setWorkbasketKey(wb.getKey());
|
||||
task2.setClassificationKey("classificationKey");
|
||||
task2.setPrimaryObjRef(expectedObjectReference);
|
||||
task2.setPlanned(Timestamp.valueOf(LocalDateTime.now().minusHours(1)));
|
||||
task2.setPlanned(Instant.now().minus(Duration.ofHours(1L)));
|
||||
task2.setName("Task2");
|
||||
task2.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||
|
||||
|
@ -464,7 +464,7 @@ public class TaskServiceImplTest {
|
|||
TaskImpl task = createUnitTestTask("1", "Unit Test Task 1", "1", dummyClassification);
|
||||
Thread.sleep(sleepTime);
|
||||
task.setState(TaskState.CLAIMED);
|
||||
task.setClaimed(new Timestamp(System.currentTimeMillis()));
|
||||
task.setClaimed(Instant.now());
|
||||
task.setOwner(CurrentUserContext.getUserid());
|
||||
doReturn(task).when(taskMapperMock).findById(task.getId());
|
||||
doReturn(null).when(attachmentMapperMock).findAttachmentsByTaskId(task.getId());
|
||||
|
@ -509,7 +509,7 @@ public class TaskServiceImplTest {
|
|||
// created and modify should be able to be different.
|
||||
Thread.sleep(sleepTime);
|
||||
task.setState(TaskState.CLAIMED);
|
||||
task.setClaimed(new Timestamp(System.currentTimeMillis()));
|
||||
task.setClaimed(Instant.now());
|
||||
task.setOwner(CurrentUserContext.getUserid());
|
||||
doReturn(task).when(cutSpy).getTask(task.getId());
|
||||
doNothing().when(taskMapperMock).update(task);
|
||||
|
@ -563,7 +563,7 @@ public class TaskServiceImplTest {
|
|||
TaskImpl task = createUnitTestTask("1", "Unit Test Task 1", "1", dummyClassification);
|
||||
task.setOwner("Dummy-Owner-ID: 10");
|
||||
task.setState(TaskState.CLAIMED);
|
||||
task.setClaimed(new Timestamp(System.currentTimeMillis()));
|
||||
task.setClaimed(Instant.now());
|
||||
doReturn(task).when(cutSpy).getTask(task.getId());
|
||||
|
||||
try {
|
||||
|
@ -611,7 +611,7 @@ public class TaskServiceImplTest {
|
|||
// created and modify should be able to be different.
|
||||
Thread.sleep(sleepTime);
|
||||
task.setState(TaskState.CLAIMED);
|
||||
task.setClaimed(new Timestamp(System.currentTimeMillis()));
|
||||
task.setClaimed(Instant.now());
|
||||
doReturn(task).when(cutSpy).getTask(task.getId());
|
||||
doNothing().when(taskMapperMock).update(task);
|
||||
|
||||
|
@ -647,7 +647,7 @@ public class TaskServiceImplTest {
|
|||
// created and modify should be able to be different.
|
||||
Thread.sleep(sleepTime);
|
||||
claimedTask.setState(TaskState.CLAIMED);
|
||||
claimedTask.setClaimed(new Timestamp(System.currentTimeMillis()));
|
||||
claimedTask.setClaimed(Instant.now());
|
||||
doReturn(claimedTask).when(cutSpy).claim(task.getId(), isForced);
|
||||
doNothing().when(taskMapperMock).update(claimedTask);
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ public class TaskServiceImplTest {
|
|||
task.setWorkbasketKey(workbasketKey);
|
||||
task.setDomain("");
|
||||
task.setAttachments(new ArrayList<>());
|
||||
Timestamp now = new Timestamp(System.currentTimeMillis());
|
||||
Instant now = Instant.now();
|
||||
task.setCreated(now);
|
||||
task.setModified(now);
|
||||
task.setClassificationSummary(classification.asSummary());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pro.taskana.impl;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import pro.taskana.ClassificationQuery;
|
||||
|
@ -15,7 +15,6 @@ public class TestClassificationQuery implements ClassificationQuery {
|
|||
|
||||
private List<ClassificationSummaryImpl> classifications;
|
||||
private String[] parentClassificationKey;
|
||||
private Date[] validUntil;
|
||||
private String description;
|
||||
|
||||
public TestClassificationQuery(List<ClassificationSummaryImpl> classifications) {
|
||||
|
@ -54,7 +53,7 @@ public class TestClassificationQuery implements ClassificationQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery created(Date... created) {
|
||||
public ClassificationQuery created(Instant... created) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -65,7 +64,6 @@ public class TestClassificationQuery implements ClassificationQuery {
|
|||
|
||||
@Override
|
||||
public ClassificationQuery descriptionLike(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -89,36 +87,11 @@ public class TestClassificationQuery implements ClassificationQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery validFrom(Date... validFrom) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassificationQuery validUntil(Date... validUntil) {
|
||||
this.validUntil = validUntil;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClassificationSummary> list() throws NotAuthorizedException {
|
||||
List<ClassificationSummary> returnedClassifications = new ArrayList<>();
|
||||
returnedClassifications.addAll(classifications);
|
||||
for (ClassificationSummaryImpl classification : classifications) {
|
||||
if (this.validUntil != null) {
|
||||
boolean validDate = false;
|
||||
for (Date valid : validUntil) {
|
||||
if (!classification.getValidUntil().before(valid)) {
|
||||
validDate = true;
|
||||
}
|
||||
}
|
||||
if (!validDate) {
|
||||
returnedClassifications.remove(classification);
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnedClassifications;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,10 +7,8 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
@ -168,13 +166,15 @@ public class ClassificationServiceImplIntAutoCommitTest {
|
|||
@Test
|
||||
public void testModifiedClassification()
|
||||
throws ClassificationAlreadyExistException, ClassificationNotFoundException {
|
||||
|
||||
String description = "TEST SOMETHING";
|
||||
Classification classification = this.createDummyClassificationWithUniqueKey("domain1", "type1");
|
||||
classificationService.createClassification(classification);
|
||||
classification.setDescription("");
|
||||
classification = classificationService.createClassification(classification);
|
||||
classification.setDescription("TEST SOMETHING");
|
||||
classificationService.updateClassification(classification);
|
||||
|
||||
Assert.assertEquals(classification.getValidFrom(), Date.valueOf(LocalDate.now()));
|
||||
classification = classificationService.getClassification(classification.getKey(), classification.getDomain());
|
||||
Assert.assertThat(description, equalTo(classification.getDescription()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -182,44 +182,36 @@ public class ClassificationServiceImplIntAutoCommitTest {
|
|||
throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException,
|
||||
InvalidArgumentException {
|
||||
Classification classification = this.createDummyClassificationWithUniqueKey("", "type1");
|
||||
Classification actualClassification = classificationService.createClassification(classification);
|
||||
Date today = Date.valueOf(LocalDate.now());
|
||||
classification = classificationService.createClassification(classification);
|
||||
Instant today = Instant.now();
|
||||
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.validInDomain(Boolean.TRUE)
|
||||
.created(today)
|
||||
.validFrom(today)
|
||||
.validUntil(Date.valueOf("9999-12-31"))
|
||||
.list();
|
||||
|
||||
Assert.assertEquals(1, list.size());
|
||||
assertThat(actualClassification, equalTo(classification));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateAndClassificationMapper()
|
||||
throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException {
|
||||
Classification classification = this.createDummyClassificationWithUniqueKey("", "type1");
|
||||
classificationService.createClassification(classification);
|
||||
System.out.println(classification.getId());
|
||||
classification = classificationService.createClassification(classification);
|
||||
classification.setDescription("description");
|
||||
classificationService.updateClassification(classification);
|
||||
classification = classificationService.updateClassification(classification);
|
||||
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.validUntil(Date.valueOf("9999-12-31"))
|
||||
.validInDomain(true)
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery().validInDomain(true).list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
|
||||
classificationService.updateClassification(classification);
|
||||
System.out.println(classification.getId());
|
||||
list = classificationService.createClassificationQuery().validUntil(Date.valueOf("9999-12-31")).list();
|
||||
classification = classificationService.updateClassification(classification);
|
||||
list = classificationService.createClassificationQuery()
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
|
||||
System.out.println(classification.getParentClassificationKey());
|
||||
|
||||
List<ClassificationSummary> temp = classificationService.getClassificationTree();
|
||||
List<ClassificationSummary> allClassifications = new ArrayList<>();
|
||||
temp.stream().forEach(c -> allClassifications.add(c));
|
||||
List<ClassificationSummary> allClassifications = classificationService.getClassificationTree();
|
||||
Assert.assertEquals(1, allClassifications.size());
|
||||
}
|
||||
|
||||
|
@ -360,34 +352,38 @@ public class ClassificationServiceImplIntAutoCommitTest {
|
|||
throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException,
|
||||
InvalidArgumentException {
|
||||
Classification classification = this.createDummyClassificationWithUniqueKey("", "type1");
|
||||
classification = classificationService.createClassification(classification);
|
||||
|
||||
Classification classification1 = this.createDummyClassificationWithUniqueKey("", "type1");
|
||||
classificationService.createClassification(classification);
|
||||
classificationService.createClassification(classification1);
|
||||
classification1 = classificationService.createClassification(classification1);
|
||||
|
||||
classification1.setParentClassificationKey(classification.getKey());
|
||||
classificationService.updateClassification(classification1);
|
||||
classification1 = classificationService.updateClassification(classification1);
|
||||
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.parentClassificationKey("")
|
||||
.list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().validUntil(Date.valueOf("9999-12-31")).list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery()
|
||||
.list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
|
||||
List<ClassificationSummary> listAll = classificationService.createClassificationQuery().list();
|
||||
list = classificationService.createClassificationQuery().validFrom(Date.valueOf(LocalDate.now())).list();
|
||||
list = classificationService.createClassificationQuery().list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
|
||||
list = classificationService.createClassificationQuery().validInDomain(true).list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
list = classificationService.createClassificationQuery().created(Date.valueOf(LocalDate.now())).list();
|
||||
|
||||
list = classificationService.createClassificationQuery().created(Instant.now()).list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
|
||||
list = classificationService.createClassificationQuery().domain("domain1").validInDomain(false).list();
|
||||
Assert.assertEquals(0, list.size());
|
||||
|
||||
list = classificationService.createClassificationQuery()
|
||||
.validFrom(Date.valueOf((LocalDate.now())))
|
||||
.validUntil(Date.valueOf(LocalDate.now().minusDays(1)))
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
Assert.assertEquals(2, list.size());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
|
|
@ -8,9 +8,8 @@ import static org.junit.Assert.fail;
|
|||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Date;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
@ -186,55 +185,56 @@ public class ClassificationServiceImplIntExplicitTest {
|
|||
taskanaEngineImpl.setConnection(connection);
|
||||
Classification classification = this.createNewClassificationWithUniqueKey("novatec", "t1");
|
||||
connection.commit();
|
||||
classificationService.createClassification(classification);
|
||||
classification.setDescription("TEST SOMETHING");
|
||||
classificationService.updateClassification(classification);
|
||||
classification = classificationService.createClassification(classification);
|
||||
|
||||
String updatedDescription = "TEST SOMETHING";
|
||||
classification.setDescription(updatedDescription);
|
||||
classification = classificationService.updateClassification(classification);
|
||||
connection.commit();
|
||||
Assert.assertEquals(classification.getValidFrom(), Date.valueOf(LocalDate.now()));
|
||||
|
||||
classification = classificationService.getClassification(classification.getKey(), classification.getDomain());
|
||||
assertThat(classification.getDescription(), equalTo(updatedDescription));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInsertAndClassificationMapper()
|
||||
public void testInsertAndClassificationQuery()
|
||||
throws NotAuthorizedException, SQLException, ClassificationAlreadyExistException,
|
||||
ClassificationNotFoundException {
|
||||
Connection connection = dataSource.getConnection();
|
||||
taskanaEngineImpl.setConnection(connection);
|
||||
Classification classification = this.createNewClassificationWithUniqueKey("", "t1");
|
||||
classificationService.createClassification(classification);
|
||||
Date today = Date.valueOf(LocalDate.now());
|
||||
Instant today = Instant.now();
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.validInDomain(Boolean.TRUE)
|
||||
.created(today)
|
||||
.validFrom(today)
|
||||
.validUntil(Date.valueOf("9999-12-31"))
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateAndClassificationMapper() throws NotAuthorizedException, SQLException,
|
||||
public void testUpdateAndClassificationQuery() throws NotAuthorizedException, SQLException,
|
||||
ClassificationAlreadyExistException, ClassificationNotFoundException, InvalidArgumentException {
|
||||
Connection connection = dataSource.getConnection();
|
||||
taskanaEngineImpl.setConnection(connection);
|
||||
Classification classification = this.createNewClassificationWithUniqueKey("", "t1");
|
||||
classificationService.createClassification(classification);
|
||||
System.out.println(classification.getKey());
|
||||
classification.setDescription("");
|
||||
classification = classificationService.createClassification(classification);
|
||||
classification.setDescription("description");
|
||||
classificationService.updateClassification(classification);
|
||||
classification = classificationService.updateClassification(classification);
|
||||
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.validUntil(Date.valueOf("9999-12-31"))
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery().validInDomain(true).list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
|
||||
classificationService.updateClassification(classification);
|
||||
System.out.println(classification.getKey());
|
||||
list = classificationService.createClassificationQuery().validUntil(Date.valueOf("9999-12-31")).list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
classification = classificationService.getClassification(classification.getKey(), classification.getDomain());
|
||||
assertThat(classification.getDescription(), equalTo("description"));
|
||||
|
||||
System.out.println(classification.getParentClassificationKey());
|
||||
classification = classificationService.updateClassification(classification);
|
||||
list = classificationService.createClassificationQuery()
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
|
||||
List<ClassificationSummary> allClassifications = classificationService.getClassificationTree();
|
||||
Assert.assertEquals(1, allClassifications.size());
|
||||
|
@ -386,40 +386,43 @@ public class ClassificationServiceImplIntExplicitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultSettingsWithClassificationMapper() throws NotAuthorizedException, SQLException,
|
||||
public void testDefaultSettingsWithClassificationQuery() throws NotAuthorizedException, SQLException,
|
||||
ClassificationAlreadyExistException, ClassificationNotFoundException, InvalidArgumentException {
|
||||
Connection connection = dataSource.getConnection();
|
||||
taskanaEngineImpl.setConnection(connection);
|
||||
Classification classification = this.createNewClassificationWithUniqueKey("", "type1");
|
||||
classification = classificationService.createClassification(classification);
|
||||
|
||||
Classification classification1 = this.createNewClassificationWithUniqueKey("", "type1");
|
||||
classificationService.createClassification(classification);
|
||||
classificationService.createClassification(classification1);
|
||||
classification1 = classificationService.createClassification(classification1);
|
||||
classification1.setParentClassificationKey(classification.getKey());
|
||||
classificationService.updateClassification(classification1);
|
||||
classification1 = classificationService.updateClassification(classification1);
|
||||
|
||||
List<ClassificationSummary> list = classificationService.createClassificationQuery()
|
||||
.parentClassificationKey("")
|
||||
.list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().validUntil(Date.valueOf("9999-12-31")).list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
list = classificationService.createClassificationQuery()
|
||||
.list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
connection.commit();
|
||||
|
||||
List<ClassificationSummary> listAll = classificationService.createClassificationQuery().list();
|
||||
list = classificationService.createClassificationQuery().validFrom(Date.valueOf(LocalDate.now())).list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
list = classificationService.createClassificationQuery().validInDomain(true).list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
list = classificationService.createClassificationQuery().created(Date.valueOf(LocalDate.now())).list();
|
||||
Assert.assertEquals(listAll.size(), list.size());
|
||||
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().created(Instant.now()).list();
|
||||
Assert.assertEquals(2, list.size());
|
||||
list = classificationService.createClassificationQuery().domain("domain1").validInDomain(false).list();
|
||||
Assert.assertEquals(0, list.size());
|
||||
list = classificationService.createClassificationQuery()
|
||||
.validFrom(Date.valueOf((LocalDate.now())))
|
||||
.validUntil(Date.valueOf(LocalDate.now().minusDays(1)))
|
||||
.key(classification1.getKey())
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
|
||||
list = classificationService.createClassificationQuery()
|
||||
.parentClassificationKey(classification.getKey())
|
||||
.list();
|
||||
Assert.assertEquals(1, list.size());
|
||||
assertThat(list.get(0).getKey(), equalTo(classification1.getKey()));
|
||||
connection.commit();
|
||||
}
|
||||
|
||||
|
|
|
@ -207,8 +207,6 @@ public class TaskServiceImplIntAutocommitTest {
|
|||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||
taskServiceImpl.createTask(task);
|
||||
|
||||
TaskanaEngineImpl taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
|
||||
List<TaskSummary> results = taskServiceImpl.createTaskQuery()
|
||||
.nameIn("bla", "test")
|
||||
.descriptionLike("test")
|
||||
|
|
|
@ -8,8 +8,8 @@ import static org.junit.Assert.fail;
|
|||
import java.io.FileNotFoundException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class TaskServiceImplIntExplicitTest {
|
|||
accessItem.setPermOpen(true);
|
||||
workbasketService.createWorkbasketAuthorization(accessItem);
|
||||
|
||||
Timestamp tomorrow = Timestamp.valueOf(LocalDateTime.now().plusDays(1));
|
||||
Instant tomorrow = Instant.now().plus(Duration.ofDays(1L));
|
||||
|
||||
Workbasket wb = workbasketService.newWorkbasket();
|
||||
wb.setDomain("novatec");
|
||||
|
@ -275,7 +275,7 @@ public class TaskServiceImplIntExplicitTest {
|
|||
|
||||
Assert.assertEquals(resultTask.getClassificationSummary().getId(),
|
||||
resultTask2.getClassificationSummary().getId());
|
||||
Assert.assertTrue(resultTask.getDue().after(resultTask2.getDue()));
|
||||
Assert.assertTrue(resultTask.getDue().isAfter(resultTask2.getDue()));
|
||||
Assert.assertFalse(resultTask.getName().equals(resultTask2.getName()));
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class TaskServiceImplIntExplicitTest {
|
|||
taskServiceImpl.createTask(task);
|
||||
}
|
||||
|
||||
@WithAccessId(userName = "Elena", groupNames = {"DummyGroup"})
|
||||
@WithAccessId(userName = "Elena", groupNames = { "DummyGroup" })
|
||||
@Test
|
||||
public void should_ReturnList_when_BuilderIsUsed() throws SQLException, NotAuthorizedException,
|
||||
WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException,
|
||||
|
@ -352,8 +352,6 @@ public class TaskServiceImplIntExplicitTest {
|
|||
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
|
||||
task = taskServiceImpl.createTask(task);
|
||||
|
||||
TaskanaEngineImpl taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
|
||||
List<TaskSummary> results = taskServiceImpl.createTaskQuery()
|
||||
.nameIn("bla", "test")
|
||||
.descriptionLike("test")
|
||||
|
|
|
@ -4,9 +4,9 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
@ -56,17 +56,16 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
|
||||
private static final int SLEEP_TIME = 100;
|
||||
private static final int THREE = 3;
|
||||
private static final long ONE_DAY = 24 * 3600 * 1000;
|
||||
private static final long TEN_DAYS = 10 * ONE_DAY;
|
||||
private static final long FIFTEEN_DAYS = 15 * ONE_DAY;
|
||||
private static final long TWENTY_DAYS = 2 * TEN_DAYS;
|
||||
private static final Duration ONE_DAY = Duration.ofDays(1L);
|
||||
private static final Duration TEN_DAYS = Duration.ofDays(10L);
|
||||
private static final Duration FIFTEEN_DAYS = Duration.ofDays(15L);
|
||||
private static final Duration TWENTY_DAYS = Duration.ofDays(20L);
|
||||
static int counter = 0;
|
||||
private DataSource dataSource;
|
||||
private TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||
private TaskanaEngine taskanaEngine;
|
||||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
private WorkbasketService workBasketService;
|
||||
private Date workBasketsCreated;
|
||||
|
||||
@BeforeClass
|
||||
public static void resetDb() throws SQLException {
|
||||
|
@ -259,7 +258,7 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
}
|
||||
}
|
||||
|
||||
@WithAccessId(userName = "Bernd", groupNames = {"group1", "group2", "group3", "group4"})
|
||||
@WithAccessId(userName = "Bernd", groupNames = { "group1", "group2", "group3", "group4" })
|
||||
@Test
|
||||
public void testWorkbasketQuery()
|
||||
throws NotAuthorizedException, InvalidArgumentException, InvalidWorkbasketException,
|
||||
|
@ -267,12 +266,12 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
|
||||
generateSampleDataForQuery();
|
||||
|
||||
Date tomorrow = new Date(workBasketsCreated.getTime() + ONE_DAY);
|
||||
Date yesterday = new Date(workBasketsCreated.getTime() - ONE_DAY);
|
||||
Date tenDaysAgo = new Date(workBasketsCreated.getTime() - TEN_DAYS);
|
||||
Date fifteenDaysAgo = new Date(workBasketsCreated.getTime() - FIFTEEN_DAYS);
|
||||
Date twentyDaysAgo = new Date(workBasketsCreated.getTime() - TWENTY_DAYS);
|
||||
Date thirtyDaysAgo = new Date(workBasketsCreated.getTime() - THREE * TEN_DAYS);
|
||||
Instant now = Instant.now();
|
||||
Instant tomorrow = now.plus(ONE_DAY);
|
||||
Instant yesterday = now.minus(ONE_DAY);
|
||||
Instant tenDaysAgo = now.minus(TEN_DAYS);
|
||||
Instant twentyDaysAgo = now.minus(TWENTY_DAYS);
|
||||
Instant thirtyDaysAgo = now.minus(TWENTY_DAYS).minus(TEN_DAYS);
|
||||
|
||||
WorkbasketQuery query1 = workBasketService.createWorkbasketQuery()
|
||||
.accessIdsHavePersmission(WorkbasketAuthorization.OPEN, "Bernd")
|
||||
|
@ -317,10 +316,10 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
.modifiedAfter(thirtyDaysAgo)
|
||||
.modifiedBefore(tenDaysAgo);
|
||||
List<WorkbasketSummary> result5 = query5.list();
|
||||
assertTrue(result5.size() == 2);
|
||||
assertTrue(result5.size() == THREE);
|
||||
for (WorkbasketSummary workbasket : result5) {
|
||||
String name = workbasket.getName();
|
||||
assertTrue("Basket1".equals(name) || "Basket2".equals(name));
|
||||
assertTrue("Basket1".equals(name) || "Basket2".equals(name) || "Basket4".equals(name));
|
||||
}
|
||||
|
||||
WorkbasketQuery query6 = workBasketService.createWorkbasketQuery()
|
||||
|
@ -343,8 +342,6 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
|
||||
private void generateSampleDataForQuery()
|
||||
throws InvalidWorkbasketException, WorkbasketNotFoundException, NotAuthorizedException {
|
||||
workBasketsCreated = new Date();
|
||||
|
||||
WorkbasketImpl basket1 = (WorkbasketImpl) workBasketService.newWorkbasket();
|
||||
basket1.setId("1");
|
||||
basket1.setKey("k1");
|
||||
|
@ -436,14 +433,16 @@ public class WorkbasketServiceImplIntAutocommitTest {
|
|||
WorkbasketImpl wb2 = (WorkbasketImpl) basket2;
|
||||
WorkbasketImpl wb3 = (WorkbasketImpl) basket3;
|
||||
WorkbasketImpl wb4 = (WorkbasketImpl) basket4;
|
||||
Instant now = Instant.now();
|
||||
|
||||
engineProxy.openConnection();
|
||||
wb1.setModified(new Timestamp(workBasketsCreated.getTime() - TEN_DAYS));
|
||||
wb1.setModified(now.minus(TEN_DAYS));
|
||||
mapper.update(wb1);
|
||||
wb2.setModified(new Timestamp(workBasketsCreated.getTime() - FIFTEEN_DAYS));
|
||||
wb2.setModified(now.minus(FIFTEEN_DAYS));
|
||||
mapper.update(wb2);
|
||||
wb3.setModified(new Timestamp(workBasketsCreated.getTime() - TWENTY_DAYS));
|
||||
wb3.setModified(now.minus(TWENTY_DAYS));
|
||||
mapper.update(wb3);
|
||||
wb4.setModified(new Timestamp(workBasketsCreated.getTime() - (2 * FIFTEEN_DAYS)));
|
||||
wb4.setModified(now.minus(TWENTY_DAYS).minus(TEN_DAYS));
|
||||
mapper.update(wb4);
|
||||
engineProxy.returnConnection();
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
-- ROOT CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2016-12-12', '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', '', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', '', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_A CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2016-12-12', '2017-12-11');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000014', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'BUZ-Leistungsfall', 'BUZ-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2017-12-12', '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000016', 'T2000', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin', 'T-Vertragstermin', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000014', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'BUZ-Leistungsfall', 'BUZ-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000016', 'T2000', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin', 'T-Vertragstermin', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_B CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000015', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 22, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000015', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 22, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- WITH PARENT CLASSIFICATIONS (MIXED DOMAIN) ---
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000001', 'A12', 'L10000', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2016-12-12', '2017-12-11');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000002', 'A13', 'T6310', 'AUTOMATIC', 'EXTERN', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000003', 'A12', 'T2100', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000001', 'A12', 'L10000', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000002', 'A13', 'T6310', 'AUTOMATIC', 'EXTERN', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000003', 'A12', 'T2100', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
|
|
@ -23,7 +23,7 @@ import pro.taskana.rest.model.WorkbasketCounterDataDto;
|
|||
import pro.taskana.rest.model.WorkbasketCounterDto;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(path = "/v1/monitor", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
@RequestMapping(path = "/v1/monitor", produces = { MediaType.APPLICATION_JSON_VALUE })
|
||||
public class MonitorController {
|
||||
|
||||
@Autowired
|
||||
|
@ -78,9 +78,10 @@ public class MonitorController {
|
|||
states);
|
||||
|
||||
for (DueWorkbasketCounter item : dwcList) {
|
||||
String formattedDate = item.getDue()
|
||||
.toLocalDate()
|
||||
.format(new DateTimeFormatterBuilder().appendPattern("dd.MM.yyyy").toFormatter());
|
||||
String formattedDate = new DateTimeFormatterBuilder()
|
||||
.appendPattern("dd.MM.yyyy")
|
||||
.toFormatter()
|
||||
.format(item.getDue());
|
||||
for (int i = 0; i < dates.size(); i++) {
|
||||
if (formattedDate.equalsIgnoreCase(dates.get(i))) {
|
||||
for (int j = 0; j < data.size(); j++) {
|
||||
|
@ -92,9 +93,7 @@ public class MonitorController {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
WorkbasketCounterDto.setData(data);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(WorkbasketCounterDto);
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
|
||||
|
|
|
@ -1,30 +1,37 @@
|
|||
-- ROOT CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2016-12-12', '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', '', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 999, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', '', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:000000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', '', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_A CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2016-12-12', '2017-12-11');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000014', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'BUZ-Leistungsfall', 'BUZ-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', '2017-12-12', '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000015', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 22, 'P2D', '', 'VNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000016', 'T2000', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin', 'T-Vertragstermin', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '', CURRENT_TIMESTAMP, '9999-12-31');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000001', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000002', 'L10303', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000003', 'L1050', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000004', 'L11010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamikänderung', 'Dynamikänderung', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L110102', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ablehnung', 'Dynamik-Ablehnung', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Ausschluss', 'Dynamik-Ausschluss', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107', 'L11010', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Dynamik-Einschluss/Änd.', 'Dynamik-Einschluss/Änd.', 5, 'P5D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Gewährung-Policendarlehen', 'Gewährung-Policendarlehen', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Zustimmungserklärung', 'Zustimmungserklärung', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310', '', 'AUTOMATIC', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-GUK Honorarrechnung erstellen', 'Generali Unterstützungskasse Honorar wird fällig', 2, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOKTYP_DEFAULT', '', 'EXTERN', 'DOCUMENT', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'EP allgemein', 'EP allgemein', 99, 'P2000D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000014', 'L10000', '', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'BUZ-Leistungsfall', 'BUZ-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000016', 'T2000', '', 'MANUAL', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin', 'T-Vertragstermin', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- DOMAIN_B CLASSIFICATIONS
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000015', 'T2100', '', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'T-Vertragstermin VERA', 'T-Vertragstermin VERA', 22, 'P2D', '', 'VNR', '', '', '', '', '', '', '');
|
||||
|
||||
-- WITH PARENT CLASSIFICATIONS (MIXED DOMAIN) ---
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000001', 'A12', 'L10000', 'EXTERN', 'TASK', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'OLD-Leistungsfall', 'OLD-Leistungsfall', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000002', 'A13', 'T6310', 'AUTOMATIC', 'EXTERN', 'DOMAIN_A', TRUE, CURRENT_TIMESTAMP, 'Beratungsprotokoll', 'Beratungsprotokoll', 1, 'P1D', '', 'VNR,RVNR,KOLVNR, ANR', '', '', '', '', '', '', '');
|
||||
INSERT INTO CLASSIFICATION VALUES('CLI:200000000000000000000000000000000003', 'A12', 'T2100', 'MANUAL', 'TASK', 'DOMAIN_B', TRUE, CURRENT_TIMESTAMP, 'Widerruf', 'Widerruf', 1, 'P1D', '', 'VNR,RVNR,KOLVNR', '', '', '', '', '', '', '');
|
||||
|
|
Loading…
Reference in New Issue