Service action calls from Extension
Question

Hi everyone!

Thank you for trying to help. I am looking to call a service action from within an extension and can not see to figure out how this works. Was able to successfully call a server action but same way does not work for service.

Scope and reasons why i need this:

When having a tenant that has one core configured( meaning i have to call one single IS layer) i have a switch statement that will direct to specific service action depending on configuration. This works fine for me.

When tenant has 2 cores configured i need to make 2 service action calls to 2 separate IS layers.

Some of you might say why not do this in a loop - call one core, then another core and so forth. Calls can be heavy and i don't want to add time to execution and if i add another core would have to change a lot of logic to accommodate this. 

If anyone has some insight on how to call service actions from extension please share that knowledge. Will be greatly appreciated.

Thank you for taking the time to read this

mvp_badge
MVP
Solution

Please do. Because like I said, calling actions from extensions is not a thing I'd recommend, and not supported by OutSystems. (L)BPT on the other hand is perfect for large parallel execution, even though it may be a bit more complex to set up.

mvp_badge
MVP

Hi Alex,

First a stern warning: you should really not call actions from an extension. That's not what extensions are meant for, and whatever mechanism you devised is unsupported and may very well break in a future platform update. So please rethink this strategy.

That said, service actions are REST calls, with an undocumented interface. The only thing I can think of to do what you want is to create an IS module that exposes server actions and inside those actions call the service actions. But again, rethink whether you really need this!

@Kilian Hekhuis I would ideally not do extensions as it's not as commonly understood by other developers. But my need is to hit API in parallel when tenant has multiple cores. What would you suggest doing instead? lets say we have 3 cores we need to hit and each call to each core takes 2 seconds. that would be 6 seconds if i do it the regular Outsystems way

mvp_badge
MVP

Hi Alex,

Doing anything in parallel seems like a (Light) BPT thing. Have you considered (L)BPT?

Not for this scenario. But if I can not find a way to do this will definitely look into this

mvp_badge
MVP
Solution

Please do. Because like I said, calling actions from extensions is not a thing I'd recommend, and not supported by OutSystems. (L)BPT on the other hand is perfect for large parallel execution, even though it may be a bit more complex to set up.

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