Ok, just found that not all added services fail. If I add 100 jobs it works as in serviceengine the value "jobs" == 100. If I add 200 jobs, 100 will fail. If I change the jobs value to 50, 50 of 100 will fail. I have to check why. Does not make sense to me right now.
Thanks for your help. Best regards, Ingo -----Ursprüngliche Nachricht----- Von: Ingo Wolfmayr <ingo.wolfm...@wolfix.at> Gesendet: Dienstag, 7. März 2023 09:52 An: user@ofbiz.apache.org Betreff: AW: Async Services Hi Michael, the dispatcher is available when the script is called (it’s a groovy service that calls another service - async). The async service is added to the jobSandbox. When it is started, the job is missing dispatcher: dctx.getDispatcher() In a loop: Map serviceCtxx = [:] serviceCtxx.put("instance", p) serviceCtxx.put("userLogin", userLogin) dispatcher.runAsync('addToSolr', serviceCtxx) I use webtools to run the service above. In the example the addToSolr service is added to the jobSandbox and fails. Best regards Ingo -----Ursprüngliche Nachricht----- Von: Michael Brohl <michael.br...@ecomify.de> Gesendet: Dienstag, 7. März 2023 09:32 An: user@ofbiz.apache.org Betreff: Re: Async Services Hi Ingo, with a dispatcher of null, I wonder how it should be possible to run a service (synx or async)? If it is a groovy script in the context of a screen, you should have dispatcher and delegator available. Else you should provide more information of the process/code. I am not aware of any additional data you have to provide. The service engine just takes the provided service context and stores it as RuntimeData together with the job in the JobSandbox instead of running the service directly. Best regards, Michael Brohl ecomify GmbH - www.ecomify.de Am 07.03.23 um 09:16 schrieb Ingo Wolfmayr: > Hi Michael, > > thanks for the fast response. I have one more question: > > I created a services that is fired inside a groovy script - async. When I > define persist = "true" the dispatcher is null / delegator not defined. I use > tenants. > > Sync works. > Async with persist = false works > Async with persist = true fails > > Did I miss something? Should I pass some specific data to the service when > using persist = true? > > Best regards, > Ingo > > -----Ursprüngliche Nachricht----- > Von: Michael Brohl <michael.br...@ecomify.de> > Gesendet: Dienstag, 7. März 2023 08:57 > An: user@ofbiz.apache.org > Betreff: Re: Async Services > > Hi Ingo, > > with persist = true, the async service will be persisted in the Job Sandbox > and executed, els it will only be executed. > > Best regards, > > Michael Brohl > > ecomify GmbH - www.ecomify.de > > > Am 07.03.23 um 08:24 schrieb Ingo Wolfmayr: >> Hi Michael, >> >> sorry "persist". >> >> Best regards, >> Ingo >> >> -----Ursprüngliche Nachricht----- >> Von: Michael Brohl <michael.br...@ecomify.de> >> Gesendet: Dienstag, 7. März 2023 08:21 >> An: user@ofbiz.apache.org >> Betreff: Re: Async Services >> >> Hi Ingo, >> >> where did you find this option and for which version? >> >> Best regards, >> >> Michael >> >> Am 07.03.23 um 08:04 schrieb Ingo Wolfmayr: >>> Hi Community, >>> >>> I would like to know what is the difference between an async service with >>> option set "permit = true" or "permit = false". >>> >>> Best regards, >>> Ingo >>>