Skip to content

Instantly share code, notes, and snippets.

@tsurdilo
Created September 29, 2020 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsurdilo/e629ef8713ca8f27873df70093d050c9 to your computer and use it in GitHub Desktop.
Save tsurdilo/e629ef8713ca8f27873df70093d050c9 to your computer and use it in GitHub Desktop.
id: applicantrequest
version: '1.0'
name: Applicant Request Decision Workflow
description: Determine if applicant request is valid
functions: features/applicantrequestfunctions.json
states:
- name: CheckApplication
type: switch
start:
kind: default
dataConditions:
- condition: "{{ $.applicants[?(@.age >= 18)] }}"
transition:
nextState: StartApplication
- condition: "{{ $.applicants[?(@.age < 18)] }}"
transition:
nextState: RejectApplication
default:
transition:
nextState: RejectApplication
- name: StartApplication
type: subflow
workflowId: startApplicationWorkflowId
end:
kind: default
- name: RejectApplication
type: operation
actionMode: sequential
actions:
- functionRef:
refName: sendRejectionEmailFunction
parameters:
applicant: "{{ $.applicant }}"
end:
kind: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment