io.nflow.engine.internal.workflow.StoredWorkflowDefinition Maven / Gradle / Ivy
package io.nflow.engine.internal.workflow;
import java.util.ArrayList;
import java.util.List;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.nflow.engine.model.ModelObject;
public class StoredWorkflowDefinition extends ModelObject {
public String type;
public String description;
public String onError;
public List states;
public List supportedSignals = new ArrayList<>();
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "serialized to database with object mapper")
public static class State extends ModelObject implements Comparable {
public State() {
// default constructor is required by Jackson deserializer
}
public State(String id, String type, String description) {
this.id = id;
this.type = type;
this.description = description;
}
public String id;
public String type;
public String description;
public List transitions = new ArrayList<>();
public String onFailure;
@Override
@SuppressFBWarnings(value = "EQ_COMPARETO_USE_OBJECT_EQUALS", justification = "This class has a natural ordering that is inconsistent with equals")
public int compareTo(State state) {
return type.compareTo(state.type);
}
}
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "serialized to database with object mapper")
public static class Signal extends ModelObject implements Comparable {
public Integer value;
public String description;
@Override
@SuppressFBWarnings(value = { "EQ_COMPARETO_USE_OBJECT_EQUALS",
"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" }, justification = "This class has a natural ordering that is inconsistent with equals, signal value should never be null")
public int compareTo(Signal o) {
return value.compareTo(o.value);
}
}
}