{
  "Name": "u38SagaObservation",
  "Comment": "独有合成订单的正常、补偿失败和人工重试实验",
  "StartState": "Reserve",
  "Version": "0.0.1",
  "States": {
    "Reserve": {
      "Type": "ServiceTask", "ServiceName": "inventoryService", "ServiceMethod": "reserve",
      "CompensateState": "Release", "Next": "Charge",
      "Input": [{"key": "$.[orderKey]"}], "Output": {"reserveResult": "$.#root"},
      "Status": {"$Exception{study.saga.ExpectedFailure}": "UN", "#root != null": "SU", "#root == null": "FA"}
    },
    "Charge": {
      "Type": "ServiceTask", "ServiceName": "inventoryService", "ServiceMethod": "charge",
      "Next": "Succeed", "Input": [{"key": "$.[orderKey]", "fail": "$.[chargeFail]"}],
      "Status": {"$Exception{study.saga.ExpectedFailure}": "UN", "#root != null": "SU", "#root == null": "FA"},
      "Catch": [{"Exceptions": ["study.saga.ExpectedFailure"], "Next": "CompensationTrigger"}]
    },
    "Release": {
      "Type": "ServiceTask", "ServiceName": "inventoryService", "ServiceMethod": "release",
      "Input": [{"key": "$.[orderKey]", "fail": "$.[compensationFail]"}],
      "Status": {"$Exception{study.saga.ExpectedFailure}": "UN", "#root != null": "SU", "#root == null": "FA"}
    },
    "CompensationTrigger": {"Type": "CompensationTrigger", "Next": "Fail"},
    "Succeed": {"Type": "Succeed"},
    "Fail": {"Type": "Fail", "ErrorCode": "SIMULATED", "Message": "simulated charge failure"}
  }
}
