cancel
Showing results for 
Search instead for 
Did you mean: 

Running process on a bot from another bot

MayankGoyal2
Level 8
Hi,
I have to call a process on a certain bot from a different process on a different bot. the aim is to have a central bot that is running a process and calling process on different bots.
Is there something available in blue prism to achieve this, also how will the central bot check if other bot is busy running something and in that case pass request to a different available bot.If all bots are busy, queue the request and as soon as next bot is free, it picks up the request.

------------------------------
Mayank Goyal
------------------------------
1 BEST ANSWER

Best Answers

John__Carter
Staff
Staff
You can do it but it can be difficult. Essentially the first process employs the command line to run a process on the other machine. If the first process retains the session ID output of the run command, it can enquire about the status of the session. If the target resource is busy or offline, the run command will return an error. Alternatively, the first process can check the machine status prior to trying to run the process, but that requires 2 calls.

https://portal.blueprism.com/documents/guide-dynamic-process-execution
https://portal.blueprism.com/documents/blue-prism-dynamic-scheduler-examples

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

View answer in original post

23 REPLIES 23

John__Carter
Staff
Staff
You can do it but it can be difficult. Essentially the first process employs the command line to run a process on the other machine. If the first process retains the session ID output of the run command, it can enquire about the status of the session. If the target resource is busy or offline, the run command will return an error. Alternatively, the first process can check the machine status prior to trying to run the process, but that requires 2 calls.

https://portal.blueprism.com/documents/guide-dynamic-process-execution
https://portal.blueprism.com/documents/blue-prism-dynamic-scheduler-examples

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Espen
Level 3
If you go with AutomateC.exe, make sure the connection you use for the command-line call does not use the same callback-port as the listener on the "master "bot.

If you haven't specified any callback port (set to 0) you don't have to worry 🙂

------------------------------
Espen
------------------------------

@John Carter - Thanks a lot for your response, is there any link that shows direct implementation of using commands to run process. Also this will work only on a machine that has blue prism installed?
Can this be created as a shell script? Within my shell script i want to first check if a system is busy and if not then invoke a process on it.

@Espen - Kindly provide some more details or example, i wasn't able to understand it. If I create a bat file with ​commands, where exactly and how callback port comes in play?

------------------------------
Mayank Goyal
------------------------------

If you have the DB-connection set to a specific callback port on the master bot, the port will be busy.

Eg. DB Connection "Con1" is set to callback port 1234.

When starting a process from AutomateC you have to pass an argument for DB-Connection.
Assuming the listener is running, you can not use "Con1" as argument for AutomateC when starting the process from the bot. Either set the callback port to 0 or set up a second connection.

I don't know how you guys have your set up, but in our environment we faced this issue.

------------------------------
Espen
------------------------------

Try the Help, search for 'command line'. or look at the examples I linked you to. The command line API can be scripted and requires BP to be installed. There's also a HTTP API providing similar functionality to a 3rd party.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

@John Carter ​- Thanks a lot for your response. Kindly suggest if HTTP API you are referring to is concept of running blue prism process as a web service?
With command line, if I have a script can I run it from a external application?

------------------------------
Mayank Goyal
------------------------------

Search the Help, in there you'll see the API is not the same as exposing a process as a WS.

And yes the command line is intended to be run from a 3rd party.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

@John Carter ​- kindly suggest if it will be possible for blue prism team to release a standard reusable business object that takes process, start up parameters and machine name as input and execute the process if resource is not busy and if busy may be throw appropriate exception. This might be quite useful to lot of users.

------------------------------
Mayank Goyal
------------------------------

@John Carter ​- Hi John, I tried some steps taking help from dynamic process execution guide and examples. It was quite helpful and gave me lots of information.
1) using command automatec /run "Process Name" /user "id" "Pass" /resource "machine name" - I was able run a process and get session ID
2) using command automatec /status "session ID" /user "id" "Pass" - I was able to get status of session ID

Few Questions that I still have are - 
1) What is the use of DBname and port, i didn't used it anywhere in my command. Is it used when there are more than 1 DB connections and i want to run process from DB on a resource which is not set as default DB?
2) Before running actual process, I want to check if my resource PC is up (online) and not busy running another process, what command should I use to achieve this and what all will I have to pass to that command - machine name, credentials?
3) If my resource PC is offline on that remote machine, is it possible to first start resource PC on different machine like we do it on local machine as - Automate.exe /resourcepc /public
4) When working with login agent and scheduler, we run the login process of login agent before running the main process and run logout process after main process, so which AutomateC as well we will have to design same chain of process?

------------------------------
Mayank Goyal
------------------------------