{
  "metadata" : {
    "triggers" : [ {
      "event" : "AUDIT_EVENT",
      "className" : "click.kamil.examples.enterprise.api.SecurityInterceptor",
      "methodName" : "preHandle",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/SecurityInterceptor.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 17,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    }, {
      "event" : "PLACE_ORDER",
      "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
      "methodName" : "place",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 16,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    }, {
      "event" : "CANCEL_ORDER",
      "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
      "methodName" : "cancel",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 21,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    }, {
      "event" : "PAY_ORDER",
      "className" : "click.kamil.examples.enterprise.service.ReactivePaymentService",
      "methodName" : "processPayment",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/ReactivePaymentService.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 18,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    }, {
      "event" : "SHIP_ORDER",
      "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener",
      "methodName" : "onShippingReady",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ShippingJmsListener.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 17,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    }, {
      "event" : "RETURN_ORDER",
      "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener",
      "methodName" : "onReturn",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ReturnsRabbitListener.java",
      "sourceModule" : null,
      "stateMachineId" : null,
      "sourceState" : null,
      "lineNumber" : 17,
      "polymorphicEvents" : null,
      "external" : false,
      "constraint" : null,
      "ambiguous" : false
    } ],
    "entryPoints" : [ {
      "type" : "REST",
      "name" : "POST /api/enterprise/orders/place",
      "className" : "click.kamil.examples.enterprise.api.OrderApi",
      "methodName" : "placeOrder",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderApi.java",
      "metadata" : {
        "path" : "/api/enterprise/orders/place",
        "verb" : "POST"
      },
      "parameters" : [ ]
    }, {
      "type" : "REST",
      "name" : "POST /api/enterprise/orders/{id}/cancel",
      "className" : "click.kamil.examples.enterprise.api.OrderApi",
      "methodName" : "cancelOrder",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderApi.java",
      "metadata" : {
        "path" : "/api/enterprise/orders/{id}/cancel",
        "verb" : "POST"
      },
      "parameters" : [ {
        "name" : "id",
        "type" : "String",
        "annotations" : [ "PathVariable" ]
      } ]
    }, {
      "type" : "REST",
      "name" : "POST /api/enterprise/orders/place",
      "className" : "click.kamil.examples.enterprise.api.OrderController",
      "methodName" : "placeOrder",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderController.java",
      "metadata" : {
        "path" : "/api/enterprise/orders/place",
        "verb" : "POST"
      },
      "parameters" : [ ]
    }, {
      "type" : "REST",
      "name" : "POST /api/enterprise/orders/{id}/cancel",
      "className" : "click.kamil.examples.enterprise.api.OrderController",
      "methodName" : "cancelOrder",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderController.java",
      "metadata" : {
        "path" : "/api/enterprise/orders/{id}/cancel",
        "verb" : "POST"
      },
      "parameters" : [ {
        "name" : "id",
        "type" : "String",
        "annotations" : [ "PathVariable" ]
      } ]
    }, {
      "type" : "CUSTOM",
      "name" : "INTERCEPTOR: SecurityInterceptor.preHandle",
      "className" : "click.kamil.examples.enterprise.api.SecurityInterceptor",
      "methodName" : "preHandle",
      "sourceFile" : null,
      "metadata" : {
        "interceptorType" : "Spring MVC Interceptor"
      },
      "parameters" : [ ]
    }, {
      "type" : "REST",
      "name" : "POST /api/enterprise/payments",
      "className" : "click.kamil.examples.enterprise.api.ReactivePaymentController",
      "methodName" : "pay",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/ReactivePaymentController.java",
      "metadata" : {
        "path" : "/api/enterprise/payments",
        "verb" : "POST"
      },
      "parameters" : [ {
        "name" : "orderId",
        "type" : "String",
        "annotations" : [ "RequestBody" ]
      } ]
    }, {
      "type" : "JMS",
      "name" : "JMS: shipping.queue",
      "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener",
      "methodName" : "onShippingReady",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ShippingJmsListener.java",
      "metadata" : {
        "protocol" : "JMS",
        "destination" : "shipping.queue"
      },
      "parameters" : [ {
        "name" : "orderId",
        "type" : "String",
        "annotations" : [ ]
      } ]
    }, {
      "type" : "RABBIT",
      "name" : "RABBIT: returns.queue",
      "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener",
      "methodName" : "onReturn",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ReturnsRabbitListener.java",
      "metadata" : {
        "protocol" : "RABBIT",
        "destination" : "returns.queue"
      },
      "parameters" : [ {
        "name" : "orderId",
        "type" : "String",
        "annotations" : [ ]
      } ]
    } ],
    "callChains" : [ {
      "entryPoint" : {
        "type" : "REST",
        "name" : "POST /api/enterprise/orders/place",
        "className" : "click.kamil.examples.enterprise.api.OrderApi",
        "methodName" : "placeOrder",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderApi.java",
        "metadata" : {
          "path" : "/api/enterprise/orders/place",
          "verb" : "POST"
        },
        "parameters" : [ ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.OrderApi.placeOrder", "click.kamil.examples.enterprise.api.OrderController.placeOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.place" ],
      "triggerPoint" : {
        "event" : "PLACE_ORDER",
        "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
        "methodName" : "place",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 16,
        "polymorphicEvents" : [ "PLACE_ORDER" ],
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "NEW",
        "targetState" : "CHECK_AVAILABILITY",
        "event" : "PLACE_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "REST",
        "name" : "POST /api/enterprise/orders/{id}/cancel",
        "className" : "click.kamil.examples.enterprise.api.OrderApi",
        "methodName" : "cancelOrder",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderApi.java",
        "metadata" : {
          "path" : "/api/enterprise/orders/{id}/cancel",
          "verb" : "POST"
        },
        "parameters" : [ {
          "name" : "id",
          "type" : "String",
          "annotations" : [ "PathVariable" ]
        } ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.OrderApi.cancelOrder", "click.kamil.examples.enterprise.api.OrderController.cancelOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.cancel" ],
      "triggerPoint" : {
        "event" : "CANCEL_ORDER",
        "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
        "methodName" : "cancel",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 21,
        "polymorphicEvents" : [ "CANCEL_ORDER" ],
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "PAID",
        "targetState" : "CANCELLED",
        "event" : "CANCEL_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "REST",
        "name" : "POST /api/enterprise/orders/place",
        "className" : "click.kamil.examples.enterprise.api.OrderController",
        "methodName" : "placeOrder",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderController.java",
        "metadata" : {
          "path" : "/api/enterprise/orders/place",
          "verb" : "POST"
        },
        "parameters" : [ ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.OrderController.placeOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.place" ],
      "triggerPoint" : {
        "event" : "PLACE_ORDER",
        "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
        "methodName" : "place",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 16,
        "polymorphicEvents" : [ "PLACE_ORDER" ],
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "NEW",
        "targetState" : "CHECK_AVAILABILITY",
        "event" : "PLACE_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "REST",
        "name" : "POST /api/enterprise/orders/{id}/cancel",
        "className" : "click.kamil.examples.enterprise.api.OrderController",
        "methodName" : "cancelOrder",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/OrderController.java",
        "metadata" : {
          "path" : "/api/enterprise/orders/{id}/cancel",
          "verb" : "POST"
        },
        "parameters" : [ {
          "name" : "id",
          "type" : "String",
          "annotations" : [ "PathVariable" ]
        } ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.OrderController.cancelOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.cancel" ],
      "triggerPoint" : {
        "event" : "CANCEL_ORDER",
        "className" : "click.kamil.examples.enterprise.service.OrderServiceImpl",
        "methodName" : "cancel",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/OrderServiceImpl.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 21,
        "polymorphicEvents" : [ "CANCEL_ORDER" ],
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "PAID",
        "targetState" : "CANCELLED",
        "event" : "CANCEL_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "CUSTOM",
        "name" : "INTERCEPTOR: SecurityInterceptor.preHandle",
        "className" : "click.kamil.examples.enterprise.api.SecurityInterceptor",
        "methodName" : "preHandle",
        "sourceFile" : null,
        "metadata" : {
          "interceptorType" : "Spring MVC Interceptor"
        },
        "parameters" : [ ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.SecurityInterceptor.preHandle" ],
      "triggerPoint" : {
        "event" : "AUDIT_EVENT",
        "className" : "click.kamil.examples.enterprise.api.SecurityInterceptor",
        "methodName" : "preHandle",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/SecurityInterceptor.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 17,
        "polymorphicEvents" : null,
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : null
    }, {
      "entryPoint" : {
        "type" : "REST",
        "name" : "POST /api/enterprise/payments",
        "className" : "click.kamil.examples.enterprise.api.ReactivePaymentController",
        "methodName" : "pay",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/api/ReactivePaymentController.java",
        "metadata" : {
          "path" : "/api/enterprise/payments",
          "verb" : "POST"
        },
        "parameters" : [ {
          "name" : "orderId",
          "type" : "String",
          "annotations" : [ "RequestBody" ]
        } ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.api.ReactivePaymentController.pay", "click.kamil.examples.enterprise.service.ReactivePaymentService.processPayment" ],
      "triggerPoint" : {
        "event" : "PAY_ORDER",
        "className" : "click.kamil.examples.enterprise.service.ReactivePaymentService",
        "methodName" : "processPayment",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/service/ReactivePaymentService.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 18,
        "polymorphicEvents" : [ "PAY_ORDER" ],
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "PENDING_PAYMENT",
        "targetState" : "PAID",
        "event" : "PAY_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "JMS",
        "name" : "JMS: shipping.queue",
        "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener",
        "methodName" : "onShippingReady",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ShippingJmsListener.java",
        "metadata" : {
          "protocol" : "JMS",
          "destination" : "shipping.queue"
        },
        "parameters" : [ {
          "name" : "orderId",
          "type" : "String",
          "annotations" : [ ]
        } ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.messaging.ShippingJmsListener.onShippingReady" ],
      "triggerPoint" : {
        "event" : "SHIP_ORDER",
        "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener",
        "methodName" : "onShippingReady",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ShippingJmsListener.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 17,
        "polymorphicEvents" : null,
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "PAID",
        "targetState" : "SHIPPED",
        "event" : "SHIP_ORDER"
      } ]
    }, {
      "entryPoint" : {
        "type" : "RABBIT",
        "name" : "RABBIT: returns.queue",
        "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener",
        "methodName" : "onReturn",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ReturnsRabbitListener.java",
        "metadata" : {
          "protocol" : "RABBIT",
          "destination" : "returns.queue"
        },
        "parameters" : [ {
          "name" : "orderId",
          "type" : "String",
          "annotations" : [ ]
        } ]
      },
      "methodChain" : [ "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener.onReturn" ],
      "triggerPoint" : {
        "event" : "RETURN_ORDER",
        "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener",
        "methodName" : "onReturn",
        "sourceFile" : "src/main/java/click/kamil/examples/enterprise/messaging/ReturnsRabbitListener.java",
        "sourceModule" : null,
        "stateMachineId" : null,
        "sourceState" : null,
        "lineNumber" : 17,
        "polymorphicEvents" : null,
        "external" : false,
        "constraint" : null,
        "ambiguous" : false
      },
      "contextMachineId" : null,
      "matchedTransitions" : [ {
        "sourceState" : "DELIVERED",
        "targetState" : "RETURNED",
        "event" : "RETURN_ORDER"
      } ]
    } ],
    "properties" : {
      "default" : { }
    }
  },
  "name" : "click.kamil.examples.enterprise.config.EnterpriseStateMachineConfig",
  "renderChoicesAsDiamonds" : true,
  "startStates" : [ "NEW" ],
  "transitions" : [ {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"NEW\"",
      "fullIdentifier" : "NEW"
    } ],
    "targetStates" : [ {
      "rawName" : "\"CHECK_AVAILABILITY\"",
      "fullIdentifier" : "CHECK_AVAILABILITY"
    } ],
    "event" : {
      "rawName" : "OrderEvents.PLACE",
      "fullIdentifier" : "PLACE_ORDER"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  }, {
    "type" : "CHOICE",
    "sourceStates" : [ {
      "rawName" : "\"CHECK_AVAILABILITY\"",
      "fullIdentifier" : "CHECK_AVAILABILITY"
    } ],
    "targetStates" : [ {
      "rawName" : "\"PENDING_PAYMENT\"",
      "fullIdentifier" : "PENDING_PAYMENT"
    } ],
    "event" : null,
    "guards" : [ {
      "expression" : "(c) -> true",
      "isLambda" : true,
      "internalLogic" : "(c) -> true",
      "lineNumber" : 41,
      "className" : "click.kamil.examples.enterprise.config.EnterpriseStateMachineConfig",
      "sourceFile" : "src/main/java/click/kamil/examples/enterprise/config/EnterpriseStateMachineConfig.java"
    } ],
    "actions" : [ ],
    "order" : 0
  }, {
    "type" : "CHOICE",
    "sourceStates" : [ {
      "rawName" : "\"CHECK_AVAILABILITY\"",
      "fullIdentifier" : "CHECK_AVAILABILITY"
    } ],
    "targetStates" : [ {
      "rawName" : "\"CANCELLED\"",
      "fullIdentifier" : "CANCELLED"
    } ],
    "event" : null,
    "guards" : [ ],
    "actions" : [ ],
    "order" : 1
  }, {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"PENDING_PAYMENT\"",
      "fullIdentifier" : "PENDING_PAYMENT"
    } ],
    "targetStates" : [ {
      "rawName" : "\"PAID\"",
      "fullIdentifier" : "PAID"
    } ],
    "event" : {
      "rawName" : "OrderEvents.PAY",
      "fullIdentifier" : "PAY_ORDER"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  }, {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"PAID\"",
      "fullIdentifier" : "PAID"
    } ],
    "targetStates" : [ {
      "rawName" : "\"SHIPPED\"",
      "fullIdentifier" : "SHIPPED"
    } ],
    "event" : {
      "rawName" : "OrderEvents.SHIP",
      "fullIdentifier" : "SHIP_ORDER"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  }, {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"SHIPPED\"",
      "fullIdentifier" : "SHIPPED"
    } ],
    "targetStates" : [ {
      "rawName" : "\"DELIVERED\"",
      "fullIdentifier" : "DELIVERED"
    } ],
    "event" : {
      "rawName" : "\"FINALIZE\"",
      "fullIdentifier" : "FINALIZE"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  }, {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"PAID\"",
      "fullIdentifier" : "PAID"
    } ],
    "targetStates" : [ {
      "rawName" : "\"CANCELLED\"",
      "fullIdentifier" : "CANCELLED"
    } ],
    "event" : {
      "rawName" : "OrderEvents.CANCEL",
      "fullIdentifier" : "CANCEL_ORDER"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  }, {
    "type" : "EXTERNAL",
    "sourceStates" : [ {
      "rawName" : "\"DELIVERED\"",
      "fullIdentifier" : "DELIVERED"
    } ],
    "targetStates" : [ {
      "rawName" : "\"RETURNED\"",
      "fullIdentifier" : "RETURNED"
    } ],
    "event" : {
      "rawName" : "OrderEvents.RETURN",
      "fullIdentifier" : "RETURN_ORDER"
    },
    "guards" : [ ],
    "actions" : [ ],
    "order" : null
  } ],
  "endStates" : [ "CANCELLED", "DELIVERED", "RETURNED" ]
}
