Hi,
I searched for that without an idea: is there a functionality to start/call a (child or sub)- APG-process from inside an APG-process?
The challenge behind is: to have a 'batch' process (defined with recurrence) which runs a report (aris script) to select a list of models (say outdated or so) and the responsible managers (that's the easy part) and than loop over the list found and send mail and generate a task for them in the process board and the follow-up handling.
The only way to achieve this I think is, to have to processes and to start child processes (with the "follow up handling") from the 'main' process in the loop, because if I would loop in the main process over the email+task etc. itself in one process instance, the process will stop at every task and wait for finishing the task by the responsible (and the follow-up handling) until the next occurence in the loop. That would be nonsense and not praticable - and would last weeks or months.
Can anybody help with an idea which APG-functionality I can use?
Thanks for any response
Wolfgang
Hello Wolfang,
We have implemented a functionality in APG for a customer that when one process ends, we are triggering between 1-n processes (we called this fire new stream(s)). Those processes have then their own life based on a selection of models we have made in the original process...
I do not know if this is what you are looking for, but what we have done is our last task is an automated task linked to the report service and we use the property to pass the parameters (in our case model GUI) and then we use the Context.getComponent("Process").run("name of APG process I want to trigger","parameter") command to launch other APG executable process that will have their own life. As it is a report (and we have the context of the process), we can do some additional processing (such as specific sorting, version comparaison, ...) to then trigger multiple processes according to specific conditions on our original set of models.
So you could possibly continue with the previous process, and have your batch process triggered in parallel.
Hope it helps
Cheers
Tanguy
Hello Tanguy again,
I had a try now and after solving some problems and errors while debugging I now have a report which runs in a process by an automatic task and seems to execute the command (line 20) but nothing happens. The child process is not started! Probably you (or somebody else) will have some hint for me.
What I have programmed is as follows:
var g_nLoc = Context.getSelectedLanguage();
/*var db_name = ArisData.getSelectedDatabases()[0];*/
var db_name = "ZIVIT_Entwicklung";
var db = ArisData.openDatabase(db_name, "arisservice", "arisservice", "90d64fa0-d90d-11de-3805-002186a3fbed", g_nLoc, true);
/* just for view in test and debug */
var components = new Array();
components = Context.getComponents ( );
/* define Top-Group to start from */
var topGroup ="Hauptgruppe/Prozesse/Kernprozesse/Geschäftsprozessmanagement/Geschäftsprozessoptimierung";
/* var topGroup ="Hauptgruppe"; */
var Startgruppe = db.Group(topGroup, g_nLoc);
var oSelectedModels = new Array();
/* now select all EEPC-Models from Startgruppe */
oSelectedModels = Startgruppe.ModelList(true, Constants.MT_EEPC);
/* now start child process - "Test-zyklisch-2" */
Context.getComponent("Process").run("02b7cec0-fb76-11e3-4efe-00505692002f", oSelectedModels);
/*Context.getComponent("Process").run("Test-zyklisch-2");*/
Context.setProperty("ind_akt_mods", "Test-zyklisch-2 ist fertig"); /* just for check outside */
The process so called "Test-zyklisch-2" runs, when I start it from the process administration manually and does what it should do (send me an email-message)! But it will not start from the above run-command. I also tried it with the name of the process - but bad luck. (I think it must be the GUId anyway.) No error occurs!
Any idea??? (by the way: we still use ARIS 7.2.3.b)
Best regards
Wolfgang
Hello Tanguy,
many thanks for that again - and by the way: from your code I can learn some things I'll need with my further plans. :-))
But to study your code did not solve my problem, that the called sub process was not started.
But good news: I found it out (the ARIS support sent me no answer until now by the way). I searched for information in the sever logs but the error messages there led me wrong (... is not deployed (or is marked as simulation)). I deployed the process and there is no mark "as simulation".
The real reason I now found is: you need to enter the GUID of the technical process, the BPMN-Modell into the run-command!!! Instead of the GUID of the EEPC-Model as I did. (There is nothing to read about that in the help.)
Now ist runs and starts the child process!!!!
Many thanks again for your support.
Cheers
Wolfgang
Hello Wolfgang
Great that you could realize what you wanted! Indeed I forgot to mention that the variable PROCID_ARESVALIDATION made reference to the technical process as this is the runtime version (and not the build time version)
Sorry for missing this important point.
Regards
Tanguy