Skip to Content
Primo RPA StudioToolsPrimo RPA Import Fix

Primo RPA Import Fix

Primo RPA Import Fix is a utility built into Studio that allows you to correct *.ltw files of Primo Studio, generated after the import procedure from a UiPath project. The tool is available on the Tools > Open Primo RPA Import Fix tab:

alt

Correction involves replacing code sections using sequential application of regular expressions (RegExp) to the contents of *.ltw files.

The purpose of the correction is to fix typical import errors related to differences in code syntax between UiPath Studio and Primo Studio. Such errors can occur repeatedly in the imported project, so using the application significantly saves time when transferring a project from UiPath to the Primo platform.

Corrections may include:

  • replacing script syntax within modules;
  • adding/correcting the modules themselves and their properties.

To correct, simply open the program, select all or several *.ltw files in the Primo folder of the imported project, and click the Start button. As a result, more than 70% of errors will be corrected automatically.

Additional program features allow you to change the existing set of code correction operations (a set of regular expressions), add new ones, save and restore individual settings. These functions are opened by clicking the Settings button.

Files are saved as backup copies in a Backup subfolder of the project before correction, with a timestamp of the change in the file name. They can be easily restored in case of any incorrect editing rules. Thus, a user with knowledge of RegExp syntax can experiment with settings, maximizing the automation of error correction without fear of damaging their project.

Quick Start

After launching Primo RPA Import Fix, a dialog box will appear prompting you to select one or more *.ltw project files for conversion. You can select multiple files simultaneously using the mouse button and the Ctrl key:

alt

After this, you will be taken to the main program window. Here, in the project files section, the selected files will be marked. You can adjust the selection by setting or removing flags next to the file names:

alt

In the future, you can change the project folder by correcting the path in the upper left field or by invoking the file opening dialog box using the button with the image of a folder:

alt

Clicking the Start button will launch the conversion of the selected files on the left.

If, during processing, any of the files is not changed (no errors are found that meet the list of correction rules), the program will issue a message: No corrections found for file *.

At the end of the conversion of all files, an informational message will appear about the successful completion of the operation.

Program Interface Description

alt

  1. Folder with the Primo Studio project. The project path can be changed manually or using the dialog button to the right of the input field. The program checks for the presence of *.ltw files in the selected folder.

  2. File selection section for conversion. After selecting the project folder, this field displays all *.ltw files from that folder. Files for conversion can be selected using the mouse button, double-click, or the space bar.

  3. Section corresponding to the Backup subfolder in the project folder. This displays backup copies of *.ltw files, which are created when the Start button is pressed before modification. File names consist of the original name, a dash (-), and a date-time label. If the file has not been converted before, the timestamp will be empty, which corresponds to the initial state of the file (imported via Primo Studio).

  4. Start button. Used for converting the selected *.ltw files. Not highlighted files, but only those ticked with a checkbox are converted. After successful conversion, the checkboxes of these files are cleared. At the end of conversion, an informational message appears confirming successful completion.

  5. Restore button. It becomes active only after at least one file is selected in the backup section. Restored are not highlighted files, but those ticked with a checkbox.
    For example, if Main-220603105118.ltw is selected, after pressing Restore the corresponding file from the .\Backup subfolder will be copied and overwritten as Main.ltw. It is recommended that the corresponding Main.ltw file is not open in Primo Studio at that time.

  6. Settings button. Opens or closes the bottom settings panel, which contains the list of operations executed sequentially when the Start button is pressed.

  7. Program skin selection. Allows choosing the program skin from the dropdown list. The selected skin is saved when the program is closed and restored when it is reopened. Program settings are stored in the Windows user profile folder %APPDATA%\PrimoImport\.

  8. Developer mode checkbox. Enables or disables advanced settings mode.

  9. Table of sequential changes. Displays the sequence of modifications executed when the Start button is pressed. With the Active checkbox you can enable or disable selected actions. The table view changes depending on the Developer mode state.

Restoring Source Files from Backups

Before each file change, a backup copy is made. The file is copied to a Backup subfolder located next to the *.ltw file. At the same time, a postfix is added to the file name, starting with a minus sign and followed by a date and time stamp of the form -YYMMDDhhmmss.

For example, the selected file is D:\Projects\FiscalizationPays_Primo\Main.ltw. Before conversion, it will be copied with the name D:\Projects\FiscalizationPays_Primo\Backup\Main-220601170530.ltw, if the launch was performed on June 1, 2022 at 17:05:30. If no corresponding backups were found in the Backup folder, the file Main.ltw will be copied with the name Main-.ltw (without a timestamp). Such files will correspond to the original files obtained immediately after the Primo import. When restoring a file, it is converted back with the file Main.ltw overwritten (from the example).

To restore a file, you must mark the necessary backup files and click the Restore button:

alt

You can delete backup copies from the list and, accordingly, from the Backup folder using the Delete backup file context menu command.

Program Settings

Clicking the Settings button will display the lower panel with a table of the sequence of correction settings (settings for searching and replacing text fragments of *.ltw files).

If the user is familiar with the syntax of regular expressions (RegExp), they can enable developer mode with the corresponding checkbox in the lower left corner to see the hidden columns of the table corresponding to the RegExp search expression (the Expression column) and the column with the replacement template (the Replacement column).

Additionally, buttons for saving/restoring the settings table will appear (see section Description of the interface):

alt

Using regular expressions, you can not only fix errors related to differences in the syntax of Visual Basic and C# commands, but also change module properties of Primo. For example, in operation 17, the DBConnect parameter is set in all modules working with the database, such as Insert data or Execute query.

Unfortunately, after a normal UiPath project import, this parameter is lost. If your database connection has a different name, you can rename it to DBConnect or completely abandon the DBConnect substitution by removing the activity flag with operation No. 17 before clicking the Start button. You can also change the name DBConnect to another connection name corresponding to the project in the Replacement field, for example to Connect1, then the Replacement field will change as follows:

  • Old value: $1$2<Value xsi:type="xsd:string">DBConnect</Value>$2$3\
  • New value: $1$2<Value xsi:type="xsd:string">Connect1</Value>$2$3

The program has the ability to selectively perform individual replacement rules on the necessary files. This can be done by selecting the Run current operation with selected file item in the context menu, invoked on any line of the regular expression.

In this case, you do not need to press the Start button. The selected replacement command will be executed regardless of the position of the activity flag. A backup copy of the file will be created just as if you had pressed the Start button.

alt

By adding or changing lines of regular expressions, you can significantly automate the correction of import errors, analyzing the difference between the original files obtained after the Primo import and the files corrected manually. Such a comparison can be performed, for example, using the Compare plugin of the Notepad++ program:

alt

alt

Last updated on