You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何向CA Workload Automation作业传递用户自定义运行参数?

Solution for CA Workload Automation Job with Mixed Global Variables and Manual Inputs

Hey there, I’ve dealt with exactly this scenario in CAWA before—turns out it is supported, you just need to leverage a couple of CAWA’s built-in features. Here are two reliable approaches to make your shell script run as intended:

Approach 1: Combine Job Input Variables with Global Variables

This is the most straightforward method for interactive job submissions:

  • Step 1: Confirm Global Variables are Accessible
    Make sure your par2 and par3 global variables are properly configured in CAWA’s Global Variable Library, and that the job has permission to access them (check the job’s security settings if needed). CAWA automatically injects these into the job’s runtime environment.
  • Step 2: Add Input Variables for Manual Entry
    In your CAWA job definition, create two required input variables (e.g., INPUT_PAR1 and INPUT_PAR4). You can set these to prompt users for values when they submit the job via the CAWA GUI or CLI.
  • Step 3: Build the Script Command
    Update the job’s command line to combine the input variables and global variables, wrapping each in quotes to handle spaces/special characters:
    ./Shell.sh "$INPUT_PAR1" "$par2" "$par3" "$INPUT_PAR4"
    
    Replace $par2 and $par3 with the exact names of your CAWA global variables—CAWA will resolve them to their configured values at runtime.

Approach 2: Use Placeholder Parameters for Submission-Time Overrides

If you prefer using CAWA’s native parameter placeholder system:

  • Step 1: Define Placeholders in the Job Command
    Write your job’s command with placeholders for all four parameters, marking par2 and par3 as linked to global variables:
    ./Shell.sh %PAR1% %PAR2% %PAR3% %PAR4%
    
  • Step 2: Map Placeholders to Variables
    In the job’s parameter configuration:
    • Link %PAR2% and %PAR3% to your existing global variables (select "Global Variable" as the parameter type).
    • Set %PAR1% and %PAR4% as "User Input" parameters, making them required so users can’t submit the job without providing values.
  • Step 3: Submit the Job
    When users submit the job via CAWA’s interface, they’ll be prompted to enter values for %PAR1% and %PAR4%. CAWA will replace all placeholders with the appropriate values (global variables + user input) before executing the script.

Pro Tip

Always wrap variables in double quotes in your command line—this prevents issues if any parameter contains spaces, hyphens, or special characters (e.g., a file path like /data/my files/report.txt).

内容的提问来源于stack exchange,提问作者Ignacio M

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 10:03:47