Digital Exchange

 View Only
last person joined: 2 days ago 

This community is a place to discuss Blue Prism DX assets and development.

  • 1.  "Runtime Resource Startup Retry Script" no window title

    Posted 03-10-2022 14:22
    Hello,

    I would like to contact you following the analysis of the asset "Runtime Resource Startup Retry Script 1.0.0", I recovered the batch in the doc but I notice that my account only manages to recover the window title of the automate which launches correctly (for example "Blue Prism - Resource PC (Port 8184) - v7.0.1").

    I did the test by launching a automate with a "/test" parameter that does not exist or emulate the window of the blocked automate, I have the following message "Invalid command-line argument '/test'" with window title "Blue Prism" (also found in the task manager).

    However, when I run the command "tasklist /FI "imagename eq automate.exe" /fo list /v" it gives me the following result:
    "Image Name: Automate.exe
    PID: 4764
    Session Name: RDP-Tcp#8
    Session#: 5
    Mem Usage: 102,904 K
    Status: Running
    User Name: XXXXX\XXXXX
    CPU Time: 0:00:04
    Window Title: Blue Prism - Resource PC (Port 8184) - v7.0.1

    Image Name: Automate.exe
    PID: 8048
    Session Name: RDP-Tcp#8
    Session#: 5
    Mem Usage: 69,720 K
    Status: Running
    User Name: XXXXX\XXXXX
    CPU Time: 0:00:01
    Window Title: N/A"

    I also tested with the following PowerShell command "get-process | Format-Table Id, Name, mainWindowtitle" which gives me :
    4764 Automate Blue Prism - Resource PC (Port 8184) - v7.0.1
    8048 Automate

    Have you had this problem before ? I run the commands and automate with my admin account, not the system account.


    ------------------------------
    Ludovic COTTEZ-ABRATE
    ------------------------------


  • 2.  RE: "Runtime Resource Startup Retry Script" no window title

    Posted 03-11-2022 18:19
    Hi @Ludovic COTTEZ-ABRATE,

    I took a look at that script and there are a few things I would change about it. Below is an example of the revised script that I would use. I've added comments throughout that I think explain it pretty well, but I'm happy to answer any questions.

    This script strips off the main part of the Window Title which means you don't have to worry about the port number or version info in the title.
    It's also important to note that this script makes use of command extensions which are typically enabled by default, but in some organizations they prefer to turn those off.

    Lastly, if you are running multiple runtime resources on a single machine (which I do in test environments) this script will terminate them all if even a single one is in an error condition. The thought there is that your startup batch script probably handles starting all of the RR's together.

    @echo off
    setlocal EnableExtensions
    setlocal EnableDelayedExpansion
    
    set RR_WINDOW_TITLE="Window Title: Blue Prism - Resource PC"
    
    rem Loop through any instances of 'automate.exe'.
    for /f "tokens=*" %%i in ('tasklist /FI "imagename eq automate.exe" /fo list /v ^| find "Window Title:"') do (
      rem Get the current window title.
      set CURRENT_WINDOW_TITLE=%%i
    	
      if "!CURRENT_WINDOW_TITLE!"=="" (
        rem Not running, or not booted up yet, do nothing
      ) else (
        rem Extract the base portion of the window title. This allows us to bypass the specific port number 
        rem and software version information contained in the window title of a properly running Automate.exe instance.
        set STRIPPED_TITLE=!CURRENT_WINDOW_TITLE:~0,38!
    		
        rem Perform a string comparison of the current window title and the standard runtime resource title defined above.	
        echo %RR_WINDOW_TITLE% | findstr /C:"!STRIPPED_TITLE!" 1>nul
    
        rem The comparison above will set the value of the errorlevel obect. If the errorlevel is 1, there was no match and 
        rem we found a Automate.exe window displaying an error message. If the errorlevel is 0, we had a match and found a 
        rem properly running and connected Automate.exe window.
        if errorlevel 1 (
          rem Failed to connect on first try, kill automate.exe, wait 5 secs, and start it again.
          taskkill /im automate.exe
          timeout 5 >nul
          start "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\rr_startup.bat"
        ) else (
          rem Running normally, disable the scheduled task that runs this batch script
          schtasks.exe /Change /TN "Run Check Automate" /DISABLE
        )
      )	
    )
    
    endlocal
    endlocal
    ​

    Cheers,

    ------------------------------
    Eric Wilson
    Director, Integrations and Enablement
    Blue Prism Digital Exchange
    ------------------------------



  • 3.  RE: "Runtime Resource Startup Retry Script" no window title

    Posted 03-12-2022 03:35
    @Ludovic COTTEZ-ABRATE,

    FWIW - I experienced the same behavior as you for cases where the runtime resource experienced an issue when starting. It comes down to the properties of the dialog that's shown for an error. It's not a normal window.

    However, even in that case the revised code I pasted above will take care of the failed RR cases.

    Cheers,


    ------------------------------
    Eric Wilson
    Director, Integrations and Enablement
    Blue Prism Digital Exchange
    ------------------------------



  • 4.  RE: "Runtime Resource Startup Retry Script" no window title

    Posted 03-15-2022 13:34
    Hello,

    Thank you for your feedback, in our setting we also use automate launched with the system account without us being able to do otherwise.

    In your solution it will concider that the system account automate are in error every time.

    Is there an alternative in this case ?

    ------------------------------
    Ludovic COTTEZ-ABRATE
    ------------------------------



  • 5.  RE: "Runtime Resource Startup Retry Script" no window title

    Posted 03-15-2022 13:47
    Hello @Ludovic COTTEZ-ABRATE,

    I'm not sure I understand your statement. Regardless of what account started the runtime resource, the only reason it would be seen as in an error condition is if the error dialog was shown. Otherwise, if the runtime is started correctly and connects to the app server it will be shown as a regular window with a title that the DOS commands can capture.

    If this doesn't work for you, you can always try reworking the logic using Powershell. I'm pretty sure all the same capabilities are there, but they're presented using different commands.

    Cheers,


    ------------------------------
    Eric Wilson
    Director, Integrations and Enablement
    Blue Prism Digital Exchange
    ------------------------------



Welcome to the Blue Prism Digital Exchange Community!

The Blue Prism Digital Exchange is a "shop window" for new and emerging technologies—a platform that puts powerful RPA and AI capabilities into the hands of business leaders. Users can find and apply pre-built AI capabilities, in the form of downloadable integrations and Visual Business Objects (VBOs), to automated processes. These assets connect and integrate Digital Workers, existing systems and processes to Blue Prism's technology partners, creating a solid foundation of AI-enabled Intelligent Automation that's scalable and sustainable.

Blue Prism Digital ExchangeDX Asset IdeasContact DX Support

FAQs

The Blue Prism Digital Exchange (DX) is an online marketplace where businesses can instantly access, apply and share pre-built AI, cognitive and advanced RPA technologies from best-in-class providers. These assets easily connect to existing digital workers, systems and processes to enhance automation capabilities.
The Digital Exchange is free to all users. Most of the content on the DX is free to download but there are some submissions that do have a cost associated. The submissions with a cost are advertised on the asset card and profile. No unwanted costs will be applied to any users.
You can visit and browse the Digital Exchange here. If you would like to consume or download any material it is necessary to create an account on the Blue Prism Portal first.
Everyone can access the Digital Exchange and consume the assets on it. If you would like to contribute to the marketplace it is necessary that you create an account and sign up as a partner.