简体   繁体   English

Corda:Corda 中的响应者流注释 @InitiatedBy 显示不兼容的类型错误

[英]Corda : The responder flow annotation @InitiatedBy in Corda showing an incompatible types error

I am in the process of developing a CorDapp for a Three Party Atomic Transaction in Java.我正在为 Java 中的三方原子事务开发 CorDapp。

I was trying to write 2 flows - CreateAssetTransferRequestInitiatorFlow (Initiator Flow) which extends an Abstract class called AbstractCreateAssetTransferRequestFlow (This class extends FlowLogic Class) and a corresponding responder flow called CreateAssetTransferRequestResponderFlow.我试图编写 2 个流 - CreateAssetTransferRequestInitiatorFlow (Initiator Flow),它扩展了一个名为AbstractCreateAssetTransferRequestFlow的抽象类(这个类扩展了 FlowLogic 类)和一个相应的响应者流,称为 CreateAssetTransferRequestResponderFlow。

The abstract class is annotated with @InitiatingFlow and the responder flow when annotated with @InitiatedBy(AbstractCreateAssetTransferRequestFlow.class) shows an error.抽象类用@InitiatingFlow注释,当用@InitiatedBy(AbstractCreateAssetTransferRequestFlow.class)注释时,响应者流显示错误。

The error says错误说

'Found:java.lang.Class < com.template.cordapp.flows.AbstractCreateAssetTransferRequestFlow>', Required : 'java.lang.Class< ? '找到:java.lang.Class < com.template.cordapp.flows.AbstractCreateAssetTransferRequestFlow>',必需:'java.lang.Class<? extends net.corda.core.flows.FlowLogic < ?>>'扩展 net.corda.core.flows.FlowLogic < ?>>'

The abstract class extends the Flow Logic class.抽象类扩展了 Flow Logic 类。

Initiating Flow发起流程

在此处输入图片说明

Abstract Flow抽象流

在此处输入图片说明

Responder Flow响应流

在此处输入图片说明

Can someone please help me out with this.有人可以帮我解决这个问题。 Please find attached screenshots for your reference.请找到随附的屏幕截图供您参考。

Thank you谢谢

You need to remove the <SignedTransaction> part from CreateAssetTransferRequestInitiatorFlow<SignedTransction> .您需要从CreateAssetTransferRequestInitiatorFlow<SignedTransction>删除<SignedTransaction>部分。

This should help you get rid of the compilation error.这应该可以帮助您摆脱编译错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM