Open levice14 opened 8 years ago
navigate:
- rule1
- rule2
- name: content
- SUCCESS: success_step
or
- SUCCESS:
condition: ${ boolean_expression }
target: task_name
a rule has the following fields:
self
keyword decesions #568 )- CUSTOM: task_name
translates to
- CUSTOM:
condition: CUSTOM
target: task_name
Open questions:
true
condition (boolean value) notes:
sample files - consider nav_op operation with results SUCCESS / FAILURE and nav_flow flow:
flow:
name: nav_flow
workflow:
- task_legacy: # current syntax
do:
nav_op: []
navigate:
SUCCESS: success_step
FAILURE: failure_step
# equivalent with new syntax:
- task_results_legacy_in_new_format:
do:
nav_op: []
navigate:
- SUCCESS: success_step
- FAILURE: failure_step
# custom rules
- task_custom_rules:
do:
nav_op: []
navigate:
- SUCCESS_RESULT:
condition: ${ boolean_expression }
target: task_name
- SUCCESS: task_name # operation ended with SUCCESS
# note FAILURE result from operation does not need to be declared here
- CUSTOM_1:
condition: ${ subflow_output == 'expected output' and flow_input == 'expected input' }
target: FLOW_RESULT
- DEFAULT:
condition: true # boolean value
target: task_name
@CloudSlang/slang-functional-reviewers please give feedback
i think we might need here special syntax to get the result name, for cases i want a condition like: result[SUCCESS] && output(output1) == '400'
I think the solution for that is to reserve a word that will hold the subflow result - e.g. ${ result == 'SUCCESS' && output(output1) == '400' }
we want to be able to define custom navigation logic on task level
e.g. we had this problem when ssh op became flow and we wanted to define custom results for ssh_flow based on outputs, will be handy with switch construct