github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0092.yml (about)

     1  doc_meta: |
     2    folder: flow-controll
     3    title: dynamic routing
     4    head: |
     5      This case shows that you can use a var reference in your callee task name so that the action could be dynamic and you can program your workflow using this feature
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11  notes:
    12    goal:
    13      - add feature of dynamic call routing
    14  
    15  tasks:
    16  
    17    - name: task
    18      task:
    19  
    20        - func: call
    21          vars:
    22            person:
    23              name: tom
    24              age: 23
    25          do:
    26            - '{{.person.name}}_action'
    27  
    28    - name: tom_action
    29      task:
    30        - func: cmd
    31          do:
    32            -
    33              name: print
    34              cmd: 'hello {{.person.name}}'