Written by

Question Yone Moreno · Oct 18, 2024

Help Needed: How to Ensure BPL ????? for All Asynchronous Calls Before Proceeding?͓̽

Hello,

First of all: thanks for your help, and thank you for your time.

Thanks for your time.

We have the following situation:

We are in a BPL, and we have defined 4 <call> asynchronous as follows:

First one name: "Enviar a Proceso NEGRIN"

The second one, named as: "Enviar a Proceso HUNSC"

The third one, titled: "Enviar a Proceso CHUIMI 02"

And the fourth and last one names as: "Enviar a Proceso Fuertev"

Inmediately after the 4 calls, we have a <sync> instruction which should wait for all of them to finish.

It has in the calls text area the name of the four ones which it should wait for: "Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev"

If we zoom out the BPL, we see it spots in green the 4 previous calls:

However, when we test it, we see in the Visual Trace the following behaviour:

We would like that the Process would wait for [12], [15], [17] and [19]... but it does not wait... it just get the first <call> response as seen in [12] and it executes the following <code> block which obviously fails...

Finally, we have the following doubt:

How could we say to the BPL to wait always for the 4 <call> response before executing the next <code> block?

We have read the following documentation to solve it by ourselves:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

https://es.community.intersystems.com/post/call-as%C3%ADncronicas-din%C…

Product version: IRIS 2023.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2023.1 (Build 235_1U) Fri Jun 2 2023 13:23:04 EDT

Comments

Yone Moreno  Oct 18, 2024 to Luis Angel Pérez Ramos

Thank you for your answer @Luis Angel Pérez Ramos 
 

However, as I detailed in the first post the <sync> command does not do what it is supposed that it does.

We have used it as follows:

<sync name='Esperar respuestas' calls='Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev' timeout='"PT30S"' type='all' xpos='200' ypos='2550' />

But it does not stop the BPL execution until all the 4 calls finish with a repsonse... it just waits until the first call gives a response, and then it continues.

Could you help us, please?

Thank you.

0
Luis Angel Pérez Ramos  Oct 18, 2024 to Yone Moreno

Try to put together all the calls followed by the sync, all of them inside the scope and at the end, after the sync, the catchall.

0
Yone Moreno  Oct 18, 2024 to Luis Angel Pérez Ramos

Thank you @Luis Angel Pérez Ramos , for your time and help.

We have put together all the calls followed by the sync, all of them inside the scope and at the end, after the sync, the catchall, as follows:

Being the scope as follows:

<scopexpos='200'ypos='450'xend='200'yend='1500' ><callname='Enviar a Proceso NEGRIN'target='Radiologia.CConcertadosOrdenesNEGRIN'async='1'xpos='200'ypos='650' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesNEGRINRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.CConcertadostoPACS.Radiologia.BusquedaOrdenesNEGRINResponse' ><assignproperty="context.busquedaOrdenesNEGRINResponse"value="callresponse"action="set" /></response></call><callname='Enviar a Proceso HUNSC'target='Radiologia.CConcertadosOrdenesHUNSC'async='1'xpos='200'ypos='850' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="1" /></response></call><callname='Enviar a Proceso CHUIMI 02'target='Radiologia.CConcertadosOrdenesCHUIMI'async='1'xpos='200'ypos='1050' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="2" /></response></call><callname='Enviar a Proceso Fuertev'target='Radiologia.CConcertadosOrdenesFUERTEV'async='1'xpos='200'ypos='1150' ><requesttype='Mensajes.Request.Radiologia.CConcertados.BusquedaOrdenesRequest' ><assignproperty="callrequest"value="request"action="set" /></request><responsetype='Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesResponse' ><assignproperty="context.listaBusquedaOrdenes.PacientesDerivadosCC"value="callresponse"action="insert"key="2" /></response></call><syncname='Esperar respuestas'calls='Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev'timeout='"PT30S"'type='all'xpos='200'ypos='1250' /><faulthandlers><catchallxpos='200'ypos='1350'xend='200'yend='250' /></faulthandlers></scope>

However, when we test it, we observe the following Visual Trace:

The BPL should wait to receive [12], [15], [17] and [19] before continuing executing the code below the <sync>... but it does not wait for the 4 replies... it just wait for one of them.

The <sync> is configured to wait for all the fours <call>

"Enviar a Proceso NEGRIN,Enviar a Proceso HUNSC,Enviar a Proceso CHUIMI 02,Enviar a Proceso Fuertev"

But it does not wait for all them.

Why?

How could we solve it?

Thanks for your help and time.

0
Mike.W · Oct 18, 2024

All I can think of is the timeout setting. The documentation says it should be in seconds, i.e. an integer, but you have "PT30S" which might be treated as zero?

0
Yone Moreno  Oct 18, 2024 to Mike.W

Thanks @Mike.W for your reply and help.

We have written the timeout as 30 and as "30" and in both cases it behaves wrong. It justs receives the first <call> response and it continues the BPL execution flow, without waiting for the other 3 replies:

Being the setting as "30":

And behaves similar with a timeout of 30:

30:

We do not know why.

Thanks for your help.

0
Luis Angel Pérez Ramos  Oct 18, 2024 to Yone Moreno

Try removing the Tiempo de espera and... Could you show the popup when you click on the magnifying glass of Llamadas? Just to be sure that it had correctly detected the calls.

0
Yone Moreno  Oct 18, 2024 to Luis Angel Pérez Ramos

Thank you @Luis Angel Pérez Ramos for your reply, let's see:

When we click on the magnyfying glass of Llamadas:

We see all the 4 <call> checked.


We have removed the timeout:

And it behaves like this:

It does not wait, for the 4 calls ^

Could you help us?

0
Mike.W  Oct 18, 2024 to Yone Moreno

The documentation examples all have <sequence> blocks around the calls and sync. Your code only has a <scope> block in the bit we can see. Maybe try adding a <sequence>... </sequence>?

Actually, thinking about it, the behaviour is as if you had in the sync an attribute:
type='any' 
but I can see you have:
type='all'
Maybe try changing the "type"? or removing it completely, as the default is "all"?

0