jacquesperrin
Enthusiast
Enthusiast

vRO - How to get by code if an action is used ?

Jump to solution

Hi all

I built more than 600 actions in vRO modules and I would like to know if exists a simple way to check if an action is used (in a workflow or workflow presentation or in the code of another action).

I didn't find anything in vRO API or in plugin to do that.

In fact I would like to perform a "Find elements that use this element" for each action.

Does anyone have any ideas ?

Thanks

Jacques

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee

Hi,

Currently, there is no simple way to find action usages. I agree it could be useful to have such API; will check if we can add it to the backlog for the next releases.

View solution in original post

0 Kudos
4 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Currently, there is no simple way to find action usages. I agree it could be useful to have such API; will check if we can add it to the backlog for the next releases.

0 Kudos
jacquesperrin
Enthusiast
Enthusiast

Hi Ilian

Thanks for your answers, if you are able to add this feature to a next release it will be great, and I have other suggestions like :

- Expose version history in vRO REST API on object : action, workflow, configuration element and resource (ideally it will be great to have a new attribute like lastChangeBy

with the user name)

- Add a search/replace function in the javascript code editor

- In action scripting tab, enable the drag/drop of the inputs in the code (like a scripting task in a workflow)

Regards

Jacques

0 Kudos
eoinbyrne
Expert
Expert

There is a hacky / brute-force way to do some of this but it would involve writing some workflow code

The vRO REST API has this branch (view it on your local node @ https://<vrofqdn>/vco/api/docs)

pastedImage_0.png

Basically, you would need to add your vRO Node as a RESTHost and then access this API to get the content of all workflows one by one. The content is in JSON so worst case as a total hack you could just treat the JSON as text and run a Regex match for occurrences of your action names within it?

It would be entirely sub-optimal but if you were desperate it would do the job

-HTH

0 Kudos
eoinbyrne
Expert
Expert

Forgot to add a note about actions

There is a similar API branch for actions but you can also get the content of an action without using REST

pastedImage_0.png

The Action class has the member script which contains the JS for the action code. As before, the dirty hack would be Regex match for the action name (or FQ module path might be better)

0 Kudos