1076 - Filters out structural steps when tracking a flow via RPC.

This commit is contained in:
Joel Dudley 2018-03-01 15:08:07 +00:00 committed by GitHub
parent b580a2ac30
commit 08c5b72874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -0,0 +1,3 @@
package net.corda.core.internal
val STRUCTURAL_STEP_PREFIX = "Structural step change in child of "

View File

@ -1,5 +1,6 @@
package net.corda.core.utilities package net.corda.core.utilities
import net.corda.core.internal.STRUCTURAL_STEP_PREFIX
import net.corda.core.serialization.CordaSerializable import net.corda.core.serialization.CordaSerializable
import rx.Observable import rx.Observable
import rx.Subscription import rx.Subscription
@ -41,7 +42,7 @@ class ProgressTracker(vararg steps: Step) {
} }
data class Structural(val tracker: ProgressTracker, val parent: Step) : Change(tracker) { data class Structural(val tracker: ProgressTracker, val parent: Step) : Change(tracker) {
override fun toString() = "Structural step change in child of ${parent.label}" override fun toString() = STRUCTURAL_STEP_PREFIX + parent.label
} }
} }

View File

@ -329,12 +329,10 @@ Assuming all went well, you should see some activity in PartyA's web-server term
>> Signing transaction with our private key. >> Signing transaction with our private key.
>> Gathering the counterparty's signature. >> Gathering the counterparty's signature.
>> Structural step change in child of Gathering the counterparty's signature.
>> Collecting signatures from counter-parties. >> Collecting signatures from counter-parties.
>> Verifying collected signatures. >> Verifying collected signatures.
>> Done >> Done
>> Obtaining notary signature and recording transaction. >> Obtaining notary signature and recording transaction.
>> Structural step change in child of Obtaining notary signature and recording transaction.
>> Requesting signature by notary service >> Requesting signature by notary service
>> Broadcasting transaction to participants >> Broadcasting transaction to participants
>> Done >> Done

View File

@ -14,6 +14,7 @@ import net.corda.core.identity.CordaX500Name
import net.corda.core.identity.Party import net.corda.core.identity.Party
import net.corda.core.internal.FlowStateMachine import net.corda.core.internal.FlowStateMachine
import net.corda.core.internal.RPC_UPLOADER import net.corda.core.internal.RPC_UPLOADER
import net.corda.core.internal.STRUCTURAL_STEP_PREFIX
import net.corda.core.internal.sign import net.corda.core.internal.sign
import net.corda.core.messaging.* import net.corda.core.messaging.*
import net.corda.core.node.NodeInfo import net.corda.core.node.NodeInfo
@ -154,7 +155,7 @@ internal class CordaRPCOpsImpl(
return FlowProgressHandleImpl( return FlowProgressHandleImpl(
id = stateMachine.id, id = stateMachine.id,
returnValue = stateMachine.resultFuture, returnValue = stateMachine.resultFuture,
progress = stateMachine.logic.track()?.updates ?: Observable.empty(), progress = stateMachine.logic.track()?.updates?.filter { !it.startsWith(STRUCTURAL_STEP_PREFIX) } ?: Observable.empty(),
stepsTreeIndexFeed = stateMachine.logic.trackStepsTreeIndex(), stepsTreeIndexFeed = stateMachine.logic.trackStepsTreeIndex(),
stepsTreeFeed = stateMachine.logic.trackStepsTree() stepsTreeFeed = stateMachine.logic.trackStepsTree()
) )