activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2026年3月20日

使用临时流程结果实时跟踪 Apps 中的进度

概述

为了更好地了解临时流程结果的工作方式,您可以构建此页面中描述的示例。

By following this procedure, you will build a process in Studio that involves sending intermediate data to UiPath Apps using the Send Interim Result activity. You will build an app that will display a progress bar (using Slider control) in real-time as the tables are populated with data.

对于此示例,我们将构建以下内容:

  • 自动化流程
  • 使用“UiPath Apps”的应用程序

教程

构建流程

The process from this tutorial is used to demonstrate the capabilities of the Interim Process Result activity. The process takes two inputs:

  • 要处理的项目数。
  • 每个项目中的步骤数。

该流程使用这些输入运行,并将以下临时结果发送到应用程序:

  • 流程正在执行的当前项目。
  • 项目中的当前步骤。
  • 特定项目的进度百分比。
  • 填充每个步骤的表格,包括时间戳。
  1. 打开 Studio ,创建一个新“流程”

  2. 创建以下参数:

    参数名称方向参数类型默认值
    in_number_of_steps输入Int323
    in_number_of_items输入Int322
    out_progress_percentage输出Int32-
    out_progress_datatable输出数据表-
    out_current_step输出Int32-
    out_current_item输出Int32-
  3. 将“序列”活动拖动至“工作流设计器”

    • 创建以下变量:

      变量名称变量类型默认值
      var_itemInt321
      var_stepInt321
      var_percentageInt320
  4. 在“序列”容器中添加“构建数据表”活动。

    • 在“数据表”字段中添加“out_progress_datatable”变量。
    • 向表格添加四列:
      • Item Number as Int32.
      • Step Number as Int32.
      • Time as DateTime.
      • Progress % as Int32.
    • Add a While activity below the Build Data Table activity and configure it as below:
  5. 在“条件”字段中添加var_item<=in_number_of_items

    • Add a While activity in the Body.
      • 在“条件”字段中添加var_step<=in_number_of_steps
      • Add an Add Data Row activity in the Body.
      • Add {var_item,var_step,now(),(var_step/in_number_of_steps)* 100} in the ArrayRow field.
      • Add out_progress_datatable in the DataTable field.
      • Add a Delay activity below Add Data Row. Add 00:00:02 in the Duration field (2 second).
      • Add a Send Interim Result activity below Delay.
      • Add out_progress_datatable in the Argument name field and out_progress_datatable in the Argument value field.
      • Add a Multiple Assign activity below Send Interim Result.
      • Add var_percentage in the To field and Convert.ToInt32((var_step/in_number_of_steps) * 100) in the Value field.
      • Add a Send Interim Result activity below Multiple Assign.
      • Add out_progress_percentage in the Argument name field and var_percentage in the Argument value field.
      • Add a second Send Interim Result activity before the previous one.
      • Add out_current_step in the Argument name field and var_step in the Argument value field.
      • Add a third Send Interim Result activity.
      • Add out_current_item in the Argument name field and var_item in the Argument value field.
      • Add a Multiple Assign activity below the last Send Interim Result activity.
      • Add var_step in the To field and var_step+1 in the Value field.
      • Add a Multiple Assign activity below the last While.
      • Add var_step in the To field and 1 in the Value field.
      • Add var_item in the To field and var_item+1 in the Value field.
      • Add var_percentage in the To field and 1 in the Value field.

结果

最后,您的工作流应与下图类似。

docs image

生成您的应用程序

本教程中的应用程序接收来自之前构建的流程的信息。 该应用程序显示从流程收到的以下临时结果:

  • 流程正在执行的当前项目。
  • 项目中的当前步骤。
  • 特定项目的进度百分比。
  • 填充每个步骤的表格,包括时间戳。

在开始构建应用程序之前,请确保已在 Orchestrator 中创建并发布“构建流程”部分中的自动化流程。

  1. 打开您现有的应用程序或启动一个新应用程序。

  2. 参考先决条件部分中的流程。

  3. 向页面添加容器。

  4. Add a Header control in the container. Add App - Interim Process Results in the Text property. This will be the app title.

  5. Add a second Header control below the previous one. Add Input in the Text property. Make sure that the font size is a bit smaller (for example, 20 px).

    1. 在容器内添加一个文本框控件。在“值”绑定属性中添加先前引用的流程中的in_number_of_items参数。在“默认文本”属性中添加2 ,并在“标签”属性中添加Number of items (iterations)
    2. “文本框”控件右侧添加一个“分隔条”
    3. 分隔条右侧添加“文本框”控件 。在“值”绑定属性中添加先前引用的流程中的in_number_of_steps参数。在“默认文本”属性中添加3 ,并在“标签”属性中添加Number of steps in item
    4. “文本框”右侧添加“按钮”控件。在“文本”属性中添加Start Process 。为“单击”事件配置“启动”流程规则。配置规则以启动在开头引用的流程,并将其标记为有人值守
  6. Add a Divider below the container.

  7. Add a Header below the divider. Add Interim Process Result in the Text property.

    docs image

  8. Add a Container below the header.

  9. Add two more Container control one inside each other.

    1. 在最后一个容器内添加“标签” 。在“文本”属性中添加Current item being processed:
    2. 在上一个标签旁边添加第二个标签。在“文本”属性中添加引用流程中的out_current_item参数。
  10. Add a Container below the last one.

    1. 在最后一个容器内添加“标签” 。在“文本”属性中添加Current step:
    2. 在上一个标签旁边添加第二个标签。在“文本”属性中添加引用流程中的out_current_step参数。
  11. 在最后两个容器的右侧添加一个分隔条

    docs image

  12. Add a Container to the right of the Divider and another Container inside the first one.

    1. 添加“标签”控件,并在“文本”属性中添加Step completion % :
    2. 再添加两个“容器”控件,并在最后一个控件中添加一个“标签”控件和一个“滑块”控件。在“标签”“文本”属性中添加流程的out_progress_percentage参数。配置滑块属性:将滑块增量配置为0将默认值配置为0
  13. Add a Divider below.

  14. Add a Table control below the divider.

    1. “数据源”字段中添加流程的out_progress_datatable参数。
    2. 添加“项目编号”列,并提供数据表流程中的Item Number作为“来源”
    3. 添加一个“步骤编号”列,并提供数据表流程中的Step Number作为来源
    4. 添加一个“时间”列,并提供数据表流程中的Time作为“来源”
    5. 添加“进度 %”列,并提供数据表流程中的Progress %作为“来源”

结果

最后,您的应用程序应如下所示:

docs image

结果

预览应用程序时,您可以按“启动流程”按钮。

该应用程序将为流程提供以下临时信息:

  • 当前正在处理的项目

  • 当前步骤

  • 步骤完成 (百分比)

  • 包含有关项目、步骤编号、时间戳和进度的信息的表格。

    docs image

您还可以使用文本字段更改项目数或项目中的步骤。

示例工作流

要查看完整的工作流和应用程序或以供将来参考,请从此处下载文件 。

  • 概述
  • 教程
  • 示例工作流

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新