VMware Cloud Community
LaxmiRagi
Enthusiast
Enthusiast
Jump to solution

How to tag a workflow/Action

Hi There,

I wanted to understand what is tagging and how it works.

I have seen some examples online and in the Vro Library>tagging>...

Q1. When running Tag workflow from Library>> tagging>> Tag workflow >> I can see the Tag text field, so what was tag meant for? and what was the value meant for?

Q2. Is it possible to tag for the specific folder?

Please suggest me easiest way to tag workflows/actions and retrieve with tag names.

Thank you in advance.

--Laxmi

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Tags are strings (3..64 characters in length, no spaces) that you can 'attach' to objects.

To answer your Q1 - 'Tag' field is the name of the tag you want to attach to the workflow, and 'Value' is the optional value of this tag.

About Q2 - I'm not sure that I fully understand the question. Do you want to attach a tag to a folder in a way that all workflows within this folder will get this tag? Or something else?

The Server scripting object exposes some API to attach tags, query for objects having a given tags, etc. Check the documentation in API Explorer and look for methods that have 'tag' in their name.

For example, the snippet below is provided in the documentation to show how you can query for objects that have been tagged with a given tag. Also, you can check the scripting code of the example workflows in the Library > Tagging folder.

// Must return all objets tagged with 'tag1' having value 'value1' and 'globaltag' with value 'value2'

// type is optional, if null no filtering by type is performed

var objects = Server.queryByTags(([{'tag':'tag1', 'value':'value1'},{'tag':'globaltag', 'value':'value2'}], "Workflow");

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

Reply
0 Kudos
5 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Tags are strings (3..64 characters in length, no spaces) that you can 'attach' to objects.

To answer your Q1 - 'Tag' field is the name of the tag you want to attach to the workflow, and 'Value' is the optional value of this tag.

About Q2 - I'm not sure that I fully understand the question. Do you want to attach a tag to a folder in a way that all workflows within this folder will get this tag? Or something else?

The Server scripting object exposes some API to attach tags, query for objects having a given tags, etc. Check the documentation in API Explorer and look for methods that have 'tag' in their name.

For example, the snippet below is provided in the documentation to show how you can query for objects that have been tagged with a given tag. Also, you can check the scripting code of the example workflows in the Library > Tagging folder.

// Must return all objets tagged with 'tag1' having value 'value1' and 'globaltag' with value 'value2'

// type is optional, if null no filtering by type is performed

var objects = Server.queryByTags(([{'tag':'tag1', 'value':'value1'},{'tag':'globaltag', 'value':'value2'}], "Workflow");

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

Reply
0 Kudos
LaxmiRagi
Enthusiast
Enthusiast
Jump to solution

Hi Ilian Iliev,

Thank you for quick response, regarding Q2, Yes I want to tag a folder where all workflows are placed. So that I can get all workflows with that tag. (I can tag a folder instead of tagging every workflow in that folder)

So please confirm me if I can able to tag a folder where all workflows are placed.

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Yes, it is possible to tag a folder (which is of type WorkflowCategory) instead of individual workflows. The same API that you use to tag a workflow will work also for WorkflowCategory.

Reply
0 Kudos
LaxmiRagi
Enthusiast
Enthusiast
Jump to solution

Hi Ilian Iliev,

Thank you so much for confirming.

Can we tag a folder(package com.companyname.foo) which contains actions too?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

You can tag the whole Package object, the same way you tag Workflow and WorkflowCategory objects.

Reply
0 Kudos