How do I run a process (Client Or Server) asynchronously or in the background?
Question
Application Type
Mobile

Hi all!

So I have noticed an issue where some computation logic that I have takes awhile to complete before it continues on to the next screen. The data computed is not necessary for the next screen, as it is mainly just some calculations and for-each loops to produce results for another screen. 

Therefore, I was wondering how I should go about having this computation running asynchronously or in the background so it doesn't cause the client to have to wait for this computation logic to end before continuing on to the next screen.

I hope my question is easy to understand.

Cheers! 

Lucas

mvp_badge
MVP

Hi Lucas,

You can use light BPT in your case. For this you need to create a process with automatic activity and can launch the process from your action logic.

Here is the reference link: https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Processes_(BPT)#light-process-execution

Thank you for your reply! 

I have been trying to read on light BPT but I am having trouble with understanding how exactly BPT works, and how to use it exactly. 

Do you know of any resources which I am able to look at that shows a step by step of how I can implement BPT into my app? Apologies but I am really new to OutSystems and it is taking me a long time to pick up on things.

Cheers!

Lucas

A little sidenote is that if you specifically want to use Light BPT, then you cannot use the Launch<Process> activity. This will cause the process to fallback to normal BPT execution. Only the creation of a new record can be used to trigger a LBPT-process.

Regards,
Lennart

Hello Nikhil, 

Okay, I have a slightly better understanding of BPT now. I have tried to implement it into my app but I realized that I am not able to have an input parameter with an entity list data type. It seems that I am only able to use the basic or the entity identifier data types for the input parameter for processes.

Is there a way for me to be able to pass an entity list data type into the process?

The reason for me to do this is because I have a couple of for-each loops that goes through some entity lists. I was thinking that it should be taking place asynchronously as I think this would take quite a lot of time. 

Cheers!

Lucas

mvp_badge
MVP

Hi Lucas,

Passing list of records to the process is not possible so far. But there are some workarounds to achieve this.

If you already have that data in your entities then best thing you could do is just pass the entity identifier and fetch them using an aggregate. 

Otherwise you can create another entity, insert your records in it and call the process with the id. You can also mark them in some batch id and pass the batch id so you can process all of them in one process instance. At the end of your logic you can delete the processed records from this new entity again.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.