- Release Notes
- Getting Started
- Setup and Configuration
- Automation Projects
- Dependencies
- Types of Workflows
- File Comparison
- Automation Best Practices
- Source Control Integration
- Debugging
- The Diagnostic Tool
- Workflow Analyzer
- About Workflow Analyzer
- ST-NMG-001 - Variables Naming Convention
- ST-NMG-002 - Arguments Naming Convention
- ST-NMG-004 - Display Name Duplication
- ST-NMG-005 - Variable Overrides Variable
- ST-NMG-006 - Variable Overrides Argument
- ST-NMG-008 - Variable Length Exceeded
- ST-NMG-009 - Prefix Datatable Variables
- ST-NMG-011 - Prefix Datatable Arguments
- ST-NMG-012 - Argument Default Values
- ST-NMG-016 - Argument Length Exceeded
- ST-DBP-002 - High Arguments Count
- ST-DBP-003 - Empty Catch Block
- ST-DBP-007 - Multiple Flowchart Layers
- ST-DBP-020 - Undefined Output Properties
- ST-DBP-023 - Empty Workflow
- ST-DBP-024 - Persistence Activity Check
- ST-DBP-025 - Variables Serialization Prerequisite
- ST-DBP-026 - Delay Activity Usage
- ST-DBP-027 - Persistence Best Practice
- ST-DBP-028 - Arguments Serialization Prerequisite
- Variables
- Arguments
- Imported Namespaces
- Recording
- UI Elements
- Control Flow
- Selectors
- Object Repository
- Data Scraping
- Image and Text Automation
- Automating Citrix Technologies
- RDP Automation
- SAP Automation
- VMware Horizon Automation
- Logging
- The ScaleCoordinates Migration Tool
- The ScreenScrapeJavaSupport Tool
- The WebDriver Protocol
- StudioPro
- Extensions
- Troubleshooting
About Workflow Analyzer
Workflow Analyzer is a static code analyzer that ensures your project meets high quality and reliability standards. A static code analyzer checks for inconsistencies without actually executing the project, as opposed to dynamic analyzers which step in during execution.
Workflow Analyzer uses a set of rules to check for various inconsistencies unrelated to project execution. The rules are based on Automation Best Practices and take into consideration variable and argument naming, empty sequences or workflows, package restrictions, and so on. The analyzer does not identify errors in execution or compilation.
It is available in the Design ribbon tab, the Analyze File and Analyze Project buttons. The first performs an analysis on the file currently focused in the Designer panel, while the second analyzes all files in the automation project.
ST-
prefix. The UIAutomation.Activities, Excel.Activities, and Mail.Activities also have their own rules, identifiable by the prefix.
You can also create custom rules. For more information, see Building Workflow Analyzer Rules in the Developer guide.
ST-NMG-001
ID:
ST
- reveals that the rule is built into Studio.NMG
- shows that the rule is part of the Naming Rules category. Rules part of Project Anatomy Rules category have theANA
abbreviation, those part of Design Best Practices theDBP
, and so on.-
001
- is the rule number.
Each rule has a scope to which it applies:
- Activity: The rules are enforced at activity level, checking variables, arguments, properties. Variables Naming Convention is one such rule.
- Workflow: Rules perform checks in a single project file, for example Unused Variables.
- Project: Checks are performed at project level.
Rules have a number of actions that can be set:
- Error: Generates an error in the Error List panel.
- Warning: Generates a warning in the Error List panel.
- Info: Generates a message in the Error List panel.
- Verbose: Creates large log files.
Check the Logging Levels page to learn more about logging with Studio.
The project or file is analyzed based on a set of rules available in the Project Settings window:
- In the Project panel, click the icon, then select Workflow Analyzer.
- In the ribbon, click the Analyze File button, then select Workflow Analyzer Settings from the dropdown.
Rules can be filtered by scope and action. Uncheck the box next to each rule to define a configuration specific to your project. By default, rules are arranged by code in the window, and enabled rules are displayed first.
Reset to Default
After any changes were made to the default values of rules, be it Regex or thresholds, the values may be reverted to default by right-clicking the rule and then selecting Reset to Default.
Validation of the file or project is performed whenever the Workflow Analyzer is triggered. Validation options are available in the Analyze File ribbon button, Validate File and Validate Project.
This action checks whether variables, arguments, expressions, and imports are properly configured. The Validate File action can be triggered using the F8 shortcut, while Validate Project using Shift + F8. Validation can be cancelled at any time.
The file(s) that contain errors are marked in the Project panel with a red dot, and the errors are shown in the Error List and Output panels.
.xaml
and highlights the element which threw the error, whether it's an activity, argument, or variable.
.xaml
files are validated, the project cannot be debugged, executed or published. Breakpoint conditions are not evaluated.
When triggered, the Workflow Analyzer uses the configured ruleset to check the project or file, and logs the found errors in the Error List panel, in accordance with the rule action.
The Error List panel filters items by Errors, Warnings and Messages. The scope drop-down menu is useful for filtering errors by project, current file or a specific file in the automation. In addition, items can be filtered by rule ID.
Click a found warning or error to display the rule’s recommendation and a link to the documentation page for each rule.
In addition to rule violations, the Error List panel also displays errors that may occur in the execution of workflow analysis, When the Workflow Analyzer or one of the configured rules fails to run, an error is logged with details about the cause of the error in the description.
UiPath.Studio.CommandLine.exe
command-line user interface contains a set of parameters for checking files or projects against certain rules, even in CI/CD
pipeline configurations.
UiPath.Studio.CommandLine.exe
is available in the installation folder:
- For the Windows Installer (.msi) version of Studio, the default path is
C:\Program Files (x86)\UiPath\Studio\
- For Studio installed using the Community Edition installer (.exe), the default path is
%LocalAppData%\UiPath\[Studio_version]\
.
Configure Rules
By default, all Workflow Analyzer rules are enabled when installing Studio with the exception of the following:
You can configure rules:
- From the Workflow Analyzer Settings window, enable or disable rules by clicking the checkbox next to each one of them,
- From the
RuleConfig.json
file, path%LocalAppData%\UiPath\Rules
. Find a specific rule, modify its parameter, change theIsEnabled
parameter tofalse
to disable the rule.
Rules are organized according to their unique ID, visible in the Workflow Analyzer Settings also.
([A-Z])
Regex expression. This means that variable names must be uppercase. All the other rules were disabled in this example.
Analyze Files and Projects
UiPath.Studio.CommandLine.exe
command-line user interface.
The following Workflow Analyzer commands are available:
analyze
- Analyzes the whole project. Requires the path to theproject.json
file.analyze-file
- Analyzes a single file. Requires the path to the.xaml
file.
The following arguments are available for Workflow Analyzer commands:
Argument |
Description |
---|---|
|
For analyzing one file, provide the path to the
.xaml . For analyzing the entire project, specify the path to the project.json file.
|
|
View the arguments available for each command. |
|
Check the version of
UiPath.Studio.CommandLine.exe .
|
UiPath.Studio.CommandLine.exe analyze-file -p "C:\BlankProcess\Main.xaml"
analyzes only one file in a project, Main.xaml
. The output of the command returns a json-encoded dictionary with the following information for each rule violation:
FilePath
: The path to the analyzed file.ErrorCode
: The rule ID.ActivityDisplayName
: The display name of the activity (null
if not applicable).Item
- The name and type of the item (for example, activity or variable) where the error message was generated.ErrorSeverity
: The value of theDefaultAction
parameter, which is the configured log message for each rule, either Warning, Error, Info or Verbose.Description
: The rule's description.-
Recommendation
andURL
: The recommended changes for solving the issue, together with the documentation link with more information.
echo %errorlevel%
after you run it. If there are no messages with the ErrorSeverity
Error, the code 0
is returned. Otherwise, 1
is returned.
.xaml
file, an error is displayed.
The Globally Unique Identifiers (GUID) used as prefixes for an entry are generated on each run and apply to the current result only.
You can prevent the execution and/or publishing of projects that contain Workflow Analyzer errors by enabling the following options from Studio Backstage View > Settings > Design:
- Enforce Analyzer before Run - Whenever running/debugging a file or project is initiated, the Workflow Analyzer checks all the rules with the
Error
action and execution is allowed only if no errors are found. - Enforce Analyzer before Publish - Whenever publishing is initiated, the Workflow Analyzer checks all enabled rules regardless of their action and publishing
is allowed only if there are no rule violations with the action
Error
.
Error
) the results of the workflow analysis are included in the published .nupkg
package in the file project_analysis_results.json
located in \lib\net45\.analysis\
. The file contains the following information about each enabled rule:
RuleId
- The rule ID.RuleName
- The name of the rule.Parameters
- The customizable parameters in the rule, if applicable.ErrorsDescription
- A list of error messages generated by the rule, if applicable.