added HistoryApi
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.inteligr8.activiti.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.inteligr8.activiti.model.HistoricProcessInstance;
|
||||
import com.inteligr8.activiti.model.HistoryQueryParams;
|
||||
import com.inteligr8.activiti.model.ResultList;
|
||||
|
||||
import jakarta.ws.rs.BeanParam;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
@Path("/api/history")
|
||||
public interface HistoryApi {
|
||||
|
||||
public enum Sort {
|
||||
@JsonProperty("processInstanceId")
|
||||
ProcessInstanceId,
|
||||
@JsonProperty("processDefinitionId")
|
||||
ProcessDefinitionId,
|
||||
@JsonProperty("tenantId")
|
||||
TenantId,
|
||||
@JsonProperty("processDefinitionKey")
|
||||
ProcessDefinitionKey,
|
||||
@JsonProperty("startTime")
|
||||
StartTime,
|
||||
@JsonProperty("endTime")
|
||||
EndTime;
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("historic-process-instances/{processInstanceId}")
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
HistoricProcessInstance get(
|
||||
@PathParam("processInstanceId") String processInstanceId);
|
||||
|
||||
@DELETE
|
||||
@Path("historic-process-instances/{processInstanceId}")
|
||||
void delete(
|
||||
@PathParam("processInstanceId") String processInstanceId);
|
||||
|
||||
@GET
|
||||
@Path("historic-process-instances")
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public ResultList<HistoricProcessInstance> query(
|
||||
@BeanParam HistoryQueryParams params);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
|
||||
package com.inteligr8.activiti.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class HistoricProcessInstance extends Datum {
|
||||
|
||||
@JsonProperty("businessKey")
|
||||
private String businessKey;
|
||||
@JsonProperty("deleteReason")
|
||||
private String deleteReason;
|
||||
@JsonProperty("durationInMillis")
|
||||
private Long durationInMillis;
|
||||
@JsonProperty("endActivityId")
|
||||
private String endActivityId;
|
||||
@JsonProperty("endTime")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime endTime;
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("processDefinitionId")
|
||||
private String processDefinitionId;
|
||||
@JsonProperty("processDefinitionKey")
|
||||
private String processDefinitionKey;
|
||||
@JsonProperty("processDefinitionUrl")
|
||||
private String processDefinitionUrl;
|
||||
@JsonProperty("startActivityId")
|
||||
private String startActivityId;
|
||||
@JsonProperty("startTime")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime startTime;
|
||||
@JsonProperty("startUserId")
|
||||
private String startUserId;
|
||||
@JsonProperty("superProcessInstanceId")
|
||||
private String superProcessInstanceId;
|
||||
@JsonProperty("tenantId")
|
||||
private String tenantId;
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
@JsonProperty("variables")
|
||||
private List<Variable> variables = new ArrayList<Variable>();
|
||||
|
||||
/**
|
||||
* No args constructor for use in serialization
|
||||
*/
|
||||
public HistoricProcessInstance() {
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public void setBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDeleteReason() {
|
||||
return deleteReason;
|
||||
}
|
||||
|
||||
public void setDeleteReason(String deleteReason) {
|
||||
this.deleteReason = deleteReason;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withDeleteReason(String deleteReason) {
|
||||
this.deleteReason = deleteReason;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getDurationInMillis() {
|
||||
return durationInMillis;
|
||||
}
|
||||
|
||||
public void setDurationInMillis(Long durationInMillis) {
|
||||
this.durationInMillis = durationInMillis;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withDurationInMillis(Long durationInMillis) {
|
||||
this.durationInMillis = durationInMillis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEndActivityId() {
|
||||
return endActivityId;
|
||||
}
|
||||
|
||||
public void setEndActivityId(String endActivityId) {
|
||||
this.endActivityId = endActivityId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withEndActivityId(String endActivityId) {
|
||||
this.endActivityId = endActivityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(OffsetDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withEndTime(OffsetDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProcessDefinitionId() {
|
||||
return processDefinitionId;
|
||||
}
|
||||
|
||||
public void setProcessDefinitionId(String processDefinitionId) {
|
||||
this.processDefinitionId = processDefinitionId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withProcessDefinitionId(String processDefinitionId) {
|
||||
this.processDefinitionId = processDefinitionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProcessDefinitionKey() {
|
||||
return processDefinitionKey;
|
||||
}
|
||||
|
||||
public void setProcessDefinitionKey(String processDefinitionKey) {
|
||||
this.processDefinitionKey = processDefinitionKey;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withProcessDefinitionKey(String processDefinitionKey) {
|
||||
this.processDefinitionKey = processDefinitionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProcessDefinitionUrl() {
|
||||
return processDefinitionUrl;
|
||||
}
|
||||
|
||||
public void setProcessDefinitionUrl(String processDefinitionUrl) {
|
||||
this.processDefinitionUrl = processDefinitionUrl;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withProcessDefinitionUrl(String processDefinitionUrl) {
|
||||
this.processDefinitionUrl = processDefinitionUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStartActivityId() {
|
||||
return startActivityId;
|
||||
}
|
||||
|
||||
public void setStartActivityId(String startActivityId) {
|
||||
this.startActivityId = startActivityId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withStartActivityId(String startActivityId) {
|
||||
this.startActivityId = startActivityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(OffsetDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withStartime(OffsetDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStartUserId() {
|
||||
return startUserId;
|
||||
}
|
||||
|
||||
public void setStartUserId(String startUserId) {
|
||||
this.startUserId = startUserId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withStartUserId(String startUserId) {
|
||||
this.startUserId = startUserId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSuperProcessInstanceId() {
|
||||
return superProcessInstanceId;
|
||||
}
|
||||
|
||||
public void setSuperProcessInstanceId(String superProcessInstanceId) {
|
||||
this.superProcessInstanceId = superProcessInstanceId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withSuperProcessInstanceId(String superProcessInstanceId) {
|
||||
this.superProcessInstanceId = superProcessInstanceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(String tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withTenantId(String tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withUrl(String url) {
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Variable> getVariables() {
|
||||
return variables;
|
||||
}
|
||||
|
||||
public void setVariables(List<Variable> variables) {
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
public HistoricProcessInstance withVariables(List<Variable> variables) {
|
||||
this.variables = variables;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
|
||||
package com.inteligr8.activiti.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
|
||||
|
||||
import jakarta.ws.rs.QueryParam;
|
||||
|
||||
public class HistoryQueryParams extends QueryParams<HistoryQueryParams> {
|
||||
|
||||
@QueryParam("processInstanceId")
|
||||
private String processInstanceId;
|
||||
@QueryParam("processDefinitionId")
|
||||
private String processDefinitionId;
|
||||
@QueryParam("processDefinitionKey")
|
||||
private String processDefinitionKey;
|
||||
@QueryParam("businessKey")
|
||||
private String businessKey;
|
||||
@QueryParam("involvedUser")
|
||||
private String involvedUser;
|
||||
@QueryParam("finished")
|
||||
private Boolean finished;
|
||||
@QueryParam("superProcessInstanceId")
|
||||
private String superProcessInstanceId;
|
||||
@QueryParam("excludeSubprocesses")
|
||||
private Boolean excludeSubprocesses;
|
||||
@QueryParam("finishedAfter")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime finishedAfter;
|
||||
@QueryParam("finishedBefore")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime finishedBefore;
|
||||
@QueryParam("startedAfter")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime startedAfter;
|
||||
@QueryParam("startedBefore")
|
||||
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXX")
|
||||
private OffsetDateTime startedBefore;
|
||||
@QueryParam("startedBy")
|
||||
private String startedBy;
|
||||
@QueryParam("includeProcessVariables")
|
||||
private Boolean includeProcessVariables;
|
||||
@QueryParam("tenantId")
|
||||
private String tenantId;
|
||||
@QueryParam("tenantIdLike")
|
||||
private String tenantIdLike;
|
||||
@QueryParam("withoutTenantId")
|
||||
private Boolean withoutTenantId;
|
||||
|
||||
/**
|
||||
* No args constructor for use in serialization
|
||||
*/
|
||||
public HistoryQueryParams() {
|
||||
}
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProcessDefinitionId() {
|
||||
return processDefinitionId;
|
||||
}
|
||||
|
||||
public void setProcessDefinitionId(String processDefinitionId) {
|
||||
this.processDefinitionId = processDefinitionId;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withProcessDefinitionId(String processDefinitionId) {
|
||||
this.processDefinitionId = processDefinitionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProcessDefinitionKey() {
|
||||
return processDefinitionKey;
|
||||
}
|
||||
|
||||
public void setProcessDefinitionKey(String processDefinitionKey) {
|
||||
this.processDefinitionKey = processDefinitionKey;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withProcessDefinitionKey(String processDefinitionKey) {
|
||||
this.processDefinitionKey = processDefinitionKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBusinessKey() {
|
||||
return businessKey;
|
||||
}
|
||||
|
||||
public void setBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withBusinessKey(String businessKey) {
|
||||
this.businessKey = businessKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getInvolvedUser() {
|
||||
return involvedUser;
|
||||
}
|
||||
|
||||
public void setInvolvedUser(String involvedUser) {
|
||||
this.involvedUser = involvedUser;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withInvolvedUser(String involvedUser) {
|
||||
this.involvedUser = involvedUser;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean isFinished() {
|
||||
return finished;
|
||||
}
|
||||
|
||||
public void setFinished(Boolean finished) {
|
||||
this.finished = finished;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withFinished(Boolean finished) {
|
||||
this.finished = finished;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSuperProcessInstanceId() {
|
||||
return superProcessInstanceId;
|
||||
}
|
||||
|
||||
public void setSuperProcessInstanceId(String superProcessInstanceId) {
|
||||
this.superProcessInstanceId = superProcessInstanceId;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withSuperProcessInstanceId(String superProcessInstanceId) {
|
||||
this.superProcessInstanceId = superProcessInstanceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean isExcludeSubprocesses() {
|
||||
return excludeSubprocesses;
|
||||
}
|
||||
|
||||
public void setExcludeSubprocesses(Boolean excludeSubprocesses) {
|
||||
this.excludeSubprocesses = excludeSubprocesses;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withExcludeSubprocesses(Boolean excludeSubprocesses) {
|
||||
this.excludeSubprocesses = excludeSubprocesses;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getFinishedAfter() {
|
||||
return finishedAfter;
|
||||
}
|
||||
|
||||
public void setFinishedAfter(OffsetDateTime finishedAfter) {
|
||||
this.finishedAfter = finishedAfter;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withFinishedAfter(OffsetDateTime finishedAfter) {
|
||||
this.finishedAfter = finishedAfter;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getFinishedBefore() {
|
||||
return finishedBefore;
|
||||
}
|
||||
|
||||
public void setFinishedBefore(OffsetDateTime finishedBefore) {
|
||||
this.finishedBefore = finishedBefore;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withFinishedBefore(OffsetDateTime finishedBefore) {
|
||||
this.finishedBefore = finishedBefore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getStartedAfter() {
|
||||
return startedAfter;
|
||||
}
|
||||
|
||||
public void setStartedAfter(OffsetDateTime startedAfter) {
|
||||
this.startedAfter = startedAfter;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withStartedAfter(OffsetDateTime startedAfter) {
|
||||
this.startedAfter = startedAfter;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OffsetDateTime getStartedBefore() {
|
||||
return startedBefore;
|
||||
}
|
||||
|
||||
public void setStartedBefore(OffsetDateTime startedBefore) {
|
||||
this.startedBefore = startedBefore;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withStartedBefore(OffsetDateTime startedBefore) {
|
||||
this.startedBefore = startedBefore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStartedBy() {
|
||||
return startedBy;
|
||||
}
|
||||
|
||||
public void setStartedBy(String startedBy) {
|
||||
this.startedBy = startedBy;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withStartedBy(String startedBy) {
|
||||
this.startedBy = startedBy;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean isIncludeProcessVariables() {
|
||||
return includeProcessVariables;
|
||||
}
|
||||
|
||||
public void setIncludeProcessVariables(Boolean includeProcessVariables) {
|
||||
this.includeProcessVariables = includeProcessVariables;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withIncludeProcessVariables(Boolean includeProcessVariables) {
|
||||
this.includeProcessVariables = includeProcessVariables;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(String tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withTenantId(String tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTenantIdLike() {
|
||||
return tenantIdLike;
|
||||
}
|
||||
|
||||
public void setTenantIdLike(String tenantIdLike) {
|
||||
this.tenantIdLike = tenantIdLike;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withTenantIdLike(String tenantIdLike) {
|
||||
this.tenantIdLike = tenantIdLike;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getWithoutTenantId() {
|
||||
return withoutTenantId;
|
||||
}
|
||||
|
||||
public void setWithoutTenantId(Boolean withoutTenantId) {
|
||||
this.withoutTenantId = withoutTenantId;
|
||||
}
|
||||
|
||||
public HistoryQueryParams withWithoutTenantId(Boolean withoutTenantId) {
|
||||
this.withoutTenantId = withoutTenantId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user