Customer approval flow

(OmG) #1

This is my use case for my POC and trying to find some sample code. Can you help me to get that?

  1. BankA send message to customer and asking his approval. For example, Message = Please provide your approval to see your documents as part of Onboarding process.
    Would like to send message from BankA Node.
  2. CustA receives the message and send back along with his approval / reject.
    CustA should be able to see the message in UI and send A / R from CustA node.
  3. If customer approved BankA sends approval state to Vendor1 to get required document(this would be some basic message like we sent the documents as requested)
  4. BankA just respond back to VendorA and CustA that we received the required document.

I am following below flow…

  1. Generate unsigned transactions:
    a) Create State b) Create Command and c) Build transaction using TransactionBuilder.
  2. Verify the transaction
  3. Self sign the transaction
  4. Initiate the FlowSession to send to CustA
  5. Here I have some confusion should I need to use send()(should be in Initiator call?) and receive()(should be in Acceptor call?) OR sendAndReceive() (is this function would call Acceptor?)
    Also, I am not sure how the flow (in code level) interact between Initiator() and Acceptor()?
  6. Do I need to call Finality subFlow after getting respond from CustA?
    The above flow (Banka -> CustA -> BankA) is high priority for now.
    Can you please provide/refer some sample code for above flow?