Skip to content

Commit 288143e

Browse files
feat(wcp): add Checkpoint, CheckpointListResponse, ResumeFromCheckpointResponse types
New types for checkpoint operations. Jackson-annotated with @JsonCreator for deserialization.
1 parent 5c7cafc commit 288143e

1 file changed

Lines changed: 152 additions & 0 deletions

File tree

src/main/java/com/getaxonflow/sdk/types/workflow/WorkflowTypes.java

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,158 @@ public boolean requiresApproval() {
716716
}
717717
}
718718

719+
/** A governance-aware resume boundary at a step-gate evaluation. */
720+
@JsonIgnoreProperties(ignoreUnknown = true)
721+
public static final class Checkpoint {
722+
723+
@JsonProperty("id")
724+
private final long id;
725+
726+
@JsonProperty("workflow_id")
727+
private final String workflowId;
728+
729+
@JsonProperty("step_id")
730+
private final String stepId;
731+
732+
@JsonProperty("step_index")
733+
private final int stepIndex;
734+
735+
@JsonProperty("step_type")
736+
private final String stepType;
737+
738+
@JsonProperty("checkpoint_type")
739+
private final String checkpointType;
740+
741+
@JsonProperty("gate_decision")
742+
private final String gateDecision;
743+
744+
@JsonProperty("gate_reason")
745+
private final String gateReason;
746+
747+
@JsonProperty("is_resumable")
748+
private final boolean resumable;
749+
750+
@JsonProperty("resume_count")
751+
private final int resumeCount;
752+
753+
@JsonProperty("created_at")
754+
private final String createdAt;
755+
756+
@JsonCreator
757+
public Checkpoint(
758+
@JsonProperty("id") long id,
759+
@JsonProperty("workflow_id") String workflowId,
760+
@JsonProperty("step_id") String stepId,
761+
@JsonProperty("step_index") int stepIndex,
762+
@JsonProperty("step_type") String stepType,
763+
@JsonProperty("checkpoint_type") String checkpointType,
764+
@JsonProperty("gate_decision") String gateDecision,
765+
@JsonProperty("gate_reason") String gateReason,
766+
@JsonProperty("is_resumable") boolean resumable,
767+
@JsonProperty("resume_count") int resumeCount,
768+
@JsonProperty("created_at") String createdAt) {
769+
this.id = id;
770+
this.workflowId = workflowId;
771+
this.stepId = stepId;
772+
this.stepIndex = stepIndex;
773+
this.stepType = stepType;
774+
this.checkpointType = checkpointType;
775+
this.gateDecision = gateDecision;
776+
this.gateReason = gateReason;
777+
this.resumable = resumable;
778+
this.resumeCount = resumeCount;
779+
this.createdAt = createdAt;
780+
}
781+
782+
public long getId() { return id; }
783+
public String getWorkflowId() { return workflowId; }
784+
public String getStepId() { return stepId; }
785+
public int getStepIndex() { return stepIndex; }
786+
public String getStepType() { return stepType; }
787+
public String getCheckpointType() { return checkpointType; }
788+
public String getGateDecision() { return gateDecision; }
789+
public String getGateReason() { return gateReason; }
790+
public boolean isResumable() { return resumable; }
791+
public int getResumeCount() { return resumeCount; }
792+
public String getCreatedAt() { return createdAt; }
793+
}
794+
795+
/** Response from listing checkpoints. */
796+
@JsonIgnoreProperties(ignoreUnknown = true)
797+
public static final class CheckpointListResponse {
798+
799+
@JsonProperty("checkpoints")
800+
private final List<Checkpoint> checkpoints;
801+
802+
@JsonProperty("workflow_id")
803+
private final String workflowId;
804+
805+
@JsonCreator
806+
public CheckpointListResponse(
807+
@JsonProperty("checkpoints") List<Checkpoint> checkpoints,
808+
@JsonProperty("workflow_id") String workflowId) {
809+
this.checkpoints = checkpoints != null
810+
? Collections.unmodifiableList(checkpoints)
811+
: Collections.emptyList();
812+
this.workflowId = workflowId;
813+
}
814+
815+
public List<Checkpoint> getCheckpoints() { return checkpoints; }
816+
public String getWorkflowId() { return workflowId; }
817+
}
818+
819+
/** Response after resuming from a checkpoint. */
820+
@JsonIgnoreProperties(ignoreUnknown = true)
821+
public static final class ResumeFromCheckpointResponse {
822+
823+
@JsonProperty("workflow_id")
824+
private final String workflowId;
825+
826+
@JsonProperty("resumed_from_checkpoint")
827+
private final String resumedFromCheckpoint;
828+
829+
@JsonProperty("resumed_from_index")
830+
private final int resumedFromIndex;
831+
832+
@JsonProperty("new_decision")
833+
private final String newDecision;
834+
835+
@JsonProperty("decision_source")
836+
private final String decisionSource;
837+
838+
@JsonProperty("resume_count")
839+
private final int resumeCount;
840+
841+
@JsonProperty("message")
842+
private final String message;
843+
844+
@JsonCreator
845+
public ResumeFromCheckpointResponse(
846+
@JsonProperty("workflow_id") String workflowId,
847+
@JsonProperty("resumed_from_checkpoint") String resumedFromCheckpoint,
848+
@JsonProperty("resumed_from_index") int resumedFromIndex,
849+
@JsonProperty("new_decision") String newDecision,
850+
@JsonProperty("decision_source") String decisionSource,
851+
@JsonProperty("resume_count") int resumeCount,
852+
@JsonProperty("message") String message) {
853+
this.workflowId = workflowId;
854+
this.resumedFromCheckpoint = resumedFromCheckpoint;
855+
this.resumedFromIndex = resumedFromIndex;
856+
this.newDecision = newDecision;
857+
this.decisionSource = decisionSource;
858+
this.resumeCount = resumeCount;
859+
this.message = message;
860+
}
861+
862+
public String getWorkflowId() { return workflowId; }
863+
public String getResumedFromCheckpoint() { return resumedFromCheckpoint; }
864+
public int getResumedFromIndex() { return resumedFromIndex; }
865+
public String getNewDecision() { return newDecision; }
866+
public String getDecisionSource() { return decisionSource; }
867+
public int getResumeCount() { return resumeCount; }
868+
public String getMessage() { return message; }
869+
}
870+
719871
/** Information about a workflow step. */
720872
@JsonIgnoreProperties(ignoreUnknown = true)
721873
public static final class WorkflowStepInfo {

0 commit comments

Comments
 (0)