initiate Flow
Creates a communication session with a counterparty's ResponderFlow. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
Initiated flows are initiated with context based on the context of the initiating flow at the point in time this method is called. The context of the initiating flow is snapshotted by the returned session. Altering the flow context has no effect on the context of the session after this point, and therefore it has no effect on the context of the initiated flow either.
Return
The session.
Parameters
The X500 name of the member to communicate with.
Creates a communication session with a counterparty's ResponderFlow. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
Initiated flows are initiated with context based on the context of the initiating flow at the point in time this method is called. The context of the initiating flow is snapshotted by the returned session. Altering the flow context has no effect on the context of the session after this point, and therefore it has no effect on the context of the initiated flow either.
Return
The session.
Parameters
The X500 name of the member to communicate with.
Session configuration (see FlowSessionConfiguration).
Creates a communication session with another member. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
This overload takes a builder of context properties. Any properties set or modified against the context passed to this builder will be propagated to initiated flows and all that flow's initiated flows and sub flows down the stack. The properties passed to the builder are pre-populated with the current flow context properties, see FlowContextProperties. Altering the current flow context has no effect on the context of the session after the builder is applied and the session returned by this method, and therefore it has no effect on the context of the initiated flow either.
Example of use in Kotlin. ```Kotlin val flowSession = flowMessaging.initiateFlow(virtualNodeName) { flowContextProperties -> flowContextProperties["key"] = "value" } ``` Example of use in Java. ```Java FlowSession flowSession = flowMessaging.initiateFlow(virtualNodeName, (flowContextProperties) -> { flowContextProperties.put("key", "value"); }); ```
Return
The session.
Parameters
The X500 name of the member to communicate with.
A builder of context properties.
Throws
if the builder tries to set a property for which a platform property already exists or if the key is prefixed by CORDA_RESERVED_PREFIX. See also FlowContextProperties. Any other exception thrown by the builder will also be thrown through here and should be avoided in the provided implementation, see FlowContextPropertiesBuilder.
Creates a communication session with another member. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
This overload takes a builder of context properties. Any properties set or modified against the context passed to this builder will be propagated to initiated flows and all that flow's initiated flows and sub flows down the stack. The properties passed to the builder are pre-populated with the current flow context properties, see FlowContextProperties. Altering the current flow context has no effect on the context of the session after the builder is applied and the session returned by this method, and therefore it has no effect on the context of the initiated flow either.
Example of use in Kotlin. ```Kotlin val sessionConfig = FlowSessionConfiguration.Builder().requireClose(false).build() val flowSession = flowMessaging.initiateFlow(virtualNodeName, sessionConfig) { flowContextProperties -> flowContextProperties["key"] = "value" } ``` Example of use in Java. ```Java FlowSessionConfiguration sessionConfig = new FlowSessionConfiguration.Builder().requireClose(false).build(); FlowSession flowSession = flowMessaging.initiateFlow(virtualNodeName, sessionConfig, (flowContextProperties) -> { flowContextProperties.put("key", "value"); }); ```
Return
The session.
Parameters
The X500 name of the member to communicate with.
Session configuration (see FlowSessionConfiguration).
A builder of context properties.
Throws
if the builder tries to set a property for which a platform property already exists or if the key is prefixed by CORDA_RESERVED_PREFIX. See also FlowContextProperties. Any other exception thrown by the builder will also be thrown through here and should be avoided in the provided implementation, see FlowContextPropertiesBuilder.
Deprecated
Creates a communication session with a counterparty's ResponderFlow. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
Initiated flows are initiated with context based on the context of the initiating flow at the point in time this method is called. The context of the initiating flow is snapshotted by the returned session. Altering the flow context has no effect on the context of the session after this point, and therefore it has no effect on the context of the initiated flow either.
Deprecated
UseinitiateFlow instead.
Return
The session.
Parameters
The X500 name of the member to communicate with.
When set to true, the initiated party will send a close message after calling FlowSession.close() and the initiating party will suspend and wait to receive the message when they call FlowSession.close(). When set to false the session is marked as terminated immediately when close() is called.
Deprecated
Creates a communication session with another member. Subsequently, you may send/receive using this session object. Note that this function does not communicate in itself. The counter-flow will be kicked off by the first send/receive.
This overload takes a builder of context properties. Any properties set or modified against the context passed to this builder will be propagated to initiated flows and all that flow's initiated flows and sub flows down the stack. The properties passed to the builder are pre-populated with the current flow context properties, see FlowContextProperties. Altering the current flow context has no effect on the context of the session after the builder is applied and the session returned by this method, and therefore it has no effect on the context of the initiated flow either.
Example of use in Kotlin. ```Kotlin val flowSession = flowMessaging.initiateFlow(virtualNodeName) { flowContextProperties -> flowContextProperties["key"] = "value" } ``` Example of use in Java. ```Java FlowSession flowSession = flowMessaging.initiateFlow(virtualNodeName, (flowContextProperties) -> { flowContextProperties.put("key", "value"); }); ```
Deprecated
UseinitiateFlow instead.
Return
The session.
Parameters
The X500 name of the member to communicate with.
When set to true, the initiated party will send a close message after calling FlowSession.close() and the initiating party will suspend and wait to receive the message when they call FlowSession.close(). When set to false the session is marked as terminated immediately when close() is called.
A builder of context properties.
Throws
if the builder tries to set a property for which a platform property already exists or if the key is prefixed by CORDA_RESERVED_PREFIX. See also FlowContextProperties. Any other exception thrown by the builder will also be thrown through here and should be avoided in the provided implementation, see FlowContextPropertiesBuilder.