mirror of
https://github.com/corda/corda.git
synced 2025-06-22 00:57:21 +00:00
Add information on why state machine was removed from StateMachineManager (#570)
* Add information on why state machine was removed from StateMachineManager. There are two cases: normal end of flow or error. Return flow result as part of state machine remove data. Make Change a sealed class with Add and Remove. fiber.actionOnEnd takes ErrorOr<R> parameter. * Remove unnecessary fields from StateMachineManager.Change.
This commit is contained in:
committed by
GitHub
parent
b597f05bd4
commit
f92949d3b5
@ -20,7 +20,7 @@ import net.corda.node.internal.AbstractNode
|
||||
import net.corda.node.internal.NetworkMapInfo
|
||||
import net.corda.node.services.config.*
|
||||
import net.corda.node.services.statemachine.FlowStateMachineImpl
|
||||
import net.corda.node.utilities.AddOrRemove.ADD
|
||||
import net.corda.node.services.statemachine.StateMachineManager
|
||||
import net.corda.nodeapi.User
|
||||
import net.corda.nodeapi.config.SSLConfiguration
|
||||
import net.corda.testing.node.MockIdentityService
|
||||
@ -146,7 +146,7 @@ fun getFreeLocalPorts(hostName: String, numberToAlloc: Int): List<HostAndPort> {
|
||||
inline fun <reified P : FlowLogic<*>> AbstractNode.initiateSingleShotFlow(
|
||||
markerClass: KClass<out FlowLogic<*>>,
|
||||
noinline flowFactory: (Party) -> P): ListenableFuture<P> {
|
||||
val future = smm.changes.filter { it.addOrRemove == ADD && it.logic is P }.map { it.logic as P }.toFuture()
|
||||
val future = smm.changes.filter { it is StateMachineManager.Change.Add && it.logic is P }.map { it.logic as P }.toFuture()
|
||||
services.registerFlowInitiator(markerClass.java, flowFactory)
|
||||
return future
|
||||
}
|
||||
|
Reference in New Issue
Block a user