Running a process in the background that calls other processes that run the in the background

Hi all!

I have an issue that I'm hoping someone has a simple answer for.

I have a BP that is set to run in the background (it's long running).  It iterates through many items in a script task and then executes a sub-process passing in parameters for that item.  I'm getting the user connection in both BPs using Get("UserConnection").  Both processes run fine if the parent process is set to run in the background, but the subprocess is not.  If I try to also run the subprocess in the background, it will execute the process but it will just get stuck with a status of "Running".  None of the steps show as being executed in the execution diagram.  It's as if the process get's scheduled, but no work actually gets done.

Is there some other way I should be executing the sub-process or fetching the user connection?

Like 0

Like

3 comments

Small update here.  There seems to be no difference between getting UserConnection by referencing it directly or by using  Get<UserConnection>("UserConnection").  Works fine either way, however, I still cannot call a BP set to run in the background from the script task.  Still shows "Running" in the log, but not steps are executed.  Anyone have any thoughts?

For those that may find there way to this post, I think I found the issue.  You need to check the "Serialize in DB" checkbox as well as the "Run process in background" checkbox.



This did expose a bug, however.  If you call the process client-side using the process UID, it runs fine, but if you use the name, it will not run in the background.  See sample code below:



           var config = {

                // Process name

                //sysProcessName: "UsrProcessName",

                sysProcessId: "ee018aff-1b7f-4713-993a-61b1f065df51",

                // parameters process                

                parameters: parameters

            };

            // run process

            Terrasoft.ProcessModuleUtilities.executeProcess(config);    



The above will work as shown, but if I comment out sysProcessId and uncomment sysProcessName, the UI will lock up and show processing until the main process completes.  In other words, it effectively ignores the setting to run in the background.

Jeremy Couzens,

That is interesting and good to know. Thanks for posting this.

Show all comments