diff --git a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt index 5e316662ed..09fd747209 100644 --- a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt +++ b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt @@ -13,16 +13,17 @@ import net.corda.core.node.services.StateMachineTransactionMapping import net.corda.core.node.services.Vault import net.corda.core.seconds import net.corda.core.transactions.SignedTransaction +import net.corda.core.utilities.ProgressTracker import rx.Observable import rx.subjects.PublishSubject -data class ProgressTrackingEvent(val stateMachineId: StateMachineRunId, val message: String, val sessionId: Long ) { // TODO: RG Not a string, but a proper tracking object. +data class ProgressTrackingEvent(val stateMachineId: StateMachineRunId, val message: String, val currentState: ProgressTracker?) { // TODO: RG Not a string, but a proper tracking object. companion object { fun createStreamFromStateMachineInfo(stateMachine: StateMachineInfo): Observable? { return stateMachine.progressTrackerStepAndUpdates?.let { pair -> val (current, future) = pair - future.map { ProgressTrackingEvent(stateMachine.id, it, stateMachine.sessionId ) }.startWith(ProgressTrackingEvent(stateMachine.id, current, stateMachine.sessionId)) + future.map { ProgressTrackingEvent(stateMachine.id, it, null ) }.startWith(ProgressTrackingEvent(stateMachine.id, current, null)) } } } diff --git a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/TransactionDataModel.kt b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/TransactionDataModel.kt index fb844f1e90..3537dc82ef 100644 --- a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/TransactionDataModel.kt +++ b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/TransactionDataModel.kt @@ -11,7 +11,6 @@ import net.corda.core.contracts.ContractState import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.StateRef import net.corda.core.crypto.SecureHash -import net.corda.core.flows.FlowLogic import net.corda.core.flows.StateMachineRunId import net.corda.core.messaging.StateMachineUpdate import net.corda.core.transactions.SignedTransaction @@ -61,7 +60,7 @@ data class PartiallyResolvedTransaction( } data class FlowStatus(val status: String) -//todo after rebase +//todo after rebase - remove it rather //class FlowStatus( // val status: String, // pt: ProgressTrackingEvent?, @@ -125,17 +124,8 @@ class TransactionDataModel { } } - val stateMachineDataList = LeftOuterJoinedMap(stateMachineStatus, progressEvents) { - id, status, progress -> - Bindings.createObjectBinding( - { StateMachineData(id, -// FlowStatus(progress.value?.message!!, null), - progress.value?.message?.let{ - FlowStatus(progress.value!!.message!!.toString(),progress.value) - }, - status.get()) } - , arrayOf(progress, status) - ) + val stateMachineDataList = LeftOuterJoinedMap(stateMachineStatus, progressEvents) { id, status, progress -> + Bindings.createObjectBinding({ StateMachineData(id, progress.value?.message?.let(::FlowStatus), status.get()) }, arrayOf(progress, status)) }.getObservableValues().flatten() /* @@ -183,14 +173,7 @@ class StateMachineDataModel { val stateMachineDataList = LeftOuterJoinedMap(stateMachineStatus, progressEvents) { id, status, progress -> - Bindings.createObjectBinding({ - StateMachineData(id, - progress.value?.message?.let{ - FlowStatus(progress.value!!.message!!.toString(),null) - }, -// progress.value?.message?.let(::FlowStatus), - status.get()) - }, arrayOf(progress, status)) + Bindings.createObjectBinding({ StateMachineData(id, progress.value?.message?.let(::FlowStatus), status.get()) }, arrayOf(progress, status)) }.getObservableValues().flatten() /*