how to reuse a function with reactive web apps?

I tried to reuse a function in a reactive web page without success. It didn't even appear when I search in an editor expression. Someone knows how I need to proceed to get this, very common thing in the past versions, working ? 

Below I add a print screen to contextualize my problem. In the service module (frontier_cs) I created the function and in the Frontier module I try to access it. Only OS default user functions appear.

I tried to use service actions but it didn't work. There is no option to client actions in the service modules (although this is not the case and inappropriate module for a client action) to be used too.

Thank you for any help.

Hi Luciano,

I was able to reproduce the same problem as you describe.

It makes no sence, the server action can be used in client action in the flow or in an expression as long as you type it, but for unknown reason is not listed as User function in the expression editor.

This looks like something that needs to be fixed.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Luciano,

I was able to reproduce the same problem as you describe.

It makes no sence, the server action can be used in client action in the flow or in an expression as long as you type it, but for unknown reason is not listed as User function in the expression editor.

This looks like something that needs to be fixed.

Regards,

Daniel

Hi Daniël,

   are you mean you will notify OS lab people?


I did send a feedback in service studio with the feedback button.

Hi Luciano,

On the interface you can only use client side functions (the orange circles that are white inside). If you need to use a server action you need to right-click the block and select "Fetch data from other sources" to add a data action. Alternatively, if it makes sense, you can try to do that logic in a client action (although only client actions that do not have any calls to the server can be converted into functions).

Cheers,
Tiago Simões

Hi Daniël,

That is indeed strange. We’ll look it up. 

Cheers,

Tiago Simões

Tiago Simões wrote:

Hi Luciano,

On the interface you can only use client side functions (the orange circles that are white inside). If you need to use a server action you need to right-click the block and select "Fetch data from other sources" to add a data action. Alternatively, if it makes sense, you can try to do that logic in a client action (although only client actions that do not have any calls to the server can be converted into functions).

Cheers,
Tiago Simões

Hi Tiago,

   in the beginning you scared me, but after reading your answer in the next message to Daniël I am more relaxed.  It was inconceivable that the entire platform became mobile constraint once that the advice you proposed was the way I used to overcome the problems I had to access servers actions in mobile development.

Is there some way to follow up this issue?


Hi Luciano,

My first answer still stands, to access information on the server you need to create data actions on screens and blocks ("right-click>fetch data from other sources"). Otherwise we would be hiding possibly expensive server calls in the middle of an expression. 

My answer to Daniël was because he said that although they were not appearing in scope, you could type them in expression editor (when you shouldn't). I was not able to reproduce this issue, it might have been a client action with the same name?

If you are converting traditional web apps to reactive web apps be aware that there is always some screen rearchitecture needed in the way you are going to fetch server data.

Cheers,
Tiago Simões 

Tiago Simões wrote:

Hi Luciano,

My first answer still stands, to access information on the server you need to create data actions on screens and blocks ("right-click>fetch data from other sources"). Otherwise we would be hiding possibly expensive server calls in the middle of an expression. 

My answer to Daniël was because he said that although they were not appearing in scope, you could type them in expression editor (when you shouldn't). I was not able to reproduce this issue, it might have been a client action with the same name?

If you are converting traditional web apps to reactive web apps be aware that there is always some screen rearchitecture needed in the way you are going to fetch server data.

Cheers,
Tiago Simões 

Hi Tiago,

Kinda busy the comming 3 days, but after NextStep, I will make a small video showing what I think is wrong, and share it with you.

Regards,

Daniel


Tiago Simões wrote:

Hi Luciano,

My first answer still stands, to access information on the server you need to create data actions on screens and blocks ("right-click>fetch data from other sources"). Otherwise we would be hiding possibly expensive server calls in the middle of an expression. 

My answer to Daniël was because he said that although they were not appearing in scope, you could type them in expression editor (when you shouldn't). I was not able to reproduce this issue, it might have been a client action with the same name?

If you are converting traditional web apps to reactive web apps be aware that there is always some screen rearchitecture needed in the way you are going to fetch server data.

Cheers,
Tiago Simões 

Hi Tiago,

    I am working only on a new reactive app. Nothing reused and without client actions until now. Follow a new application that reproduces the error with some orientation.  Please, let me know if you have a proper view now. 




Hi Luciano,

I took a look at your example. You are trying to access a server function from the UI. In reactive (and mobile), that is not possible to do directly, otherwise the platform could be hiding performance intensive server calls inside expressions. What you should do in this case is to right-click the block and select the "Fetch Data from Other Sources", and use that action there, assigning its value to an output parameter.

(Note: If you are going to use that block inside lists, and if you find performance problems, afterwards you might want to refactor your server code a bit because every block will make a server call, you probably should get a list from the server on the original screen and then pass only the values to the blocks on the list.)

With great power comes great responsibility :), when creating reactive (and mobile) apps we all will need to be a little bit more concerned about what is done on the client and what is done on the server side.

Let me know if you need further help.

Cheers,
Tiago Simões

Hi Tiago,

   that was what I was afraid of. Every web block will need to have a "summary" action setting all results from the server actions called. Depending on the size of the block I will have a lot of output variables to set as a bottleneck. It is early to talk something but it seems something is not right. I am not happy with this new way. Maybe I need to refine my design and think more like OOP.

Anyway, thank you for your support.