如何在同一个 CorDapp 中测试两个不同的响应者流程?

How can I test two different responder flows in the same CorDapp?

我有以下系列流程:

通常情况下,这两个响应流将在单独的 CorDapps 中定义。但是,出于测试目的,我将它们定义在同一个文件中。

当我 运行 进行流量测试时,出现以下错误。我该如何解决这个问题?

java.lang.IllegalArgumentException: com.template.Initiator has been specified as the initiating flow by both com.template.BobResponder and com.template.AliceResponder

您需要在不同的包中定义响应程序。例如,如果 AliceFlowcom.template 中定义,BobFlow 可以在 com.template2 中定义。

然后,在您的流程中,注册两个包:

setCordappPackages("com.template", "com.template2")