cancel
Showing results for 
Search instead for 
Did you mean: 

Read the state of a Resource PC

ZdravkoBotushan
Level 4
Hi guys,

I noticed that the scheduler I've set up doesn't always log in the machines. How can I read the State of a Resource PC programmatically, so I know if the machine went into "Idle" or is still in "Logged Out" and can automate that.

E.g. Read state of machine 01. I get "Logged Out". I have code that runs the log in process again, if the state is logged out.

16812.png

------------------------------
Zdravko Botushanov
Senior RPA Consultant
Human+
Europe/Sofia
------------------------------
13 REPLIES 13

EmersonF
MVP
You might be looking at this in the BPAResources table, it will return the name and current status of the machine!

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

I want to read the state of the machine programmatically, not manually.

------------------------------
Zdravko Botushanov
Senior RPA Consultant
Human+
Europe/Sofia
------------------------------

@ZdravkoBotushan,

@EmersonF's response is a programmatic example. There is no direct API exposed by Blue Prism for what you're looking for. You're options amount to:
  • Query the database, as Emerson alluded to.
  • Use the HTTP interface of each individual runtime resource to get it's status. You can find more about the HTTP interface in the BP help files.
  • Use the AutomateC CLI (you could call it via a VBO code stage).
Cheers,
​​

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

As @Eric Wilson commented there are some ways to do this, I believe the simplest is you consulting the bank directly, but you can create a process that does this reading and saves a txt with the information and would schedule that process.

You could expose this process described above and get the result via SOAP Request, if any...

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

EmersonF
MVP
You can also be using the CLI, look for "/resourcestatus" in Blue Prism CLI Journey - blueprism® DX

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Hi @EmersonF and @ewilson

Thank you for the answers.

To be honest, I did try the CMD options, which I found on the BP website.

The thing is, everything I found (e.g. the /resourcestatus one Emerson suggested) all return information on the sessions running on a resource PC and not the resource state.

What I really need is to know when a machine is not in its proper state. For example, sometimes, 1 of the machines goes into "Missing (X seconds)..." and I don't want to go and check every time. I want to make a simple process that checks if the machine is Idle, Logged Out or Missing and run a "shutdown /r /m",

I couldn't find neither a VBO, nor a Command Line function to get that.
​​

------------------------------
Zdravko Botushanov
Senior RPA Consultant
Human+
Europe/Sofia
------------------------------

ewilson
Staff
Staff

@ZdravkoBotushan,

I don't believe there's any API or interface that will give you information about the logged-in state​ of a resource PC. You can get information about whether a resource PC is available to run a process, what specific state (ex pending, running, completed) sessions are on that resource, what types of processes it's available run, and whether it's online. 

All of those options are available via the resource PC commands that can be executed via the HTTP interface on each runtime. You can find more about that interface at the following 2 links:

https://bpdocs.blueprism.com/bp-6-10/en-us/helpHTTPInterface.htm?Highlight=HTTP%20interface

https://bpdocs.blueprism.com/bp-6-10/en-us/helpResourcePCCommands.htm

Beyond that, there's a tool on the DX for monitoring resource PC's and sending email or text notifications if they become unresponsive.

https://digitalexchange.blueprism.com/dx/entry/9648/solution/blue-prism-resource-pc-monitor

Cheers,



------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

@ZdravkoBotushan I guess you should try the database query approach  within a process and which keeps returning you current state.

Only additional point is that you should try this with no lock hint as executing select query back to back may impact the prod DB. ​

------------------------------
Tushar Varshney
Senior Consultant - Intelligent Automation
Ernst & Young India
+91-9880188366
------------------------------
Tushar Varshney Senior Consultant - Intelligent Automation Ernst & Young India +91-9880188366

@ZdravkoBotushan,

FWIW - You could try using the WMI interfaces via C# or VB.NET to determine if someone is logged in on a resource PC. Whatever process runs this check would probably need elevated permissions, but the combination of that and the other options listed above should give you most of what you're looking for I think.

Cheers,


------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------