io.camunda.operate.webapp.rest.dto.operation.ModifyProcessInstanceRequestDto Maven / Gradle / Ivy
The newest version!
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Licensed under the Camunda License 1.0. You may not use this file
* except in compliance with the Camunda License 1.0.
*/
package io.camunda.operate.webapp.rest.dto.operation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.collections4.MapUtils;
public class ModifyProcessInstanceRequestDto {
private List modifications;
private String processInstanceKey;
public String getProcessInstanceKey() {
return processInstanceKey;
}
public ModifyProcessInstanceRequestDto setProcessInstanceKey(final String processInstanceKey) {
this.processInstanceKey = processInstanceKey;
return this;
}
public List getModifications() {
return modifications;
}
public ModifyProcessInstanceRequestDto setModifications(final List modifications) {
this.modifications = modifications;
return this;
}
@Override
public int hashCode() {
return Objects.hash(modifications, processInstanceKey);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final ModifyProcessInstanceRequestDto that = (ModifyProcessInstanceRequestDto) o;
return Objects.equals(modifications, that.modifications)
&& Objects.equals(processInstanceKey, that.processInstanceKey);
}
@Override
public String toString() {
return "ModifyProcessInstanceRequestDto{"
+ "modifications="
+ modifications
+ ", processInstanceKey="
+ processInstanceKey
+ '}';
}
public static class Modification {
private Type modification;
private String fromFlowNodeId;
private String fromFlowNodeInstanceKey;
private String toFlowNodeId;
private Long scopeKey;
private Long ancestorElementInstanceKey;
private Integer newTokensCount;
private Map variables;
public Type getModification() {
return modification;
}
public Modification setModification(final Type modification) {
this.modification = modification;
return this;
}
public String getFromFlowNodeId() {
return fromFlowNodeId;
}
public Modification setFromFlowNodeId(final String fromFlowNodeId) {
this.fromFlowNodeId = fromFlowNodeId;
return this;
}
public String getToFlowNodeId() {
return toFlowNodeId;
}
public Modification setToFlowNodeId(final String toFlowNodeId) {
this.toFlowNodeId = toFlowNodeId;
return this;
}
public Long getScopeKey() {
return scopeKey;
}
public Modification setScopeKey(final Long scopeKey) {
this.scopeKey = scopeKey;
return this;
}
public Map getVariables() {
return variables;
}
public Modification setVariables(final Map variables) {
this.variables = variables;
return this;
}
public Map>> variablesForAddToken() {
if (variables == null || MapUtils.isEmpty(variables)) {
return null;
}
final Map>> result = new HashMap<>();
for (String flowNodeId : variables.keySet()) {
final List