Robert Mugattarov
Robert Mugattarov

Reputation: 1298

How do I get FlowSession in Initiator node in Corda?

I am trying to create a flow in Corda 3.0 and I want to send some values between the Initiator and the Acceptor nodes. I am using Java and trying to send a string from the Initiator to the Acceptor like so: otherPartyFlow.send("Hello!"); I then want to modify the string and send it back to the Initiator.

Specifying the FlowSession argument in the Acceptor constructor works fine and the value gets injected. However, once I specify the FlowSession in the Initiator's constructor I can no longer launch the flow from the interactive shell since I don't know what value to pass as the argument to the FlowSession parameter. If I simply omit the FlowSession parameter when launching the flow the shell complains that no matching constructor could be found.

I have inspected the values returned by getServiceHub() but I couldn't find anything I could use.

Upvotes: 0

Views: 105

Answers (1)

Joel
Joel

Reputation: 23140

You create a FlowSession from a Party object using initiateFlow(party).

You would generally retrieve the Party object from the network map.

Upvotes: 1

Related Questions