cancel
Showing results for 
Search instead for 
Did you mean: 

Is it advisable to invoke a sub-process from Main Process

JoshuaKingsley
Level 4
Is it advisable to invoke a sub-process from Main Process which runs in a scheduled manner?   Scenario: "Mainframe - Basic Actions" is an Object which has common actions like Launch, Login, Terminate, etc. This Object interacts with the application directly. Requirement: We have to work with multiple Mainframe Sessions. i.e., Launching new session separately.   Problem Statement: We cannot use the same Object to launch all mainframe sessions since, detach/terminate action terminated the application instead of detaching. Launching another session with same Object will throw an error saying "Already launched"   Solution: 1. Usage of Wrapper Object. Using a wrapper object which calls these actions, also fails, as the Object is still in the memory. - Didn't work 2. Usage of Sub-process. These small sub-processes calls the Basic Action object and releases the memory of that Object and without terminating the Mainframe sessions.   Question: Is it advisable to create small sub-process to launch, login or terminating based on choice? Please tell if this type of setup can be used efficiently without any problem in the flow.
5 REPLIES 5

Mustafa_UlasYig
Level 6
Hi Joshua Hope I understood you questions correctly, here goes: See my solution here: https://portal.blueprism.com/forums/technical-queries/spyingapplication-integration/i-can-not-spy-app-mainframe-tn3270-tn5250-71 - for how we connected to a Windows 3270 / 5250 / VT/ANSI Mainframe terminal emulator. In our terminal emulator the session identifier is of great importance, and every time we have to launch and terminate the Mainframe BO the session identifier might change, so we cannot just assume that we start with session identifier ""A"". This might not be an issue with the emulator that you are using, but if it is, then this is what I recommend. In our setup we have 2 BO's: 1 Mainframe Win32 BO whose sole purpose is to launch and read session identifier, (because we cannot read this value in our Mainframe BO) and 1 Mainframe BO which is launched - after detaching the Mainframe Win32 BO - with the correct session identifier (read in the Mainframe Win32 BO). With this setup you should be able to have multiple sessions open, with the same or different session identifier, because you always attach and detach between the 2 BO's and read the session identifier, before detaching the Mainframe Win32 BO and attaching to the Mainframe BO. However I cannot test if this works in our setup properly, since our Mainframe only allows for 1 session per user to be connected up towards the terminal, after logging in to the terminal. Though we are able to have several session windows open simultaneously and login, so our setup should be able to accommodate your needs to run multiple sessions. Good luck. BR, Mustafa

JoshuaKingsley
Level 4
Hello Mr. Mustafa, Thank you for your response. We are using COM API, where we give the path file in the Application Wizard itself. So, when we use a Mainframe type of BO to launch the Mainframe; the BO attaches automatically to the Application with Session ID we give in the Application Wizard or the Session ID which we pass it in the Navigate Stage. If we call terminate action, the BO will not detach but terminating the Application. Also there is no Detach option. I guess you have not used this type of Mainframes. Blue Prism has mentioned these types in documents. But, my quesion is more on 1. The using a Sub-Process inside a Process. 2. How much time will the Garbage Collector need to clear the memory? Since the document has mentioned memory leak is possible while calling a Sub-Process, my team needs confirmation on safety by calling a Sub-Process.   With regards, Joshua.

Mustafa_UlasYig
Level 6
Hi Joshua Yes BP supports 4 different COM API type Mainframes (IBM, Micro Focus, OpenText and Rocket), I know. Yes I am not saying you have to use 2 BO's, like I have, but if you do not have control over which session identifier the mainframe connects to, then having 2 BO's is a better solution. Yes, when having 1 BO's and calling terminate action, the application terminates. But when you have 2 BO's, the terminate action in the Mainframe BO (not Mainframe win32 BO), detaches instead of terminating.So having 2 BO's where detaching is possible could free up memory, and is therefore advisable. But yes, I have not used COM API type mainframe's, correct. Not sure if this can help you: https://portal.blueprism.com/forums/technical-queries/processobject-studio/wrap-repeatedly-called-processes-object & if you write ""how do i diagnose and avoid out of memory issues"" in the ""Have a question"" Bold360ai widget, you see to the left on most pages on portal.blueprism.com (The questionmark in the blue & white box to the left): ""Garbage Collection The concept of ""garbage collection” is that the operating system will periodically (during “’free time”) reclaim memory which has been designated as available to be recovered – that is, memory which is no longer being used to store information required by running applications. Blue Prism retains data which has been created within it until the “automate.exe” process is closed down. In order to reclaim memory which data is occupying whilst the Blue Prism process is running, the following strategies can be employed to attempt to force the underlying operating system to recover unused memory, and therefore make it available to Blue Prism again. Note: The concept of garbage collection is a complex one, and the following information is a simplification of the underlying decision-making which the operating system is doing. There isno guarantee that the operating system will free up memory simply because these tactics have been employed, as this is outside of the control of any specific application. Forcing garbage collection Blue Prism can use .NET code functions in a Code Stage. One useful function relating to garbage collection is the GC.Collect() function. This requests that the operating system recover memory marked for collection as soon as possible. To use this function create a Code Stage in an Object and then publish the page as a Business Object action which can then be called from within a Process."" So create a code stage calling that function, but I cannot tell you what ""as soon as possible"" means. BR, Mustafa  

JoshuaKingsley
Level 4
Thanks a lot for your comment! Yes, we also use Windows type BO for mainframes to bring it to focus and other basic stuffs.. But the basic actions like launch, login, terminate, etc cannot be reused, in this case.   Thanks for the content on memory! :) I guess the term ""as soon as possible"" will occur only when the OS thinks the memory might not be sufficient, or left unused for a long period. Regards.

AndreyKudinov
Level 10
Just a notice: subprocess logging is broken in 6.0 and 6.1 I believe.