FlowSession docs (#1660)

This commit is contained in:
Andras Slemmer
2017-09-27 15:33:09 +01:00
committed by josecoll
parent 512de2690d
commit 72cff032e6
5 changed files with 171 additions and 36 deletions

View File

@ -567,6 +567,13 @@ public class FlowCookbookJava {
SignedTransaction notarisedTx2 = subFlow(new FinalityFlow(fullySignedTx, additionalParties, FINALISATION.childProgressTracker()));
// DOCEND 10
// DOCSTART FlowSession porting
send(regulator, new Object()); // Old API
// becomes
FlowSession session = initiateFlow(regulator);
session.send(new Object());
// DOCEND FlowSession porting
return null;
}
}

View File

@ -121,6 +121,10 @@ object FlowCookbook {
throw IllegalArgumentException("Couldn't find counterparty with key: $dummyPubKey in identity service")
// DOCEND 2
// DOCSTART initiateFlow
val counterpartySession = initiateFlow(counterparty)
// DOCEND initiateFlow
/**-----------------------------
* SENDING AND RECEIVING DATA *
-----------------------------**/
@ -137,7 +141,6 @@ object FlowCookbook {
// registered to respond to this flow, and has a corresponding
// ``receive`` call.
// DOCSTART 4
val counterpartySession = initiateFlow(counterparty)
counterpartySession.send(Any())
// DOCEND 4
@ -496,7 +499,7 @@ object FlowCookbook {
// other required signers using ``CollectSignaturesFlow``.
// The responder flow will need to call ``SignTransactionFlow``.
// DOCSTART 15
val fullySignedTx: SignedTransaction = subFlow(CollectSignaturesFlow(twiceSignedTx, emptySet(), SIGS_GATHERING.childProgressTracker()))
val fullySignedTx: SignedTransaction = subFlow(CollectSignaturesFlow(twiceSignedTx, setOf(counterpartySession, regulatorSession), SIGS_GATHERING.childProgressTracker()))
// DOCEND 15
/**-----------------------
@ -540,6 +543,13 @@ object FlowCookbook {
val additionalParties: Set<Party> = setOf(regulator)
val notarisedTx2: SignedTransaction = subFlow(FinalityFlow(fullySignedTx, additionalParties, FINALISATION.childProgressTracker()))
// DOCEND 10
// DOCSTART FlowSession porting
send(regulator, Any()) // Old API
// becomes
val session = initiateFlow(regulator)
session.send(Any())
// DOCEND FlowSession porting
}
}