Corda:StateRef在计划活动中的使用情况

Corda:StateRef在计划活动中的使用情况,corda,Corda,当错误消息声明时,我在哪里提供构造函数输入?我不确定在安排活动时StateRef的正确用法。我成功地运行了Heartbeat应用程序来测试基本用法 转发状态: data class ForwardState(val initiator: Party, val acceptor: Party, val asset: String, val deliveryPrice: BigDecimal, val startDate: Instant, val settlementDate: Instant,

当错误消息声明时,我在哪里提供构造函数输入?我不确定在安排活动时StateRef的正确用法。我成功地运行了Heartbeat应用程序来测试基本用法

转发状态:

data class ForwardState(val initiator: Party, val acceptor: Party, val asset: String, val deliveryPrice: BigDecimal, val startDate: Instant, val settlementDate: Instant, val buySell: String) : SchedulableState {
    override val participants get() = listOf(initiator, acceptor)

    override fun nextScheduledActivity(thisStateRef: StateRef, flowLogicRefFactory: FlowLogicRefFactory): ScheduledActivity? {
        return ScheduledActivity(flowLogicRefFactory.create("com.template.ForwardSettleFlow"), settlementDate)
}
正向流:

@InitiatingFlow
@StartableByRPC
class ForwardFlow(val initiator: Party, val acceptor: Party, val asset: String, val deliveryPrice: BigDecimal,
              val startDate: Instant, val settlementDate: Instant, val buySell: String) : FlowLogic<Unit>() {

companion object {
    object GENERATING_TRANSACTION : ProgressTracker.Step("Generating transaction")
    object SIGNING_TRANSACTION : ProgressTracker.Step("Signing transaction with our private key")
    object FINALISING_TRANSACTION : ProgressTracker.Step("Recording transaction") {
        override fun childProgressTracker() = FinalityFlow.tracker()
    }

    fun tracker() = ProgressTracker(
            GENERATING_TRANSACTION,
            SIGNING_TRANSACTION,
            FINALISING_TRANSACTION
    )
}

override val progressTracker = tracker()

@Suspendable
override fun call() { 
    // Adapted from hello world pt 1/2
}
}

我相信这会阻止活动的发生,包括测试期间合同为空且无任何要求的情况。

FlowLogicRefFactory.create()
具有以下构造函数:

override fun create(flowClass: Class<out FlowLogic<*>>, vararg args: Any?): FlowLogicRef {
但是没有接受零参数的
ForwardSettleFlow
构造函数:

class ForwardSettleFlow(val initiator: Party, val acceptor: Party, val asset: String, 
    val deliveryPrice: BigDecimal, val startDate: Instant, val settlementDate: Instant, 
    val buySell: String, val thisStateRef: StateRef) : FlowLogic<Unit>() {
class ForwardSettleFlow(val发起方:参与方,val接受方:参与方,val资产:字符串,
val交货价格:大十进制,val起始日期:即时,val结算日期:即时,
val buySell:String,val thisStateRef:StateRef:FlowLogic(){
因此会出现“缺少构造函数”异常。您需要更新
ForwardSettleFlow
以拥有零参数构造函数,或者需要将一些参数传递给
FlowLogicRefFactory.create()

override fun create(flowClass: Class<out FlowLogic<*>>, vararg args: Any?): FlowLogicRef {
flowLogicRefFactory.create("com.template.ForwardSettleFlow")
class ForwardSettleFlow(val initiator: Party, val acceptor: Party, val asset: String, 
    val deliveryPrice: BigDecimal, val startDate: Instant, val settlementDate: Instant, 
    val buySell: String, val thisStateRef: StateRef) : FlowLogic<Unit>() {