How do I define multiple responder flows, each in a different CorDapp?












2















In Corda, I want to create several different versions of a responder flow, each to be used by a different node.



To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy annotation.



How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?










share|improve this question





























    2















    In Corda, I want to create several different versions of a responder flow, each to be used by a different node.



    To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy annotation.



    How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?










    share|improve this question



























      2












      2








      2


      2






      In Corda, I want to create several different versions of a responder flow, each to be used by a different node.



      To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy annotation.



      How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?










      share|improve this question
















      In Corda, I want to create several different versions of a responder flow, each to be used by a different node.



      To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy annotation.



      How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?







      corda






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 15:44







      Joel

















      asked Feb 5 '18 at 13:47









      JoelJoel

      10.3k11228




      10.3k11228
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Well, the question comes that,




          Why owner of CorDapp1 shares their business Flow logic
          to other? What if the business wants to keep flow implementation codebase private to them?




          I think the following would be the project structure and implementation:



          Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.





          1. cordapp-contract-states - this CorDapp contains shared contract, states, and abstract initiating flows will be used by counter-parties to implement their responder flow logic. This CorDapp shared with all required counterparties.



            @InitiatingFlow
            abstract class CreateTradeBaseFlow : FlowLogic {



            }




          2. cordapp-partyA - this CorDapp contains FlowLogic implementation for create trade.




            @StartableByRPC
            class CreateTradeFlow : CreateTradeBaseFlow {
            //Actual implementation of initiator flow goes here...
            }




          3. cordapp-partyB - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



            @InitiatedBy(CreateTradeBaseFlow::class)
            class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
            //implementation of responder flow goes here...
            }




          4. cordapp-partyC - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



            @InitiatedBy(CreateTradeBaseFlow::class)
            class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
            //implementation of responder flow goes here...
            }




          What's your thought?






          share|improve this answer

































            3














            You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.



            For example, suppose CorDapp 1 defines the following initiating flow:



            @InitiatingFlow
            @StartableByRPC
            class Initiator : FlowLogic<Unit>() {
            ...
            }


            Then you have CorDapp 2A which defines the following responder flow:



            @InitiatedBy(Initiator::class)
            @StartableByRPC
            class ResponderA : FlowLogic<Unit>() {
            ...
            }


            And CorDapp 2B which defines the following responder flow:



            @InitiatedBy(Initiator::class)
            @StartableByRPC
            class ResponderB : FlowLogic<Unit>() {
            ...
            }


            CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.






            share|improve this answer

























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48624039%2fhow-do-i-define-multiple-responder-flows-each-in-a-different-cordapp%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Well, the question comes that,




              Why owner of CorDapp1 shares their business Flow logic
              to other? What if the business wants to keep flow implementation codebase private to them?




              I think the following would be the project structure and implementation:



              Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.





              1. cordapp-contract-states - this CorDapp contains shared contract, states, and abstract initiating flows will be used by counter-parties to implement their responder flow logic. This CorDapp shared with all required counterparties.



                @InitiatingFlow
                abstract class CreateTradeBaseFlow : FlowLogic {



                }




              2. cordapp-partyA - this CorDapp contains FlowLogic implementation for create trade.




                @StartableByRPC
                class CreateTradeFlow : CreateTradeBaseFlow {
                //Actual implementation of initiator flow goes here...
                }




              3. cordapp-partyB - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                @InitiatedBy(CreateTradeBaseFlow::class)
                class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                //implementation of responder flow goes here...
                }




              4. cordapp-partyC - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                @InitiatedBy(CreateTradeBaseFlow::class)
                class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                //implementation of responder flow goes here...
                }




              What's your thought?






              share|improve this answer






























                1














                Well, the question comes that,




                Why owner of CorDapp1 shares their business Flow logic
                to other? What if the business wants to keep flow implementation codebase private to them?




                I think the following would be the project structure and implementation:



                Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.





                1. cordapp-contract-states - this CorDapp contains shared contract, states, and abstract initiating flows will be used by counter-parties to implement their responder flow logic. This CorDapp shared with all required counterparties.



                  @InitiatingFlow
                  abstract class CreateTradeBaseFlow : FlowLogic {



                  }




                2. cordapp-partyA - this CorDapp contains FlowLogic implementation for create trade.




                  @StartableByRPC
                  class CreateTradeFlow : CreateTradeBaseFlow {
                  //Actual implementation of initiator flow goes here...
                  }




                3. cordapp-partyB - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                  @InitiatedBy(CreateTradeBaseFlow::class)
                  class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                  //implementation of responder flow goes here...
                  }




                4. cordapp-partyC - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                  @InitiatedBy(CreateTradeBaseFlow::class)
                  class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                  //implementation of responder flow goes here...
                  }




                What's your thought?






                share|improve this answer




























                  1












                  1








                  1







                  Well, the question comes that,




                  Why owner of CorDapp1 shares their business Flow logic
                  to other? What if the business wants to keep flow implementation codebase private to them?




                  I think the following would be the project structure and implementation:



                  Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.





                  1. cordapp-contract-states - this CorDapp contains shared contract, states, and abstract initiating flows will be used by counter-parties to implement their responder flow logic. This CorDapp shared with all required counterparties.



                    @InitiatingFlow
                    abstract class CreateTradeBaseFlow : FlowLogic {



                    }




                  2. cordapp-partyA - this CorDapp contains FlowLogic implementation for create trade.




                    @StartableByRPC
                    class CreateTradeFlow : CreateTradeBaseFlow {
                    //Actual implementation of initiator flow goes here...
                    }




                  3. cordapp-partyB - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                    @InitiatedBy(CreateTradeBaseFlow::class)
                    class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                    //implementation of responder flow goes here...
                    }




                  4. cordapp-partyC - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                    @InitiatedBy(CreateTradeBaseFlow::class)
                    class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                    //implementation of responder flow goes here...
                    }




                  What's your thought?






                  share|improve this answer















                  Well, the question comes that,




                  Why owner of CorDapp1 shares their business Flow logic
                  to other? What if the business wants to keep flow implementation codebase private to them?




                  I think the following would be the project structure and implementation:



                  Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.





                  1. cordapp-contract-states - this CorDapp contains shared contract, states, and abstract initiating flows will be used by counter-parties to implement their responder flow logic. This CorDapp shared with all required counterparties.



                    @InitiatingFlow
                    abstract class CreateTradeBaseFlow : FlowLogic {



                    }




                  2. cordapp-partyA - this CorDapp contains FlowLogic implementation for create trade.




                    @StartableByRPC
                    class CreateTradeFlow : CreateTradeBaseFlow {
                    //Actual implementation of initiator flow goes here...
                    }




                  3. cordapp-partyB - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                    @InitiatedBy(CreateTradeBaseFlow::class)
                    class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                    //implementation of responder flow goes here...
                    }




                  4. cordapp-partyC - this CorDapp contain responder flow for CreateTradeFlow and other business specific flowlogic implementation.



                    @InitiatedBy(CreateTradeBaseFlow::class)
                    class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
                    //implementation of responder flow goes here...
                    }




                  What's your thought?







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jun 15 '18 at 7:20

























                  answered Jun 15 '18 at 5:03









                  Balaji MoreBalaji More

                  18710




                  18710

























                      3














                      You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.



                      For example, suppose CorDapp 1 defines the following initiating flow:



                      @InitiatingFlow
                      @StartableByRPC
                      class Initiator : FlowLogic<Unit>() {
                      ...
                      }


                      Then you have CorDapp 2A which defines the following responder flow:



                      @InitiatedBy(Initiator::class)
                      @StartableByRPC
                      class ResponderA : FlowLogic<Unit>() {
                      ...
                      }


                      And CorDapp 2B which defines the following responder flow:



                      @InitiatedBy(Initiator::class)
                      @StartableByRPC
                      class ResponderB : FlowLogic<Unit>() {
                      ...
                      }


                      CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.






                      share|improve this answer






























                        3














                        You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.



                        For example, suppose CorDapp 1 defines the following initiating flow:



                        @InitiatingFlow
                        @StartableByRPC
                        class Initiator : FlowLogic<Unit>() {
                        ...
                        }


                        Then you have CorDapp 2A which defines the following responder flow:



                        @InitiatedBy(Initiator::class)
                        @StartableByRPC
                        class ResponderA : FlowLogic<Unit>() {
                        ...
                        }


                        And CorDapp 2B which defines the following responder flow:



                        @InitiatedBy(Initiator::class)
                        @StartableByRPC
                        class ResponderB : FlowLogic<Unit>() {
                        ...
                        }


                        CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.






                        share|improve this answer




























                          3












                          3








                          3







                          You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.



                          For example, suppose CorDapp 1 defines the following initiating flow:



                          @InitiatingFlow
                          @StartableByRPC
                          class Initiator : FlowLogic<Unit>() {
                          ...
                          }


                          Then you have CorDapp 2A which defines the following responder flow:



                          @InitiatedBy(Initiator::class)
                          @StartableByRPC
                          class ResponderA : FlowLogic<Unit>() {
                          ...
                          }


                          And CorDapp 2B which defines the following responder flow:



                          @InitiatedBy(Initiator::class)
                          @StartableByRPC
                          class ResponderB : FlowLogic<Unit>() {
                          ...
                          }


                          CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.






                          share|improve this answer















                          You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.



                          For example, suppose CorDapp 1 defines the following initiating flow:



                          @InitiatingFlow
                          @StartableByRPC
                          class Initiator : FlowLogic<Unit>() {
                          ...
                          }


                          Then you have CorDapp 2A which defines the following responder flow:



                          @InitiatedBy(Initiator::class)
                          @StartableByRPC
                          class ResponderA : FlowLogic<Unit>() {
                          ...
                          }


                          And CorDapp 2B which defines the following responder flow:



                          @InitiatedBy(Initiator::class)
                          @StartableByRPC
                          class ResponderB : FlowLogic<Unit>() {
                          ...
                          }


                          CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 6 '18 at 11:40

























                          answered Feb 5 '18 at 13:47









                          JoelJoel

                          10.3k11228




                          10.3k11228






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48624039%2fhow-do-i-define-multiple-responder-flows-each-in-a-different-cordapp%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Full-time equivalent

                              さくらももこ

                              13 indicted, 8 arrested in Calif. drug cartel investigation