# Use variable $cis_default_workflow_parameter, query workflow parameter list, and fill them.
# The tail of array variable $cis_default_workflow_parameter has higher preference (because params from command line are appended after tail)
#
# returns incomplete json text in stdout, like this:
# "param1":"val1","param2":"val2",
workflow_name="$1"
params_query_response=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/JobTypeDefinition/$cis_namespace" | json2table WorkflowDefinitions/InputParameters,Name -p | grep"|$workflow_name|" | cut-d'|'-f 1`||! echo2 "Failed to get Workflow definition for workflow $workflow_name"||return$?
[["$params_query_response"="[]"]]&¶ms=""||params=`echo"$params_query_response" | json2table Name -p | sed's/VAL: //g' | grep-oE'[A-Za-z0-9_-]+'`||! echo2 "Failed to get Workflow definition for workflow $workflow_name"||return$?
...
...
@@ -144,16 +146,20 @@ function assemble_workflow_parameters () {
}
function assemble_runtime_settings (){
# Use variable $cis_default_workflow_parameter, query runtime settings list, and fill them.
# TODO: Many runtime settings have default value, I'll append them into the front of cis_default_workflow_parameter in the FUTURE!
# TODO: Many runtime settings have default value, I want to load them into cis_default_workflow_parameter automatically in the FUTURE!
# The tail of array variable $cis_default_workflow_parameter has higher preference (because params from command line are appended after tail)
#
# returns incomplete json text in stdout, like this:
# "param1":"val1","param2":"val2",
# runtime_settings are related to namespace, so we don't need workflow_name. (We're adding an '@' to all param name here)
# runtime_settings are only related to namespace, so we don't need workflow_name. (We're adding an '@' to all param name here)
params=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/JobTypeDefinition/$cis_namespace" | json2table GlobalSettings/Name -p | sed's/VAL: /@/g' | tr-d'|'`||! echo2 "Failed to get runtime settings for namespace $cis_namespace"||return$?