Name of Calling Service

Hi,
If Service A calls Service B, Is there a way I can get the name of Service A at runtime from Service B.

Basically I want to capture which services have called Service B which is a logger service, so that I can log the name of the calling service.

Thanks in advance,
-Sid

You have an example in PSUtilities -> ps.util.system:getCallingServiceName, it’s a java service.

Basically, you can try “Service.getCallingService()”.

Hi, just put a flag in the service B input, this way you can set a fixed value to each service that call service B, so service B will know who are invoking him.
Regards.

Arnaud’s solution will be sufficient to capture the name of the calling service within a Java service, however not sure how the same can be implemented in a flow service.

Call the PS service from FLOW.