Problem debugging service actions

Problem debugging service actions

  

Hi,

Just came back from Dutch OutSystems meetup with nice presentation on using service actions.

Question was raised about debugging support, So I was curious and tried it out myself.

The document

https://success.outsystems.com/Documentation/11/Developing_an_Application/Troubleshooting_Applications/Debugging_Applications/Debugging_Producer_Modules

describes how to debug service actions in producer modules:

But the breakpoint doesn't hit, if i put a breakpoint a on a server action that I call in the same service module, the breakpoint does hit.

To test this I  installed de CRM Services service application and coded the following action in consumer module:

The breakpoint in CRM Services on Contact_Create is hit only once.

The breakpoint in CRM Services on Contact_Create_SA is not hit.

More strange Contact_Create_SA calls Contact_Create and that is not hit either.

In Service Center in the Service Action log I can see that Contact_Create_SA is succesfully called


I am confused, anybody successfully debugged service actions?

Regards,

Daniel


Hi Daniël,

The Service Action Contact_Create_SA is executed in a different context from the eSpace it calls. I think your main problem is that you call a Service Action from its own eSpace, a scenario that in practice would never occur. Apparently, the Platform isn't able to recognize this and/or can't start two debugging threads for the same eSpace. I think if you create another eSpace, and in that eSpace call your Service Action, debugging commences as expected.

Disclaimer: I haven't used P11 yet, so I may be wrong. Also, I'm not sure what happens if you try to debug a REST service that calls itself, whether or not that exhibits the same behaviour as above (but I wouldn't be surprised if it would).

Daniël Kuhlmann wrote: 

Hi,

Just came back from Dutch OutSystems meetup with nice presentation on using service actions.

(...)

But the breakpoint doesn't hit, if i put a breakpoint a on a server action that I call in the same service module, the breakpoint does hit.

Hi Daniel,

Thanks for your comment and question, also for your participation in the meetup!

I could debug a service layer action, from a user interface layer action.

To debug a service action, we need to specify in producer module the entry module "this module", as the image bellow illustrates.

However when in case we have in the same flow, a call to a server action and a service action, we can't debug both using this method, because debuging a server action requires to specify the entry module.

This is an interesting question, and a topic to be discussed further.

Best regards!

Kilian Hekhuis wrote:

Hi Daniël,

The Service Action Contact_Create_SA is executed in a different context from the eSpace it calls. I think your main problem is that you call a Service Action from its own eSpace, a scenario that in practice would never occur. Apparently, the Platform isn't able to recognize this and/or can't start two debugging threads for the same eSpace. I think if you create another eSpace, and in that eSpace call your Service Action, debugging commences as expected.

Disclaimer: I haven't used P11 yet, so I may be wrong. Also, I'm not sure what happens if you try to debug a REST service that calls itself, whether or not that exhibits the same behaviour as above (but I wouldn't be surprised if it would).

Hi Kilian,

I have a consumer application calling the producer moduleCustomers from CRM Services service application.

So I did already have the scenario that you described, also I followed all the instructions that where described in 

tps://success.outsystems.com/Documentation/11/Developing_an_Application/Troubleshooting_Applications/Debugging_Applications/Debugging_Producer_Modules

I was only debugging the producer module that contains the service action, so not having two debugging threads.

The interesting point i learned is that it (as i was used) does debug my server action that resides in the same producer module as the service action, but not if that server action was called from the service action.

I will wait for someone else to try and see if I did something wrong, or that they get the same problems.

Regards,

Daniel

HI Daniël,

Again, I think this is to be expected. If you have a Server Action, that is in a Produced eSpace, the only way you can debug it when it's called from the Consumer eSpace, is to select the Consumer as the Entry Module. You can't debug a consumed Server Action if it's set to "(this module)".

On the other hand, in case of Service Actions, since they are executed in a different context, the only way you can debug them is to set the Entry Module to "(this module)". So it's impossible to both debug a Server Action that's consumed in a Consumer eSpace, and a Service Action in that same eSpace, at the same time!

Hi Kilian,

You can't debug a consumed Server Action if Entry Module set to "(this module)"

You can't debug a consumed Service Action if Entry Module NOT set to "(this module)"

Thanks for pointing it out, didn't read your first answer correctly.

Indeed when debugging a producer module with service actions and server actions, and you want to test just the call of a server actions I need to set Entry Module to the consumer module.

But if in want to debug a service action in the producer module you have to set it to "(this module)", the server actions are now only debug-gable, when called from a service action.

Regards,

Daniel



Solution

Hi Kilian and Daniël,

Debuging at same time server actions and service actions can be done.

Due to nature of service layer, introduced in OutSystems platform P11, in case the flow of consumer contains a server and service action, open a second service studio of the same module to do a bimodal debuging of the application:

  1. start debug on consumer side
  2. start debug on producer (w/ server action) - set entry point to the consumer eSpace name
  3. start debug on producer (w/ service action) - set entry point to "this module"

Kind regards,


Solution

Marco Arede wrote:

Hi Kilian and Daniël,

Debuging at same time server actions and service actions can be done.

Due to nature of service layer, introduced in OutSystems platform P11, in case the flow of consumer contains a server and service action, open a second service studio of the same module to do a bimodal debuging of the application:

  1. start debug on consumer side
  2. start debug on producer (w/ server action) - set entry point to the consumer eSpace name
  3. start debug on producer (w/ service action) - set entry point to "this module"

Kind regards,


Great, thanks for the info


Indeed, that's cool to know, thanks.