io.nflow.rest.v1.msg.Action Maven / Gradle / Ivy
The newest version!
package io.nflow.rest.v1.msg;
import java.util.Map;
import edu.umd.cs.findbugs.annotations.NonNull;
import org.joda.time.DateTime;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.nflow.engine.model.ModelObject;
import io.swagger.v3.oas.annotations.media.Schema;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
@Schema(description = "State change attempt. A new instance for every retry attempt.")
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "jackson reads dto fields")
public class Action extends ModelObject {
@Schema(description = "Identifier of the workflow instance action", requiredMode = REQUIRED)
public long id;
@Schema(description = "Type of state", requiredMode = REQUIRED, allowableValues = { "stateExecution", "stateExecutionFailed",
"externalChange", "recovery" })
public String type;
@Schema(description = "Name of state", requiredMode = REQUIRED)
public String state;
@Schema(description = "Description of state")
public String stateText;
@Schema(description = "Number of retries in this state", minimum = "0")
public int retryNo;
@Schema(description = "Start time for execution")
public DateTime executionStartTime;
@Schema(description = "End time for execution")
public DateTime executionEndTime;
@Schema(description = "Identifier of the executor that executed this action")
public int executorId;
@Schema(description = "Updated state variables")
public Map updatedStateVariables;
public Action() {
}
public Action(long id, @NonNull String type, @NonNull String state, String stateText, int retryNo, DateTime executionStartTime,
DateTime executionEndTime, int executorId) {
this(id, type, state, stateText, retryNo, executionStartTime, executionEndTime, executorId, null);
}
public Action(long id, @NonNull String type, @NonNull String state, String stateText, int retryNo, DateTime executionStartTime,
DateTime executionEndTime, int executorId, Map updatedStateVariables) {
this();
this.id = id;
this.type = type;
this.state = state;
this.stateText = stateText;
this.retryNo = retryNo;
this.executionStartTime = executionStartTime;
this.executionEndTime = executionEndTime;
this.executorId = executorId;
this.updatedStateVariables = updatedStateVariables;
}
}