Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created March 2, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lankydan/e84bbb807801ff7cbf39ac085e0d61d7 to your computer and use it in GitHub Desktop.
Save lankydan/e84bbb807801ff7cbf39ac085e0d61d7 to your computer and use it in GitHub Desktop.
Extending and overriding Flows - Overriding a base Responder Flow
@InitiatedBy(SendMessageFlow::class)
class OverridingResponder(private val session: FlowSession) :
FlowLogic<Unit>() {
@Suspendable
override fun call() {
val stx = subFlow(object : SignTransactionFlow(session) {
override fun checkTransaction(stx: SignedTransaction) {}
})
logger.info("Screw the original responder. I'll build my own responder... with blackjack and hookers!")
subFlow(
ReceiveFinalityFlow(
otherSideSession = session,
expectedTxId = stx.id
)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment