From 9d4d128f4e6f04dd0ba5f59c98ce81c6e0ecbbbe Mon Sep 17 00:00:00 2001 From: williamvigorr3 <58432369+williamvigorr3@users.noreply.github.com> Date: Wed, 26 Feb 2020 10:48:52 +0000 Subject: [PATCH] CORDA-3597 add missed data to checkpoint class (#5995) * Add extra fields to StateMachineState * Move structures into checkpoint as this is a more natural place. --- .../services/persistence/DBCheckpointStorage.kt | 10 +--------- .../services/statemachine/StateMachineState.kt | 14 +++++++++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt index c9d883a5b0..13b5b2ace7 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt @@ -7,6 +7,7 @@ import net.corda.core.utilities.ProgressTracker import net.corda.core.utilities.debug import net.corda.node.services.api.CheckpointStorage import net.corda.node.services.statemachine.Checkpoint +import net.corda.node.services.statemachine.Checkpoint.FlowStatus import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.nodeapi.internal.persistence.currentDBSession import org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY @@ -33,15 +34,6 @@ import javax.persistence.OneToOne class DBCheckpointStorage : CheckpointStorage { val log: Logger = LoggerFactory.getLogger(this::class.java) - enum class FlowStatus { - RUNNABLE, - FAILED, - COMPLETED, - HOSPITALIZED, - KILLED, - PAUSED - } - enum class StartReason { RPC, FLOW, SERVICE, SCHEDULED, INITIATED } diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineState.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineState.kt index dbc37090fa..f4c9e790b6 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineState.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineState.kt @@ -54,8 +54,20 @@ data class Checkpoint( val checkpointState: CheckpointState, val flowState: FlowState, val errorState: ErrorState, - val result: Any? = null + val result: Any? = null, + val status: FlowStatus = FlowStatus.RUNNABLE, + val progressStep: String? = null, + val flowIoRequest: FlowIORequest<*>? = null, + val compatible: Boolean = true ) { + enum class FlowStatus { + RUNNABLE, + FAILED, + COMPLETED, + HOSPITALIZED, + KILLED, + PAUSED + } val timestamp: Instant = Instant.now() // This will get updated every time a Checkpoint object is created/ created by copy.