blob: 206d76e7a473a1b09c33d95db4988e1ee7909bb8 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
id: testcreateworkflow
version: '1.0'
specVersion: '0.8'
name: Store Order Management Workflow
start: Receive New Order Event
states:
- name: Receive New Order Event
type: event
onEvents:
- eventRefs:
- NewOrderEvent
actions:
- functionRef:
refName: "OrderServiceSendEvent"
transition: Check New Order Result
- name: Check New Order Result
type: switch
dataConditions:
- name: New Order Successfull
condition: '${ .order_no != "" }'
transition: Send Order Payment
- name: New Order Failed
condition: '${ .order_no == "" }'
end: true
defaultCondition:
end: true
- name: Send Order Payment
type: operation
actions:
- functionRef:
refName: "PaymentServiceSendEvent"
transition: Check Payment Status
- name: Check Payment Status
type: switch
dataConditions:
- name: Payment Successfull
condition: '${ .order_no != "" }'
transition: Send Order Shipment
- name: Payment Denied
condition: '${ .order_no == "" }'
end: true
defaultCondition:
end: true
- name: Send Order Shipment
type: operation
actions:
- functionRef:
refName: "ShipmentServiceSendEvent"
end: true
events:
- name: NewOrderEvent
source: store/order
type: online.store.newOrder
functions:
- name: OrderServiceSendEvent
operation: file://orderapp.yaml#sendOrder
type: asyncapi
- name: PaymentServiceSendEvent
operation: file://paymentapp.yaml#sendPayment
type: asyncapi
- name: ShipmentServiceSendEvent
operation: file://expressapp.yaml#sendExpress
type: asyncapi