studio
latest
false
- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 控制流程
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 日志记录
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 编码自动化
- 基于触发器的 Attended 自动化
- 对象存储库
- ScreenScrapeJavaSupport 工具
- 扩展程序
- Studio 测试
- 故障排除
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

Studio 用户指南
上次更新日期 2025年10月24日
本部分教程将向您展示如何在编码自动化中调用低代码工作流。其中涉及的场景包括: 
            
         
         
         - 创建一个名为 Random的编码工作流(CS 文件),该工作流会在由您提供的最小和最大整数确定的特定范围内生成一个随机值。
- 创建一个名为 Increment的低代码 XAML 工作流,该工作流会为任何给定结果加 1,从而增加接收到的值。
- 创建另一个名为 IncrementProxy的编码工作流(CS 文件),该工作流会从Random工作流中获取随机生成的值,并使用workflows对象调用此值的IncrementXAML 工作流,然后返回将递增后的结果添加到调用环境。
- 在“文件”组中新建一个编码工作流。
- 更改 Execute()公共类,以接受两个名为min和max的int类型输入参数,并返回int。输入参数表示生成随机值的边界,而返回参数表示生成的随机值本身。例如,将public void Execute()更改为public int Execute(int min, int max)。
- 使用 new关键字和Random()构造函数创建Random类的新对象。- 使用 Random类实例中的Next()方法生成一个介于min和max之间的随机数。
- 将此生成的随机数分配给名为 randomValue的新变量。
 
- 使用 
- 返回 randomValue变量。通过将此变量返回给Execute方法,您可以在使用Execute方法运行的项目中的任意编码工作流中访问randomValue变量。
public class Random : CodedWorkflow
    {
        [Workflow]
        public int Execute(int min, int max)
        {
            // Get a random value between min and max
            var randomValue = new Random().Next(min, max);
            
            // Return it to the caller
            return randomValue;
        }
    }public class Random : CodedWorkflow
    {
        [Workflow]
        public int Execute(int min, int max)
        {
            // Get a random value between min and max
            var randomValue = new Random().Next(min, max);
            
            // Return it to the caller
            return randomValue;
        }
    }- 在“文件”组中,新建工作流。
- 创建两个类型为 Int32的参数,分别命名为result和input.。将result参数的方向设置为 Out,将input参数的方向设置为 In。
- 添加“赋值”活动。
                  - 在“保存位置”字段中,输入 result变量。
- 在“要保存的值”字段中,添加以下表达式,该表达式会递增 input值:input + 1。
 
- 在“保存位置”字段中,输入 
- 在“文件”组中新建一个编码工作流。
- 更改 Execute类,以采用在本教程的“创建Random编码工作流”步骤中创建的random变量,并更改该类以返回int参数。
- 使用 workflows对象调用Increment低代码工作流,向其传递randomInt32 变量,并将输出存储到名为out_arg的变量中。
- 在输出面板中记录 out_arg变量。
- 将 out_arg变量返回给Execute方法。
public class Workflow : CodedWorkflow
    {
        [Workflow]
        public int Execute(int random)
        {
            // Receive random from the XAML and increment it 
            var out_arg  = workflows.Increment(random);   
            
            // Log the result and return it to the caller
            Log(out_arg.ToString());
            
            // Return the result to the caller
            return out_arg;
        }
    }public class Workflow : CodedWorkflow
    {
        [Workflow]
        public int Execute(int random)
        {
            // Receive random from the XAML and increment it 
            var out_arg  = workflows.Increment(random);   
            
            // Log the result and return it to the caller
            Log(out_arg.ToString());
            
            // Return the result to the caller
            return out_arg;
        }
    }