+
+

Lab 1: Implementation - Automate Data Entry into Legacy App

Overview:

In this lab we will create the Automation Process that will enter automatically invoice date into the NTO legacy Financial System.

Step 1: Locate the workshop’s Process Category

  1. Login to the RPA Manager instance and use your credentials.

  2. Expand the Process Automation menu and click on Process Management

    module01 lab01 rpa man prc aut menu
  3. There should be one Category named as per this pattern YOURWORKSHOPCITY-YYYYMMDD:

    module01 lab01 locate category
  4. Click on this category to start building your Automation processes.

Step 2: Create the Process

  1. Click on the Create button

    module01 lab01 create prc btn
  2. Use the following pattern for the process name:

    <your name and surname/initials>-Module 1-Automate Data Entry into Legacy App

    module01 lab01 prc wiz name

    Scroll down and uncheck the Use Process Board option (we will not use the Process Board capabilities on this workshop).

    module01 lab01 prc wiz prc board

    Click Save on the bottom right to create your new automation process.

    module01 lab01 prc wiz save btn
  3. Open your new process by clicking on its name.

    module01 lab01 prc tile

Step 3: Move Process to the Build Phase

  1. We can move forward to the Build phase (for this lab we are skipping the design phase), by clicking on the Publish button:

    module a  pub to build btn
  2. Every time a process is moved forward to the next phase, a confirmation popup window is shown. Check the confirmation option and click the Release to Build button:

    module01 lab01 rel to build wiz
  3. Now the process is in the Build phase and ready to be implemented with the MuleSoft RPA Builder tool

    module a  lifecycle path build

Step 4: Connect to Windows EC2 Instance

  1. Using your RDP client software, connect to your Windows Virtual Machine (VM) instance. Make sure you use the address and credentials provided for you by the instructor.

    We recommend using 1680x1050 for the connection resolution. If you would like to use a higher resolution you can try, but be sure to keep the same resolution at all times.

    module01 lab02 001
    module01 lab02 002
  2. The Windows VM image provided contains all necessary tools to run this workshop. In this lab, we will use MuleSoft RPA Builder to model and implement the Module 1 automation process.

