Skip to Content

Global Variable

The global variable _Workflow is available in Studio. When called in the code editor (e.g., through the Assign element), the following properties are available:

workflow1.png

  1. Caller — a reference to the process object that called the current process.

  2. Current — a reference to the current process object.

  3. CurrentWorkflowPath — a reference to the path of the current process, i.e., to a specific ltw file.

  4. GetArgument — allows you to retrieve the argument.

  5. SetArgument — allows you to change the argument.

  6. ProjectPath — the path to the project folder. Example of specifying the full path to the Settings.xlsx file in the Data subfolder of the project: System.IO.Path.Combine(_Workflow.ProjectPath,"Data","Settings.xlsx")

  7. RunConfig — the standard robot launch configuration. Available values:

    • None — absent;

    • Debug — debug mode;

    • Release — release mode.

      In fact, Debug differs from Release only in name, however, you can build logic in the project that takes into account one or another configuration value. For example, use branching where a certain action should occur in Debug configuration, and another in Release: if (_Workflow.RunConfig == "Debug") { do something }.

      You can specify the configuration in several places — this depends on where you are going to launch the project: in Studio, Orchestrator, or Robot Runner. Thus, when specifying the configuration and launching the project in one of the listed programs, the desired scenario logic will be executed.

      Ways to specify the configuration:

    • In Studio on the Debug menu tab in the Configuration parameter. The parameter is implemented as a drop-down list:

      workflow2.png

    • When loading the project into Orchestrator:

      workflow3.png

    • In the Robot Runner utility when adding a task (on the General tab):

      workflow4.png

  8. RunConfigCustom — a special launch configuration. It differs from the standard one in that an individual value can be used in the special configuration (instead of Debug/Release). You can set the value of the special configuration in the following places:

    • In Studio on the Debug menu tab in the Configuration parameter. The parameter is a text field.

      workflow5.png

    • When loading the project into Orchestrator (text field):

      workflow6.png

    • In the Robot Runner utility when adding a task (on the General tab).

      workflow7.png

  9. Logging.ScreenshotsPath — the path to the folder with screenshots. The default path can be changed. Example: in a C# script, specify your path to the screenshot files using the syntax _Workflow.Logging.ScreenshotsPath = "<screens_folder>", where <screens_folder> — a new folder for saving screenshots, which will be created in the project and used by default.

Last updated on