id: ParallelStateTest
name: Parallel state
version: '1.0'
specVersion: '0.8'
description: Parallel state with completionType=atLeast and numCompleted=1
functions:
  - name: sout
    type: custom
    operation: sysout
start: StartParallelExecution
states: 
  - name: StartParallelExecution
    type: parallel
    branches:
      - name: mainSubflowBranch
        actions:
          - subFlowRef: MainSubflow
      - name: alternativeSubflowBranch
        actions:
          - subFlowRef: AlternativeSubflow
    completionType: atLeast
    numCompleted: 1
    transition: SoutProcessEnd
  - name: SoutProcessEnd
    type: operation
    stateDataFilter:
      input: "{msg: \"ParallelState process has finished\"}"
    actions:
      - name: soutProcessEndAction
        functionRef:
          refName: sout
          arguments:
            message: ".msg"
    end:
     terminate: true