Using Service Actions in Server Actions
Question

Hello, 

Hope you are all doing well during these strange times!


I have recently updated/converted a lot of my Data layer/Producer Modules to Service Modules. I also thought it would be a good idea to convert most of the actions in these modules to Service Actions. 

This decision was taken as there has been a bit of an issue with scalability, where small updates/changes to these Data layer/Producer modules would then result in having to republish all consumer modules. 


As a result of moving these Actions to Service Actions I have lost the "Function" ability of Server actions.

For Example, I have a module "Data_People" which has a entity, Employee. Employee has a FK reference to User. 

My End user application used a Service Action "GetEmployeeByUserId" from Data_People which returned the Employee Id from User Id input. Since this is now a Service Action I can no longer use it as a function. 

I had a thought that I could create a Server Action in my Consumer which would utilise the Service action from the producer: 

And this would allow me to still use it as a function and be called inline, while still keeping the "weak" dependency? Is this appropriate use of the Service Action?

I have read through https://success.outsystems.com/Documentation/11/Developing_an_Application/Reuse_and_Refactor/Use_Services_to_Expose_Functionality#Exposing_Service_Actions 

But still not sure I am using Service Actions over Server Actions correctly. Should CreateorUpdate Wrappers be Service Actions?


Thanks for any help.

Chris

mvp_badge
MVP

Hi Chris,


if you are using createorupdate wrapper in service module then i think its not be a problem.

we also done in one app very similer way and used wrapper inplace of direct createoruodate used.we acheived thay way security as well to make our entity readonly true

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