viswa
viswa

Reputation: 93

when will the responder flow gets call in the Initiator flow?

I am just confused when the responder flow gets executed in flow class and that responder checks and signing the transcation?

Upvotes: 0

Views: 126

Answers (1)

Joel
Joel

Reputation: 23140

There are two types of flow annotations:

  • InitiatingFlow, which is used to annotate flows that are started directly (either by other flows, by a service, or via RPC)
  • InitiatedBy, which is used to annotate flows that the node starts in response to messages from other flows. This annotation takes as its only argument the name of an InitiatingFlow class

When a node receives a message from a flow running on another node, it goes through the following process:

  • It checks whether it has a flow installed that is InitiatedBy the flow it has a received a message from

    • If it does, it invokes that flow to commence communication with the InitiatingFlow

    • If it does not, it throws an exception

So a responder flow instance gets created every time the node receives a message from the responder flow's InitiatedBy flow. This flow "stays alive" until it has finished communicating with the InitiatedBy flow instance.

Upvotes: 2

Related Questions