ReceiveTransactionFlow
Keywords: net.corda.core.flows.ReceiveTransactionFlow class
Date: 2023-09-18

net.corda.core.flows

## Class ReceiveTransactionFlow

- net.corda.core.flows.FlowLogic<T>
- - net.corda.core.flows.ReceiveTransactionFlow

-     public class ReceiveTransactionFlow
      extends FlowLogic<T>

  The `class ReceiveTransactionFlow` should be called in response to the `class SendTransactionFlow`.

  This flow is a combination of FlowSession.receive, resolve and `SignedTransaction.verify`. This flow will receive the `class SignedTransaction` and perform the resolution back-and-forth required to check the dependencies and download any missing attachments. The flow will return the `class SignedTransaction` after it is resolved and then verified using `SignedTransaction.verify`.

  Please note that it will not store the transaction to the vault unless that is explicitly requested and checkSufficientSignatures is true. Setting statesToRecord to anything else when checkSufficientSignatures is false will not update the vault.

  Attention: At the moment, this flow receives a `class SignedTransaction` first thing and then proceeds by invoking a ResolveTransactionsFlow subflow. This is used as a criterion to identify cases, where a counterparty has failed notarising a transact

  See Also:
    `class ReceiveTransactionFlow`, `class SendTransactionFlow`, `SignedTransaction.verify`, `class SignedTransaction`, `class SignedTransaction`, `SignedTransaction.verify`, `class SignedTransaction`

- - ### Constructor Detail

    - #### ReceiveTransactionFlow

          @JvmOverloads
          public ReceiveTransactionFlow(@NotNull
                                                      FlowSession otherSideSession,
                                                      boolean checkSufficientSignatures,
                                                      @NotNull
                                                      StatesToRecord statesToRecord)

      The `class ReceiveTransactionFlow` should be called in response to the `class SendTransactionFlow`.

      This flow is a combination of FlowSession.receive, resolve and `SignedTransaction.verify`. This flow will receive the `class SignedTransaction` and perform the resolution back-and-forth required to check the dependencies and download any missing attachments. The flow will return the `class SignedTransaction` after it is resolved and then verified using `SignedTransaction.verify`.

      Please note that it will not store the transaction to the vault unless that is explicitly requested and checkSufficientSignatures is true. Setting statesToRecord to anything else when checkSufficientSignatures is false will not update the vault.

      Attention: At the moment, this flow receives a `class SignedTransaction` first thing and then proceeds by invoking a ResolveTransactionsFlow subflow. This is used as a criterion to identify cases, where a counterparty has failed notarising a transact

      Parameters:
        `otherSideSession` - session to the other side which is calling `class SendTransactionFlow`.
        `checkSufficientSignatures` - if true checks all required signatures are present. See `SignedTransaction.verify`.
        `statesToRecord` - which transaction states should be recorded in the vault, if any.
      See Also:
        `class ReceiveTransactionFlow`, `class SendTransactionFlow`, `SignedTransaction.verify`, `class SignedTransaction`, `class SignedTransaction`, `SignedTransaction.verify`, `class SignedTransaction`

    - #### ReceiveTransactionFlow

          @JvmOverloads
          public ReceiveTransactionFlow(@NotNull
                                                      FlowSession otherSideSession,
                                                      boolean checkSufficientSignatures)

      The `class ReceiveTransactionFlow` should be called in response to the `class SendTransactionFlow`.

      This flow is a combination of FlowSession.receive, resolve and `SignedTransaction.verify`. This flow will receive the `class SignedTransaction` and perform the resolution back-and-forth required to check the dependencies and download any missing attachments. The flow will return the `class SignedTransaction` after it is resolved and then verified using `SignedTransaction.verify`.

      Please note that it will not store the transaction to the vault unless that is explicitly requested and checkSufficientSignatures is true. Setting statesToRecord to anything else when checkSufficientSignatures is false will not update the vault.

      Attention: At the moment, this flow receives a `class SignedTransaction` first thing and then proceeds by invoking a ResolveTransactionsFlow subflow. This is used as a criterion to identify cases, where a counterparty has failed notarising a transact

      Parameters:
        `otherSideSession` - session to the other side which is calling `class SendTransactionFlow`.
        `checkSufficientSignatures` - if true checks all required signatures are present. See `SignedTransaction.verify`.
      See Also:
        `class ReceiveTransactionFlow`, `class SendTransactionFlow`, `SignedTransaction.verify`, `class SignedTransaction`, `class SignedTransaction`, `SignedTransaction.verify`, `class SignedTransaction`

    - #### ReceiveTransactionFlow

          @JvmOverloads
          public ReceiveTransactionFlow(@NotNull
                                                      FlowSession otherSideSession)

      The `class ReceiveTransactionFlow` should be called in response to the `class SendTransactionFlow`.

      This flow is a combination of FlowSession.receive, resolve and `SignedTransaction.verify`. This flow will receive the `class SignedTransaction` and perform the resolution back-and-forth required to check the dependencies and download any missing attachments. The flow will return the `class SignedTransaction` after it is resolved and then verified using `SignedTransaction.verify`.

      Please note that it will not store the transaction to the vault unless that is explicitly requested and checkSufficientSignatures is true. Setting statesToRecord to anything else when checkSufficientSignatures is false will not update the vault.

      Attention: At the moment, this flow receives a `class SignedTransaction` first thing and then proceeds by invoking a ResolveTransactionsFlow subflow. This is used as a criterion to identify cases, where a counterparty has failed notarising a transact

      Parameters:
        `otherSideSession` - session to the other side which is calling `class SendTransactionFlow`.
      See Also:
        `class ReceiveTransactionFlow`, `class SendTransactionFlow`, `SignedTransaction.verify`, `class SignedTransaction`, `class SignedTransaction`, `SignedTransaction.verify`, `class SignedTransaction`

  - ### Method Detail

    - #### call

          @Suspendable
           @NotNull
          public SignedTransaction call()

      This is where you fill out your business logic.

    - #### checkBeforeRecording

          @Suspendable
          protected void checkBeforeRecording(@NotNull
                                                           SignedTransaction stx)

      Hook to perform extra checks on the received transaction just before it's recorded. The transaction has already been resolved and verified at this point.