Posted: 20 Aug 2017 1:01 EDT Last activity: 6 Nov 2018 20:02 EST
StartMethod - Monitor All | How to manually start an application?
I am trying to implement a simple Pega - RDA integration.
Requirement : I need to populate the content of a Notepad file on my Pega screen.
Implementation so far : I have added and global container and added the robotactivity component as well. The call from Pega to "Runtime" is smooth.
Query: Since this is a desktop application, let's say i pass a list of filepath's from pega to RDA (one per each screen),
this means, i should not be having a new notepad file open, rather i should be "Starting" notepad app everytime the RobotActivity is invoked from Pega. (idelly on the Pega's preprocessing point before the file's content is populated on screen)
In this case, i think i should change the "StartMethod" of the Notepad app from "Start" to "MonitorAll". In this case, how do "Start" the application??
Note: I have written the automation in such a way that it opens a new / empty notepad file after which i make use of the "open" menu and pass the intended file's path as a parameter by which i open the actual file and read the content of it.
The reason i am looking out to change the start method is because it is not conventional to keep the application running as soon as the adapter gets started, rather the app should launch only when invoked by a Robot Activity.
Please let me know what i am missing.
Thanks in advance,
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
I do not understand your use case and why you want to use MonitorAll. That StartMethod is generally used when something (or someone) else is starting the application and you want to ensure that you can interact with it. Calling the Start method when MonitorAll is used simply gets the adapter running and listening for the process to start. Typilcally, StartOnProjectStart is set to True and it is always listening. If you use the StartMethod of Start, then Pega Robotics will start the application whenever Start is called. If you want multiple instances of the application running, then you will need to use MonitorAll, however you will also need to enable UseKeys in your adapter and manage the various instances.
To launch an application either for MonitorAll or because you don't want it controlled by Pega Robotics Runtime;
Right-click on your Toolbox and select "Choose Items...".
Select the "Pega Robotics Static Members" tab.
Select the "From Global Assembly Cache" checkbox.
Select the "System" assembly.
Locate the "Process" node and check the "Start" method.
You can now drag this out to your automation and pass it the path to your application to get it started.
As per my use case, I have multiple points in Pega through which it fires multiple automations. To achieve this i need my "Robotics Runtime" to be up and running in the client system.
Let's say that there are 4 point (flow actions) where Pega tries to fire these automations. At each point pega provides a file path in the request. Based on this file path a txt file is opened and the content of the file is sent back as the response to Pega.
To achieve this i have interrogated with the default Notepad.exe app.
If i export the project and load it on the "Robotics Runtime" which is running independantly (not as in the debug mode of the developer studio) as soon as the project is run, i get a blank Notepad.exe app running. Although i don't have any problem in getting the data from the files every time as the prior mentioned flow action is executed, I am not okay with having the notepad app running when the project is loaded initially. I believe this is because of the way "StartMethod" is configured.
This is why i was looking at tweaking the "StartMethod" to "MonitorAll". Then i used the "Start" method of the Notepad.exe windows app to be executed after the robotic activity component. This didn't work as expected.
Let me know how to proceed from this point.
Thanks in advance.
Posted: 3 years ago
Posted: 22 Aug 2017 9:22 EDT
Thomas Sasnett (ThomasSasnett)
Lead Robotics Architect u2013 Pega Consulting
If you change StartOnProjectStart to False, the adapter will not run on startup. When you need to perform your automation, you can just call the Start method to get it running and begin your automation. You can either stop (call the Stop method) it after you have completed, or leave it running. You can check the IsRunning property to tell if it is started or stopped, but likely if the main window is closed, it will be stopped..