Mastering OutSystems Reactive Apps Through Examples

Luciano Schiavo
3 min readJan 4, 2020

--

Since ReApps launches (you can read ReApps first impressions to keep up this subject) there is no deep learning support material to handle it. Recently OutSystems (OS)released a new version of Reactive Applications (ReApps) with scaffolding but research is still needed to domain ReApps. If you have doubts on how to use ReApps server functions in your screens, how to use 4 layer canvas and how to improve your productivity with OS, this is the right article for you.

A practical context is always good to learn and I am sharing with you a code that I reuse to handle date formats in a global tenant configuration, user preferences configuration and list screens. The traditional web code below save me much time once it is a centralized code and I don’t need to put a lot of ifs in the screens where I need to present a date or date/time.

Code to standardize the presentation of date or date/time fields

In the beginning of code shown in the picture, parameters are is retrieved using the singleton design pattern (if this subject is new for you, read the article OO Design patterns) and once date time parameter is a null date it only returns a null space (“”). If a date format is supplied it only needs to return the format applied, else, it is needed to check if it uses a date or date/time data. Once isolated time of date/time is null, the right date format is applied and set to the output variable. The condition to the date/time will follow the same pattern.

Library is the first idea that comes to mind (this code will be used in many parts of the system) to store this code when you need to use the 4 layer canvas and this will be a problem when you try creating the Parameter entity. Only static entities can be created in a library module and libraries don't make references to service modules. Therefore, it is needed to promote our solution one level up to adjust the architecture.

After transferring all code to a service module, it is needed to create the UI module to present the dates. From the UI module, make the reference to the service module and search for the function DateTimeStdFormat to add it to an expression in a table list… ops… didn’t you find the referenced function in the list of server functions in the expression editor?

Alternative solution to call a referenced function and apply it in a list from an aggregate

Yes, it is right. It will not appear because you can’t call directly a server function from a screen. If you have a screen with only one register you can use “Fetch data from other sources” (right click mouse button on the screen page) option and call all your server function/actions from the new data action. However, it is not so easy to solve when you have to apply a server function to a list from an aggregate. I could enumerate a list of possibilities and problems that I face, but the best solution that I found in the moment is: create an structure and associate it to the aggregate and after that, apply your server function on the “On after fetch” event created to store your formatted date. As the control of the fetch is linked to the aggregate, the function will be applied according the optimization managed by the aggregate. In other words, if the fetch is done with 20 lines, the function will be applied only on them. Therefore, the function will not force an overburden to the server.

It is not easy to control structures as alternative to the simple way to assign a function in the expression editor in the traditional web, but I didn't find any reference from OS that could help me solve this problem I faced until now.

With ReApps we can create a library that can be reused by many modules independently and the possibility to create screens that can be performed in any other device but to get all these benefits, they came with a cost: OS development is becoming more complex.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Luciano Schiavo
Luciano Schiavo

Written by Luciano Schiavo

PMP Certified | Togaf 9 and Business Architecture Certified| LSS Black Belt | Solutions Architect |Productivity Improvement Researcher

Responses (2)

Write a response