[Reactive] Aggregate in a Data Fetch or Aggregate in an Aggregate

In a Reactive screen/block, if GetProduct is referenced inside DataAction, when is the DataAction going to be executed? Will DataAction wait until GetProduct is available?

The same question if GetProduct is referenced inside GetOrder.

Both are marked to run "At start".

Hi Francisco, 

In this video, you can see how the data is loaded.


https://www.outsystems.com/learn/lesson/1947/displaying-data-on-screens 

I hope it helps.

Regards.

Hi Francisco,  

Each one that is configured to run at start will start async, they will start and end independent of each other.

Regards,

Daniel

Hello Francisco.

If you need the data from the aggregate inside your DataAction, one option is the following:

1. Change the Data Action Fetch property from At Start to On Demand.

2. Add a handler to the On After Fetch event of the Aggregate, and place a Refresh Data to the Data Action.

This way, the Data Action will be executed only when the Aggregate already fetched its data.

Another way is to place the Aggregate inside the Data Action itself and if you need its data in the screen, add an Output to it (but then, everything in the Data Action will be executed synchronously).    

Hope this helps.

Cheers.

Solution

Hi Francisco,

Yes, when you have dependencies between aggregates or data actions the system automatically chains the requests.

Cheers,
Tiago Simões

Solution

Ah! Good to know :) lol 

Good question Francisco! And thanks Tiago for the answer, I did not know that too :).

If there is going to be a Professional Reactive Developer certification one day, this is a question to put in the exam. ;)

There will be a certification like that :)