Step 5: Configure RPA Builder and Import the Process

  1. Locate the MuleSoft RPA Builder shortcut icon on the desktop and double click on it

    module01 lab02 003
  2. The first time you open the RPA Builder, you will be prompted to enter your MuleSoft RPA Manager address and credentials. You should be given these by the instructor.

    Enter the RPA Manager Address (no need to type the https:// prefix) and click Continue:

    module01 lab02 004

    Then your User Name and your Password and click Sign In:

    module01 lab02 075
  3. Once RPA Builder is opened, click on the Repository Explorer tab. In the explorer tab you should see a number of processes that are currently in Build phase. Locate your process and double click to open it.

    module01 lab02 005
    Important

    Make sure you locate and open YOUR process. Remember you should have used the following pattern to name it during module 1/step 2.3:

    <your name and surname/initials>-Module 1-Automate Data Entry into Legacy App

    If the Repository Explorer tab is not displayed, you can enable it by going to the View menu and clicking on Show Repository Explorer:

    module01 lab02 006
  4. After double-clicking your process, it will be downloaded from the server and stored locally in your Windows VM. Any changes you make will be local. Later we will see how you can upload your changes to the RPA Manager server.

  5. From the Windows VM, download the Module_1_Lab_1_start.crpa file, that represents the starting point for the current lab.

    You should have the Google Drive link sent to you along with the credentials and other workshop material. This drive contains the solution for all Labs. If you do not have access, ask the instructor.

  6. Once opened, click the Import Project option under the File menu:

    module01 lab03 002
  7. Click Yes in the confirmation dialog, locate your just downloaded .crpa file and click Open to import it.

Step 6: Configure the Imported Process

  1. Locate and click the Business Process Initialization button at the top right of the Canvas and click on the Activity Parameters link:

    module01 lab02 028
    module01 lab02 029
  2. Update the systemLogin and mail settings with values provided by the instructor. Only the systemLogin password and mailCredentials password should be missing.

    module a  upd act par after import
  3. Double-click on the existing Check Email activity and its configuration window will be opened below:

    module01 lab02 060
  4. Double-click on the Read Email element.

  5. Update (replace CC with yours initials) the subject email filter with this pattern <your initials>-.

    module a  upd mail sub filter

Step 7: Set up the basics

  1. Open the Insert Data in the system existing activity. Configure all the Activity Parameters that will be used:

    module01 lab04 009
  2. Drag and drop three Group steps and name them as follows:

    Start Legacy Application
    Login
    Go To New Invoice Form

    module01 lab04 010

Step 8: Start the Legacy Application

We will be working on the Start Legacy Application group.

  1. Drag and drop a Run Program step and open its wizard.

  2. Name it as Open Legacy Application and click on the Select File path dropdown menu option on the File name field:

    module01 lab04 011

    Navigate to the Desktop\LegacyApps\Java folder and select the start.bat file.

    Expand the Insert Environment Variable dropdown list and select the %USERPROFILE% one. It will be added at the beginning of the just populated File name path. Remove the C:\Users\workshop entry to leave the path as follows:

    %USERPROFILE%\Desktop\LegacyApps\Java\start.bat

    module01 lab04 048
  3. Set the Start mode to Minimized. Expand the Wait on Creation section, check the Wait for window to appear option and set the Window Title exactly to NTO Login:

    module01 lab04 012

    Click OK to save and close.

  4. Let’s test everything works as expected. Click the activity’s Run button and see what happens:

    module01 lab04 013

    The Legacy App is opened and once the login window (with title NTO Login) is displayed, the execution finishes and RPA Builder is restored to the foreground.

    Note

    Do not close the just opened Legacy Application as we will be working on it in the next steps

Step 9: Login

We will be working on the Login group.

  1. For the login we will use the systemLogin activity parameter which is of type user account. user account type contains user credentials and are always encrypted at rest. The only way to use the underlying data (username and password) in an activity is by first decrypting them at runtime.

    Drag and drop a User Account Decrypter, name it as systemLogin and select the Activity Parameters.systemLogin variable for the User account:

    module01 lab04 018

    Click OK to save and close.

  2. Bring the Login window to the foreground.

    You can notice that the Username input box is already focused (a blinking cursor is on it). We could inject the credentials right away, but we’re going to ignore that and pretend the focus is not yet there. Why?, to show you how you can make sure to set the focus on the field of your election for future use cases.

    Drag and drop an Image Search step and open it. Name it as Search for Username.

    Click the Start from scratch button to capture your pattern image.

    Move and resize the capture window to select the Username label as follows:

    module01 lab04 014

    Press F10 to validate the capture window.

    Click the Full Screen button and Capture to confirm the selection.

  3. Back in the wizard, select the Contour Plus algorithm, check the Wait until image is steady option and click OK to save and close:

    module01 lab04 015
  4. Now that we locate the Username label in the application, we want to left-click on the input box that is located slightly on its right, to set the focus on it.

    To do so, drag and drop a Mouse Actions step and open it. Name it as Click on Username input box.

    Notice how the Relative To setting is automatically set to the X/Y coordinates of the previous Image Search. This means that any click captured will always be based on such coordinates.

    Click on the Start button to capture the mouse actions:

    module01 lab04 019

    When the Login window appears, simply left-click anywhere on the Username input box as follows:

    module01 lab04 020

    Press F10 to end the capture. The mouse event will have been saved. Click OK to save and close.

  5. We’re now ready to inject the username and password and perform the login.

    Drag and drop a Keystrokes step and name it as Perform Login. The Keystrokes activity allows you to simulate keyboard entries.

    In the wizard window, click on the + button to enter a number of keystrokes as follows:

    module01 lab04 049
    Keystroke type Value

    Script Variable

    systemLogin.Username

    Special Character

    TAB

    Script Variable

    systemLogin.Password

    Special Character

    TAB

    Special Character

    SPACE

    module01 lab04 021

    Click OK to save and close.

  6. Let’s test what we have done so far.

    First close the Legacy Application.

    Then, click the Run button and see what happens:

    module01 lab04 025

    Login is performed, RPA Builder is restored in the foreground and you can see how the main application window is then loaded. We will be doing the rest of the operations on such main window, but it takes some time to get loaded. We do need to wait until it gets loaded before entering the invoice data!

  7. Going back to RPA Builder drag and drop a Window Wait step still in the Login group.

    Name it as Wait for main Window.

    As the legacy application main window is already loaded as we did the previous test, we can click on the Collect window titles to get all the current window titles in our Windows box. Once clicked, you can open the Window title dropdown list and locate the NTO Financial Module (normal) one.

    module01 lab04 026

    Leave the rest of the settings as default and click OK to save and close.

    If you do a new test (remember to first close the existing instance of the app), you will see how RPA Builder is not restored to the foreground until the main window is displayed and detected by this last Window Wait step.

  8. The Login group is now fully completed and this is how it should look like:

    module01 lab04 027

Step 10: Go to New Invoice Form

We will be working on the Go to New Invoice Form group.

  1. This one is easy. To move from the current tab to the New Invoice one, we just need to press ALT-3 and an additional TAB to set the focus to the first input field.

    Do so using a single Keystrokes step. Dreag and drop one, name it as Move to New Invoice Form and set focus and add an ALTDOWN, 3 and ALTUP keystokes followed by a TAB:

    module01 lab04 028
  2. Close the legacy app first and then click on Run once again to see everything works as expected. Notice how the cursor is moved to the first input field at the very end.

Step 11: Insert Data

  1. Now that we have the focus on the first input field (Invoice Number), we can proceed to enter the data.

    Drag and drop a new Group and name it as Insert Data.

    module01 lab04 050

    Within a single Keystokes step, you will be adding all data and moving the focus between all the input boxes. Again, all in a single step.

  2. Drag & drop a Keystrokes step inside. Name it as Enter All Data.

    Double-click on it to open the wizard window. Click on the + button to start adding data/keystrokes:

    module01 lab04 059

    First, you need to enter the Invoice Number data.

    In the Keystrokes Editor expand the Insert Script Variable dropdown list and locate and select the Activity Parameters.invoiceNumber variable.

    Expand the Insert Special Character dropdown list and locate and select the TAB entry.

    This is how it should look like so far:

    module01 lab04 061

    Click OK to finalise. See how the invoiceNumber variable and TAB keystroke looks like:

    module01 lab04 062
  3. Repeat the previous operations to add the following:

    ${Activity Parameters.invoiceDate}{TAB}

    ${Activity Parameters.invoiceDueDate}{TAB}

    ${Activity Parameters.invoicePurchaseOrder}{TAB}

    ${Activity Parameters.invoiceTotals} (no {TAB} is needed here)

    module01 lab04 063

Step 12: Save and Close

We have entered all data however we haven’t saved it yet!

  1. Drag and Drop a new Group and name it as Save and Close.

  2. Add a Keystrokes step and name it as TAB to Save button and click.

    Add the following keystrokes one after the other:

    TAB, SPACE and SPACE (this last one to close the informative dialog box)

    module01 lab04 056
  3. Finally, we need to close the Legacy application.

    There are many ways to close an application: use keyboard shortcut, mouse clicking, ask window to close or kill the app…​ all these can be done with MuleSoft RPA. On this case, we’ll use the ALT-F4 keyboard shortcut.

    Drag and drop a new Keystrokes step and name it as Close the app.

    Add an ALTDOWN, F4 and ALTUP keystokes:

    module01 lab04 057

    This is how the activity should look like now:

    module01 lab04 058
  4. If you want run a last test on the Activity and see how everything is working, including the application closure:

    module01 lab04 047
Submit your feedback!
Share your thoughts to help us build the best workshop experience for you!
Take our latest survey!