Merge pull request #22 from corda/CORE-11842-comment-updates
CORE-11842 comment updates
This commit is contained in:
commit
30a18f8572
@ -11,10 +11,10 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
// MyFirstFlow is an initiating flow, it's corresponding responder flow is called MyFirstFlowResponder (defined below)
|
||||
// MyFirstFlow is an initiating flow, its corresponding responder flow is called MyFirstFlowResponder (defined below)
|
||||
// to link the two sides of the flow together they need to have the same protocol.
|
||||
@InitiatingFlow(protocol = "my-first-flow")
|
||||
// MyFirstFlow should inherit from RPCStartableFlow, which tells Corda it can be started via an RPC call
|
||||
// MyFirstFlow should inherit from ClientStartableFlow, which tells Corda it can be started via an REST call
|
||||
public class MyFirstFlow implements ClientStartableFlow {
|
||||
|
||||
// Log messages from the flows for debugging.
|
||||
@ -78,19 +78,18 @@ public class MyFirstFlow implements ClientStartableFlow {
|
||||
// Receive a response from the responder flow.
|
||||
Message response = session.receive(Message.class);
|
||||
|
||||
// The return value of a RPCStartableFlow must always be a String. This will be passed
|
||||
// back as the REST RPC response when the status of the flow is queried on Corda, or as the return
|
||||
// value from the flow when testing using the simulator.
|
||||
// The return value of a ClientStartableFlow must always be a String. This will be passed
|
||||
// back as the REST response when the status of the flow is queried on Corda.
|
||||
return response.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
RequestBody for triggering the flow via http-rpc:
|
||||
RequestBody for triggering the flow via REST:
|
||||
{
|
||||
"clientRequestId": "r1",
|
||||
"flowClassName": "com.r3.developers.csdetemplate.flowexample.workflows.MyFirstFlow",
|
||||
"requestData": {
|
||||
"requestBody": {
|
||||
"otherMember":"CN=Bob, OU=Test Dept, O=R3, L=London, C=GB"
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ public class MyFirstFlowResponder implements ResponderFlow {
|
||||
|
||||
// Responder flows are invoked when an initiating flow makes a call via a session set up with the virtual
|
||||
// node hosting the responder flow. When a responder flow is invoked its call() method is called.
|
||||
// Call() methods must be marked as @Suspendable, this allows Corda to pause mid-execution to wait
|
||||
// call() methods must be marked as @Suspendable, this allows Corda to pause mid-execution to wait
|
||||
// for a response from the other flows and services.
|
||||
// The Call method has the flow session passed in as a parameter by Corda so the session is available to
|
||||
// The call() method has the flow session passed in as a parameter by Corda so the session is available to
|
||||
// responder flow code, you don't need to inject the FlowMessaging service.
|
||||
@Suspendable
|
||||
@Override
|
||||
|
@ -120,7 +120,7 @@ public class CreateNewChatFlow implements ClientStartableFlow {
|
||||
}
|
||||
|
||||
/*
|
||||
RequestBody for triggering the flow via http-rpc:
|
||||
RequestBody for triggering the flow via REST:
|
||||
{
|
||||
"clientRequestId": "create-1",
|
||||
"flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.CreateNewChatFlow",
|
||||
|
@ -106,7 +106,7 @@ public class GetChatFlow implements ClientStartableFlow {
|
||||
}
|
||||
|
||||
/*
|
||||
RequestBody for triggering the flow via http-rpc:
|
||||
RequestBody for triggering the flow via REST:
|
||||
{
|
||||
"clientRequestId": "get-1",
|
||||
"flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.GetChatFlow",
|
||||
|
@ -49,7 +49,7 @@ public class ListChatsFlow implements ClientStartableFlow {
|
||||
}
|
||||
|
||||
/*
|
||||
RequestBody for triggering the flow via http-rpc:
|
||||
RequestBody for triggering the flow via REST:
|
||||
{
|
||||
"clientRequestId": "list-1",
|
||||
"flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.ListChatsFlow",
|
||||
|
@ -108,7 +108,7 @@ public class UpdateChatFlow implements ClientStartableFlow {
|
||||
}
|
||||
|
||||
/*
|
||||
RequestBody for triggering the flow via http-rpc:
|
||||
RequestBody for triggering the flow via REST:
|
||||
{
|
||||
"clientRequestId": "update-1",
|
||||
"flowClassName": "com.r3.developers.csdetemplate.utxoexample.workflows.UpdateChatFlow",
|
||||
|
Loading…
Reference in New Issue
Block a user