Suppose I have 3-4 aggregates at the screen. (mobile or web)Will these run synchronously , will these run in order from top to bottom , or run asynchronously ?Can anyone help me that what is process to run these multiple aggregates.also Can I debug in aggregates.
Hello Manish,
These run in order from top to bottom, and yes, you can debug your aggregates.
about debug:
https://www.youtube.com/watch?v=jKcTIxARcyQ
Regards.
Agno Silveira wrote:
Hi Agno,
I think this is not a exact answer.
Let me have a scenario like -
I have a screen with list widget and 3 aggregates on the screen like
1. GetOrders,
2. GetCustomer,
3. GetCities
I have checked it and found the event "OnAfterFetch" runs on aggregates like in order GetCities,GetCustomer and then GetOrders.
This is not from top to bottom.
I see that it runs asynchronously.
Kindly check and clear my answer if possible
Thanks & Regards
Manish
If you have 3 aggregates in the preparation, they will run from top to bottom, or from the start node to the end node.
And yes, you can debug the output of your aggregates, you just have to add a breakpoint on the aggregate or in the start node.
Best regards,
MP
Manish Kumawat wrote:
Hi Manish Kumawat,
Can you elaborate on your problem?
Aggregates basically allow you to perform query's such as "AdvanceQuery" component.
What are you trying to do?
Multiple Query's on preparation?
If you have multiple Aggregates in your flow they will be executed according to their position.
Following the example above the aggregates will bu executed in the following order:
aggregate1
aggregate2
aggregate3
You can debug and see the inputs and the output of the aggregate. You can not debug the "aggregate" itself.
Hope this helps.
Best Regards
Rodrigo Henriques
rodrigo henriques wrote:
Hi rodrigo henriques,
I am not using web application and do not have preparation.
I am using Mobile application and I see that there is no preparation.
Only I can see multiple aggregates on the screen mobile . and do not have a flow chart for this.
What would be the order to run those aggregates?
can you please help me
MK
Hi Manish,
Aggregates on web applications was already explain. In mobile is different and you should check this document. But basically the the initialize event ends the aggregates are fetch asynchronously and concurrently. and when they are done a after fetch event is triggered.
Regards,
Marcelo
In mobile and reactive web applications aggregates run asynchronously on screens. If you are calling them in any action then only they will run synchronously in the same order they are in flow.
Dear Manish,As I understand your question, you are using 3 entities on screen using direct aggregates like below:
In above case, It will run asynchronously on the screen.But if you have huge data, the best approach to achieve it will be using a single server action (Fetch Data from Other Sources) and use it as preparation of screen. (in above exaple, its ScreenPreparation).In side that you can use multiple aggregates. and it will be synchronous single server action like below:Hope your doubt is now clear using above example. Regards,Palak Patel
Palak Patel wrote:
In above case, It will run asynchronously on the screen.But if you have huge data, the best approach to achieve it will be using a single server action (Fetch Data from Other Sources) and use it as preparation of screen. (in above exaple, its ScreenPreparation).In side that you can use multiple aggregates. and it will be synchronous single server action like below:Hope your doubt is now clear using above example.Regards,Palak Patel
This is fine for normal tables, but how to do the same for aggregates of local tables?
Given your screenshots and descriptions, I understand that you are working on mobile application.
On mobile application, all the screen level aggregates run in parallel, that is, they are async in nature.
Please refer
https://success.outsystems.com/Documentation/Best_Practices/Mobile_Data_Load
Depending upon the number of records (few records / bulk data) and source (Local DB / Server DB) of the aggregate the on after fetch is fired.
Just to clarify,
On After Fetch is just a callback which is fired when the aggregate has fetched the records. This provides a handler to process data, if needed, after the data has been fetched.
On WEB,
There is no concept of aggregate at screen level. You have to call the aggregate in the preparation and/or actions and and handle processing the fetched data. These aggregates work in sync mode.
Saugat
I think, the initiation or invocation of aggregates will follow the order of occurrence in the code (main thread.) but execution of aggregates will be asynchronous ( spawns a new thread ..separate process).On after fetch is a result of completion of the asynchronous processes, and hence they will not have any order, followed by rendering. I believe, if you execute any logic on OnAfter Fetch event, one should be careful about not having any dependency on other aggregate results, otherwise it will lead to issues that will be very hard to figure out.