Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
TSK-748,TSK-757 Cleanup project after core release.
Browse files Browse the repository at this point in the history
- Remove dependency from snapshot to release version
- Removed duplicated properties from HistoryEventImpl
- Added getter and query for History Id.
  • Loading branch information
MiguelMartinRojas authored and holgerhagen committed Dec 13, 2018
1 parent aa245d1 commit 6230e86
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 261 deletions.
1 change: 1 addition & 0 deletions lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<module>taskana-simplehistory-provider</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
</project>
7 changes: 6 additions & 1 deletion lib/taskana-simplehistory-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<description>The taskana history events plugin to include in your project.</description>
<url>http://taskana.pro</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
Expand Down Expand Up @@ -181,7 +186,7 @@
<dependency>
<groupId>pro.taskana</groupId>
<artifactId>taskana-core</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,240 +9,10 @@
*/
public class HistoryEventImpl extends TaskanaHistoryEvent {

private String businessProcessId;
private String parentBusinessProcessId;
private String taskId;
private String eventType;
private Instant created;
private String userId;
private String domain;
private String workbasketKey;
private String porCompany;
private String porSystem;
private String porInstance;
private String porType;
private String porValue;
private String taskClassificationKey;
private String taskClassificationCategory;
private String attachmentClassificationKey;
private String comment;
private String oldValue;
private String newValue;
private String custom1;
private String custom2;
private String custom3;
private String custom4;
private String oldData;
private String newData;

public HistoryEventImpl() {
}

public String getBusinessProcessId() {
return businessProcessId;
}

public void setBusinessProcessId(String businessProcessId) {
this.businessProcessId = businessProcessId;
}

public String getParentBusinessProcessId() {
return parentBusinessProcessId;
}

public void setParentBusinessProcessId(String parentBusinessProcessId) {
this.parentBusinessProcessId = parentBusinessProcessId;
}

public String getTaskId() {
return taskId;
}

public void setTaskId(String taskId) {
this.taskId = taskId;
}

@Override
public String getType() {
return eventType;
}

@Override
public void setType(String type) {
this.eventType = type;
}

@Override
public Instant getCreated() {
return created;
}

@Override
public void setCreated(Instant created) {
this.created = created;
}

@Override
public String getUserId() {
return userId;
}

@Override
public void setUserId(String userId) {
this.userId = userId;
}

public String getDomain() {
return domain;
}

public void setDomain(String domain) {
this.domain = domain;
}

public String getWorkbasketKey() {
return workbasketKey;
}

public void setWorkbasketKey(String workbasketKey) {
this.workbasketKey = workbasketKey;
}

public String getPorCompany() {
return porCompany;
}

public void setPorCompany(String porCompany) {
this.porCompany = porCompany;
}

public String getPorSystem() {
return porSystem;
}

public void setPorSystem(String porSystem) {
this.porSystem = porSystem;
}

public String getPorInstance() {
return porInstance;
}

public void setPorInstance(String porInstance) {
this.porInstance = porInstance;
}

public String getPorType() {
return porType;
}

public void setPorType(String porType) {
this.porType = porType;
}

public String getPorValue() {
return porValue;
}

public void setPorValue(String porValue) {
this.porValue = porValue;
}

public String getTaskClassificationKey() {
return taskClassificationKey;
}

public void setTaskClassificationKey(String taskClassificationKey) {
this.taskClassificationKey = taskClassificationKey;
}

public String getTaskClassificationCategory() {
return taskClassificationCategory;
}

public void setTaskClassificationCategory(String taskClassificationCategory) {
this.taskClassificationCategory = taskClassificationCategory;
}

public String getAttachmentClassificationKey() {
return attachmentClassificationKey;
}

public void setAttachmentClassificationKey(String attachmentClassificationKey) {
this.attachmentClassificationKey = attachmentClassificationKey;
}

@Override
public String getComment() {
return comment;
}

@Override
public void setComment(String comment) {
this.comment = comment;
}

public String getOldValue() {
return oldValue;
}

public void setOldValue(String oldValue) {
this.oldValue = oldValue;
}

public String getNewValue() {
return newValue;
}

public void setNewValue(String newValue) {
this.newValue = newValue;
}

public String getCustom1() {
return custom1;
}

public void setCustom1(String custom1) {
this.custom1 = custom1;
}

public String getCustom2() {
return custom2;
}

public void setCustom2(String custom2) {
this.custom2 = custom2;
}

public String getCustom3() {
return custom3;
}

public void setCustom3(String custom3) {
this.custom3 = custom3;
}

public String getCustom4() {
return custom4;
}

public void setCustom4(String custom4) {
this.custom4 = custom4;
}

public String getOldData() {
return oldData;
}

public void setOldData(String oldData) {
this.oldData = oldData;
}

public String getNewData() {
return newData;
public HistoryEventImpl() {
super();
}

public void setNewData(String newData) {
this.newData = newData;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class HistoryQueryImpl implements HistoryQuery {
private List<String> orderColumns;
private int max_rows; // limit for rows. used to make list(offset, limit) and single() more efficient.

private String[] idIn;
private String[] businessProcessIdIn;
private String[] parentBusinessProcessIdIn;
private String[] taskIdIn;
Expand Down Expand Up @@ -84,6 +85,12 @@ public HistoryQueryImpl(TaskanaHistoryEngineImpl taskanaHistoryEngineImpl, Histo
this.max_rows = -1;
}

@Override
public HistoryQuery idIn(String... idIn) {
this.idIn = toUpperCopy(idIn);
return this;
}

@Override
public HistoryQuery businessProcessIdIn(String... businessProcessId) {
this.businessProcessIdIn = toUpperCopy(businessProcessId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ public interface HistoryQueryMapper {

@Select(
"<script>"
+ "SELECT BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, TASK_ID, EVENT_TYPE, CREATED, USER_ID, DOMAIN, WORKBASKET_KEY, "
+ "SELECT ID, BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, TASK_ID, EVENT_TYPE, CREATED, USER_ID, DOMAIN, WORKBASKET_KEY, "
+ "POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, TASK_CLASSIFICATION_KEY, TASK_CLASSIFICATION_CATEGORY,"
+ "ATTACHMENT_CLASSIFICATION_KEY, COMMENT, OLD_VALUE, NEW_VALUE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, OLD_DATA, NEW_DATA "
+ "FROM HISTORY_EVENTS"
+ "<where>"
// IN-Queries
+ "<if test='idIn != null'>AND UPPER(ID) IN (<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='businessProcessIdIn != null'>AND UPPER(BUSINESS_PROCESS_ID) IN (<foreach item='item' collection='businessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='parentBusinessProcessIdIn != null'>AND UPPER(PARENT_BUSINESS_PROCESS_ID) IN (<foreach item='item' collection='parentBusinessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='taskIdIn != null'>AND UPPER(TASK_ID) IN (<foreach item='item' collection='taskIdIn' separator=',' >#{item}</foreach>)</if> "
Expand Down Expand Up @@ -77,6 +78,7 @@ public interface HistoryQueryMapper {
+ "<if test='max_rows > 0'> FETCH FIRST #{max_rows} ROWS ONLY </if>"
+ "</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"),
@Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"),
@Result(property = "taskId", column = "TASK_ID"),
Expand Down Expand Up @@ -169,6 +171,7 @@ public interface HistoryQueryMapper {
+ "FROM HISTORY_EVENTS"
+ "<where>"
// IN-Queries
+ "<if test='idIn != null'>AND UPPER(ID) IN (<foreach item='item' collection='idIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='businessProcessIdIn != null'>AND UPPER(BUSINESS_PROCESS_ID) IN (<foreach item='item' collection='businessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='parentBusinessProcessIdIn != null'>AND UPPER(PARENT_BUSINESS_PROCESS_ID) IN (<foreach item='item' collection='parentBusinessProcessIdIn' separator=',' >#{item}</foreach>)</if> "
+ "<if test='taskIdIn != null'>AND UPPER(TASK_ID) IN (<foreach item='item' collection='taskIdIn' separator=',' >#{item}</foreach>)</if> "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
*/
public interface HistoryQuery extends BaseQuery<HistoryEventImpl, HistoryQueryColumnName> {

/**
* Add your Id to your query.
*
* @param idIn
* as String
* @return the query
*/
HistoryQuery idIn(String... idIn);

/**
* Add your businessProcessId to your query.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @author bv
*/
public enum HistoryQueryColumnName implements QueryColumnName {
ID("id"),
BUSINESS_PROCESS_ID("business_process_id"),
PARENT_BUSINESS_PROCESS_ID("parent_business_process_id"),
TASK_ID("task_id"),
Expand Down
Loading

0 comments on commit 6230e86

Please sign in to comment.