Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.inteligr8.activiti.api.ProcessInstanceApi Maven / Gradle / Ivy
/*
* 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 .
*/
package com.inteligr8.activiti.api;
import java.io.File;
import java.util.List;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.inteligr8.activiti.model.ProcessInstanceAction;
import com.inteligr8.activiti.model.ProcessInstanceAction.ActionValue;
import com.inteligr8.activiti.model.ResultList;
import com.inteligr8.activiti.model.SortOrder;
import com.inteligr8.activiti.model.Variable;
import com.inteligr8.alfresco.activiti.model.ProcessInstance;
@Path("/api/runtime/process-instances")
public interface ProcessInstanceApi {
public enum Sort {
@JsonProperty("id")
ProcessInstanceId,
@JsonProperty("processDefinitionId")
ProcessDefinitionId,
@JsonProperty("tenantId")
TenantId,
@JsonProperty("processDefinitionKey")
ProcessDefinitionKey;
}
@GET
@Path("{processInstanceId}")
@Produces({ MediaType.APPLICATION_JSON })
ProcessInstance get(
@PathParam("processInstanceId") String processInstanceId);
@DELETE
@Path("{processInstanceId}")
void delete(
@PathParam("processInstanceId") String processInstanceId);
default void activate(
String processInstanceId) {
this.act(processInstanceId, new ProcessInstanceAction(ActionValue.Activate));
}
default void suspend(
String processInstanceId) {
this.act(processInstanceId, new ProcessInstanceAction(ActionValue.Suspend));
}
@PUT
@Path("{processInstanceId}")
@Consumes({ MediaType.APPLICATION_JSON })
void act(
@PathParam("processInstanceId") String processInstanceId,
ProcessInstanceAction action);
default ResultList getWithoutTenant(
String processInstanceId,
String processDefinitionKey,
String processDefinitionId,
String businessKey,
String involvedUser,
Boolean suspended,
String superProcessInstanceId,
String subProcessInstanceId,
Boolean excludeSubprocesses,
Boolean includeProcessVariables,
Sort sort,
SortOrder sortOrder,
Integer pageStart,
Integer pageSize) {
return this.getByAny(processInstanceId, processDefinitionKey, processDefinitionId,
businessKey, involvedUser, suspended, superProcessInstanceId, subProcessInstanceId,
excludeSubprocesses, includeProcessVariables, null, null, true,
sort, sortOrder, pageStart, pageSize);
}
default ResultList getByTenant(
String processInstanceId,
String processDefinitionKey,
String processDefinitionId,
String businessKey,
String involvedUser,
Boolean suspended,
String superProcessInstanceId,
String subProcessInstanceId,
Boolean excludeSubprocesses,
Boolean includeProcessVariables,
String tenantId,
Sort sort,
SortOrder sortOrder,
Integer pageStart,
Integer pageSize) {
return this.getByAny(processInstanceId, processDefinitionKey, processDefinitionId,
businessKey, involvedUser, suspended, superProcessInstanceId, subProcessInstanceId,
excludeSubprocesses, includeProcessVariables, tenantId, null, false,
sort, sortOrder, pageStart, pageSize);
}
default ResultList getByTenants(
String processInstanceId,
String processDefinitionKey,
String processDefinitionId,
String businessKey,
String involvedUser,
Boolean suspended,
String superProcessInstanceId,
String subProcessInstanceId,
Boolean excludeSubprocesses,
Boolean includeProcessVariables,
String tenantIdLike,
Sort sort,
SortOrder sortOrder,
Integer pageStart,
Integer pageSize) {
return this.getByAny(processInstanceId, processDefinitionKey, processDefinitionId,
businessKey, involvedUser, suspended, superProcessInstanceId, subProcessInstanceId,
excludeSubprocesses, includeProcessVariables, null, tenantIdLike, false,
sort, sortOrder, pageStart, pageSize);
}
@GET
@Produces({ MediaType.APPLICATION_JSON })
public ResultList getByAny(
@QueryParam("id") String processInstanceId,
@QueryParam("processDefinitionKey") String processDefinitionKey,
@QueryParam("processDefinitionId") String processDefinitionId,
@QueryParam("businessKey") String businessKey,
@QueryParam("involvedUser") String involvedUser,
@QueryParam("suspended") Boolean suspended,
@QueryParam("superProcessInstanceId") String superProcessInstanceId,
@QueryParam("subProcessInstanceId") String subProcessInstanceId,
@QueryParam("excludeSubprocesses") Boolean excludeSubprocesses,
@QueryParam("includeProcessVariables") Boolean includeProcessVariables,
@QueryParam("tenantId") String tenantId,
@QueryParam("tenantIdLike") String tenantIdLike,
@QueryParam("withoutTenantId") Boolean withoutTenantId,
@QueryParam("sort") Sort sort,
@QueryParam("order") SortOrder sortOrder,
@QueryParam("start") Integer pageStart,
@QueryParam("size") Integer pageSize);
@GET
@Path("{processInstanceId}/diagram")
@Produces({ "image/png" })
File getDiagram(
@PathParam("processInstanceId") String processInstanceId);
@GET
@Path("{processInstanceId}/variables")
@Produces({ MediaType.APPLICATION_JSON })
List getVariables(
@PathParam("processInstanceId") String processInstanceId);
@GET
@Path("{processInstanceId}/variables/{variableName}")
@Produces({ MediaType.APPLICATION_JSON })
Variable getVariable(
@PathParam("processInstanceId") String processInstanceId,
@PathParam("variableName") String variableName);
@POST
@Path("{processInstanceId}/variables")
@Consumes({ MediaType.APPLICATION_JSON })
void createVariables(
@PathParam("processInstanceId") String processInstanceId,
List variables);
@PUT
@Path("{processInstanceId}/variables")
@Consumes({ MediaType.APPLICATION_JSON })
void updateVariables(
@PathParam("processInstanceId") String processInstanceId,
List variables);
default void updateVariable(
String processInstanceId,
Variable variable) {
this.updateVariable(processInstanceId, variable.getName(), variable);
}
@PUT
@Path("{processInstanceId}/variables/{variableName}")
@Consumes({ MediaType.APPLICATION_JSON })
void updateVariable(
@PathParam("processInstanceId") String processInstanceId,
@PathParam("variableName") String variableName,
Variable variable);
}