Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extending and overriding Flows - Extending a Responder Flow
@InitiatedBy(SendMessageFlow::class)
class CassandraSendMessageResponder(session: FlowSession) :
SendMessageResponder(session) {
override fun postTransactionSigned(transaction: SignedTransaction) {
val message = transaction.coreTransaction.outputsOfType<MessageState>().single()
logger.info("Signed transaction for message: $message")
}
override fun postTransactionCommitted(transaction: SignedTransaction) {
val message = transaction.coreTransaction.outputsOfType<MessageState>().single()
serviceHub.cordaService(MessageRepository::class.java).save(
message,
sender = false,
committed = true
)
logger.info("Committed transaction for message: $message")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.