VMware Cloud Community
anoopvb
Enthusiast
Enthusiast
Jump to solution

Get name of action within the action?

I've got several workflows that call several actions.

In an effort to make the logging a little bit better, I'm wondering if there's a way to know the name of the action from within the action itself.

so for example, i have an action

com.anoop.library.GetVMUuid

within the script, can i do something like

System.log($this + ": VM UUID is " + uuid);

is that possible? or are there alternatives?

thanks.

Tags (1)
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Try something like:

var moduleName = this.name;

var actionName = arguments.callee.name.substr(6); 

System.log(moduleName + "." + actionName + ": VM UUID is " + uuid);

View solution in original post

2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Try something like:

var moduleName = this.name;

var actionName = arguments.callee.name.substr(6); 

System.log(moduleName + "." + actionName + ": VM UUID is " + uuid);

anoopvb
Enthusiast
Enthusiast
Jump to solution

Thank you! that did it!

0 Kudos