Skip to content

补偿式工作流

Jay Meng edited this page Feb 22, 2023 · 8 revisions
stfs {
  local-vars {
    dp = com.stun4j.stf.sample.domain
  }
  actions {
    acceptReq {
      args = [{use-in:{class:${dp}.Req}}]
    }
    step1Tx {
      args = [{invoke-on-in:{method:getId, class:Long}}, {invoke-on-in:{method:getReqId, class:String}}]
    }
    step2Tx {
      args = [{use-in:{class:${dp}.Tx}}]
    }
    endTx {
      args = [{use-in:{class:${dp}.Tx}}]
    }
    sendNotification {
      oid = bizApp
      args = [{use-in:{class:String}}]
      timeout = 10s
    }
  }
  forwards {
    acceptReq.to = step1Tx
    step1Tx.to = step2Tx
    step2Tx.to = endTx
    endTx.to = sendNotification
  }
}
Clone this wiki locally