use of org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto in project camunda-bpm-platform by camunda.
the class ExecutionQueryDto method applyFilters.
@Override
protected void applyFilters(ExecutionQuery query) {
if (processDefinitionKey != null) {
query.processDefinitionKey(processDefinitionKey);
}
if (businessKey != null) {
query.processInstanceBusinessKey(businessKey);
}
if (processDefinitionId != null) {
query.processDefinitionId(processDefinitionId);
}
if (processInstanceId != null) {
query.processInstanceId(processInstanceId);
}
if (activityId != null) {
query.activityId(activityId);
}
if (signalEventSubscriptionName != null) {
query.signalEventSubscriptionName(signalEventSubscriptionName);
}
if (messageEventSubscriptionName != null) {
query.messageEventSubscriptionName(messageEventSubscriptionName);
}
if (active != null && active == true) {
query.active();
}
if (suspended != null && suspended == true) {
query.suspended();
}
if (incidentId != null) {
query.incidentId(incidentId);
}
if (incidentType != null) {
query.incidentType(incidentType);
}
if (incidentMessage != null) {
query.incidentMessage(incidentMessage);
}
if (incidentMessageLike != null) {
query.incidentMessageLike(incidentMessageLike);
}
if (tenantIdIn != null && !tenantIdIn.isEmpty()) {
query.tenantIdIn(tenantIdIn.toArray(new String[tenantIdIn.size()]));
}
if (variables != null) {
for (VariableQueryParameterDto variableQueryParam : variables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.variableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
query.variableValueGreaterThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueGreaterThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OPERATOR_NAME)) {
query.variableValueLessThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueLessThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.variableValueNotEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
query.variableValueLike(variableName, String.valueOf(variableValue));
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
}
}
}
if (processVariables != null) {
for (VariableQueryParameterDto variableQueryParam : processVariables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.processVariableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.processVariableValueNotEquals(variableName, variableValue);
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid process variable comparator specified: " + op);
}
}
}
}
use of org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceQueryDto method applyFilters.
@Override
protected void applyFilters(HistoricProcessInstanceQuery query) {
if (processInstanceId != null) {
query.processInstanceId(processInstanceId);
}
if (processInstanceIds != null) {
query.processInstanceIds(processInstanceIds);
}
if (processDefinitionId != null) {
query.processDefinitionId(processDefinitionId);
}
if (processDefinitionKey != null) {
query.processDefinitionKey(processDefinitionKey);
}
if (processDefinitionName != null) {
query.processDefinitionName(processDefinitionName);
}
if (processDefinitionNameLike != null) {
query.processDefinitionNameLike(processDefinitionNameLike);
}
if (processDefinitionKeyNotIn != null) {
query.processDefinitionKeyNotIn(processDefinitionKeyNotIn);
}
if (processInstanceBusinessKey != null) {
query.processInstanceBusinessKey(processInstanceBusinessKey);
}
if (processInstanceBusinessKeyLike != null) {
query.processInstanceBusinessKeyLike(processInstanceBusinessKeyLike);
}
if (finished != null && finished) {
query.finished();
}
if (unfinished != null && unfinished) {
query.unfinished();
}
if (withIncidents != null && withIncidents) {
query.withIncidents();
}
if (withRootIncidents != null && withRootIncidents) {
query.withRootIncidents();
}
if (incidentStatus != null) {
query.incidentStatus(incidentStatus);
}
if (incidentType != null) {
query.incidentType(incidentType);
}
if (incidentMessage != null) {
query.incidentMessage(incidentMessage);
}
if (incidentMessageLike != null) {
query.incidentMessageLike(incidentMessageLike);
}
if (startedBefore != null) {
query.startedBefore(startedBefore);
}
if (startedAfter != null) {
query.startedAfter(startedAfter);
}
if (finishedBefore != null) {
query.finishedBefore(finishedBefore);
}
if (finishedAfter != null) {
query.finishedAfter(finishedAfter);
}
if (startedBy != null) {
query.startedBy(startedBy);
}
if (superProcessInstanceId != null) {
query.superProcessInstanceId(superProcessInstanceId);
}
if (subProcessInstanceId != null) {
query.subProcessInstanceId(subProcessInstanceId);
}
if (superCaseInstanceId != null) {
query.superCaseInstanceId(superCaseInstanceId);
}
if (subCaseInstanceId != null) {
query.subCaseInstanceId(subCaseInstanceId);
}
if (caseInstanceId != null) {
query.caseInstanceId(caseInstanceId);
}
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (variables != null) {
for (VariableQueryParameterDto variableQueryParam : variables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.variableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
query.variableValueGreaterThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueGreaterThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OPERATOR_NAME)) {
query.variableValueLessThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueLessThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.variableValueNotEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
query.variableValueLike(variableName, String.valueOf(variableValue));
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
}
}
}
if (executedActivityAfter != null) {
query.executedActivityAfter(executedActivityAfter);
}
if (executedActivityBefore != null) {
query.executedActivityBefore(executedActivityBefore);
}
if (executedActivityIdIn != null && !executedActivityIdIn.isEmpty()) {
query.executedActivityIdIn(executedActivityIdIn.toArray(new String[executedActivityIdIn.size()]));
}
if (activeActivityIdIn != null && !activeActivityIdIn.isEmpty()) {
query.activeActivityIdIn(activeActivityIdIn.toArray(new String[activeActivityIdIn.size()]));
}
if (executedJobAfter != null) {
query.executedJobAfter(executedJobAfter);
}
if (executedJobBefore != null) {
query.executedJobBefore(executedJobBefore);
}
}
use of org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryDto method applyFilters.
@Override
protected void applyFilters(CaseInstanceQuery query) {
if (caseInstanceId != null) {
query.caseInstanceId(caseInstanceId);
}
if (businessKey != null) {
query.caseInstanceBusinessKey(businessKey);
}
if (caseDefinitionKey != null) {
query.caseDefinitionKey(caseDefinitionKey);
}
if (caseDefinitionId != null) {
query.caseDefinitionId(caseDefinitionId);
}
if (deploymentId != null) {
query.deploymentId(deploymentId);
}
if (superProcessInstance != null) {
query.superProcessInstanceId(superProcessInstance);
}
if (subProcessInstance != null) {
query.subProcessInstanceId(subProcessInstance);
}
if (superCaseInstance != null) {
query.superCaseInstanceId(superCaseInstance);
}
if (subCaseInstance != null) {
query.subCaseInstanceId(subCaseInstance);
}
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
if (active != null && active == true) {
query.active();
}
if (completed != null && completed == true) {
query.completed();
}
if (terminated != null && terminated == true) {
query.terminated();
}
if (variables != null) {
for (VariableQueryParameterDto variableQueryParam : variables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.variableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
query.variableValueGreaterThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueGreaterThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OPERATOR_NAME)) {
query.variableValueLessThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueLessThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.variableValueNotEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
query.variableValueLike(variableName, String.valueOf(variableValue));
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
}
}
}
}
use of org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceQueryDto method applyFilters.
@Override
protected void applyFilters(HistoricCaseInstanceQuery query) {
if (caseInstanceId != null) {
query.caseInstanceId(caseInstanceId);
}
if (caseInstanceIds != null) {
query.caseInstanceIds(caseInstanceIds);
}
if (caseDefinitionId != null) {
query.caseDefinitionId(caseDefinitionId);
}
if (caseDefinitionKey != null) {
query.caseDefinitionKey(caseDefinitionKey);
}
if (caseDefinitionName != null) {
query.caseDefinitionName(caseDefinitionName);
}
if (caseDefinitionNameLike != null) {
query.caseDefinitionNameLike(caseDefinitionNameLike);
}
if (caseDefinitionKeyNotIn != null) {
query.caseDefinitionKeyNotIn(caseDefinitionKeyNotIn);
}
if (caseInstanceBusinessKey != null) {
query.caseInstanceBusinessKey(caseInstanceBusinessKey);
}
if (caseInstanceBusinessKeyLike != null) {
query.caseInstanceBusinessKeyLike(caseInstanceBusinessKeyLike);
}
if (superCaseInstanceId != null) {
query.superCaseInstanceId(superCaseInstanceId);
}
if (subCaseInstanceId != null) {
query.subCaseInstanceId(subCaseInstanceId);
}
if (superProcessInstanceId != null) {
query.superProcessInstanceId(superProcessInstanceId);
}
if (subProcessInstanceId != null) {
query.subProcessInstanceId(subProcessInstanceId);
}
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
if (createdBy != null) {
query.createdBy(createdBy);
}
if (createdBefore != null) {
query.createdBefore(createdBefore);
}
if (createdAfter != null) {
query.createdAfter(createdAfter);
}
if (closedBefore != null) {
query.closedBefore(closedBefore);
}
if (closedAfter != null) {
query.closedAfter(closedAfter);
}
if (active != null && active) {
query.active();
}
if (completed != null && completed) {
query.completed();
}
if (terminated != null && terminated) {
query.terminated();
}
if (closed != null && closed) {
query.closed();
}
if (notClosed != null && notClosed) {
query.notClosed();
}
if (caseActivityIdIn != null && !caseActivityIdIn.isEmpty()) {
query.caseActivityIdIn(caseActivityIdIn.toArray(new String[caseActivityIdIn.size()]));
}
if (variables != null) {
for (VariableQueryParameterDto variableQueryParam : variables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.variableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
query.variableValueGreaterThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueGreaterThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OPERATOR_NAME)) {
query.variableValueLessThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueLessThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.variableValueNotEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
query.variableValueLike(variableName, String.valueOf(variableValue));
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
}
}
}
}
use of org.camunda.bpm.engine.rest.dto.VariableQueryParameterDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceQueryDto method applyFilters.
@Override
protected void applyFilters(ProcessInstanceQuery query) {
if (processInstanceIds != null) {
query.processInstanceIds(processInstanceIds);
}
if (processDefinitionKey != null) {
query.processDefinitionKey(processDefinitionKey);
}
if (deploymentId != null) {
query.deploymentId(deploymentId);
}
if (businessKey != null) {
query.processInstanceBusinessKey(businessKey);
}
if (businessKeyLike != null) {
query.processInstanceBusinessKeyLike(businessKeyLike);
}
if (caseInstanceId != null) {
query.caseInstanceId(caseInstanceId);
}
if (processDefinitionId != null) {
query.processDefinitionId(processDefinitionId);
}
if (superProcessInstance != null) {
query.superProcessInstanceId(superProcessInstance);
}
if (subProcessInstance != null) {
query.subProcessInstanceId(subProcessInstance);
}
if (superCaseInstance != null) {
query.superCaseInstanceId(superCaseInstance);
}
if (subCaseInstance != null) {
query.subCaseInstanceId(subCaseInstance);
}
if (TRUE.equals(active)) {
query.active();
}
if (TRUE.equals(suspended)) {
query.suspended();
}
if (incidentId != null) {
query.incidentId(incidentId);
}
if (incidentType != null) {
query.incidentType(incidentType);
}
if (incidentMessage != null) {
query.incidentMessage(incidentMessage);
}
if (incidentMessageLike != null) {
query.incidentMessageLike(incidentMessageLike);
}
if (tenantIds != null && !tenantIds.isEmpty()) {
query.tenantIdIn(tenantIds.toArray(new String[tenantIds.size()]));
}
if (TRUE.equals(withoutTenantId)) {
query.withoutTenantId();
}
if (activityIds != null && !activityIds.isEmpty()) {
query.activityIdIn(activityIds.toArray(new String[activityIds.size()]));
}
if (variables != null) {
for (VariableQueryParameterDto variableQueryParam : variables) {
String variableName = variableQueryParam.getName();
String op = variableQueryParam.getOperator();
Object variableValue = variableQueryParam.resolveValue(objectMapper);
if (op.equals(VariableQueryParameterDto.EQUALS_OPERATOR_NAME)) {
query.variableValueEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OPERATOR_NAME)) {
query.variableValueGreaterThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.GREATER_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueGreaterThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OPERATOR_NAME)) {
query.variableValueLessThan(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LESS_THAN_OR_EQUALS_OPERATOR_NAME)) {
query.variableValueLessThanOrEqual(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.NOT_EQUALS_OPERATOR_NAME)) {
query.variableValueNotEquals(variableName, variableValue);
} else if (op.equals(VariableQueryParameterDto.LIKE_OPERATOR_NAME)) {
query.variableValueLike(variableName, String.valueOf(variableValue));
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "Invalid variable comparator specified: " + op);
}
}
}
}
Aggregations