Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

GateWay No-Wait Problem

Avatar

Level 3

Hi,

I'm trying to implement a process that gets from DB set of "visits" then I'm trying to send these visits to their users, so I used gateWay that includes a subprocess,the gateWay's control type is NO-WAIT to send the visits to all users at the same time, I used a SetValue to do counting.

but the gatWay loops n-times (the number of visits) without calling the subprocess then it calls the subprocess n-times so all the tasks will be sent to one user?

am I doing somthing wrong?

p.jpg

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I agree with $Nith....you do not need the Gateway....simply call the subprocess in your loop. Each time you loop through a new subfprocess will be called. You are right that the last user will have to wait until all the others are sent ....but he wil not have to wait until they respond. Just make sure that you set the Invocation Policy to "Do not Wait"

Paul

View solution in original post

5 Replies

Avatar

Level 10

Is your subprocess short lived?

If yes, you can completely remove the gateway and place the Confirm Visit subprocess between GetNext User & C++ activities.

Adding gatway in this case will run the Sub process in a separate thread. You cannot depend on the order of execution at this situation.

Nith

Avatar

Level 3

Thank you Nith,

     Is your subprocess short lived? No

    

In my case I have to send for each User a pdf to sign, so if I removed the gateway , the tasks will be sent one by one to the users and the last user has to wait for all previous user to accept their tasks and this is wrong, I want to send the tasks to all users at the same time without waiting for anyone acceptance,  because of that I used the gateway with NO-WAIT thought that it will call the subprocess for each iteration without waiting for the subprocess to be finished.

Avatar

Correct answer by
Former Community Member

I agree with $Nith....you do not need the Gateway....simply call the subprocess in your loop. Each time you loop through a new subfprocess will be called. You are right that the last user will have to wait until all the others are sent ....but he wil not have to wait until they respond. Just make sure that you set the Invocation Policy to "Do not Wait"

Paul

Avatar

Level 10

Can't you simply just use the Assign Multiple Task instead. This will allow you to send the task to multiple users in parallel without the need of a Gateway.

Jasmin

Avatar

Level 3

Paul, thank u, I did not know about the  "Invocation Policy", because I'm new in Adobe LC

Jasmin, thank u for your reply, but in my case I have to send different docs for different users, so I "Guess" the send to multiple users will not work!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----