VMware Cloud Community
LuckyT
Contributor
Contributor
Jump to solution

How to read Workflow IDs from particular Folder?

Hi All,

       I'm trying to read Workflow IDs from particular Folder (Ex.: Two folders are there Library & MyWorkflows, I want to read workflow ids from MyWorkflows). I saw below code, but this returns all the workflows from VCO.

var workflowId = "";

var workflows = System.getModule("com.vmware.library.workflow").getAllWorkflows();

for each (var wf in workflows) {

if(wf.name == workflowName) {

  workflowId = wf.id;

}

}

Thanks in advance,
Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Add an input to your workflow of type workflow category (workflowCat1)

cat1Workflows = workflowCat1.workflows;

Then you can iterate them.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
2 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Add an input to your workflow of type workflow category (workflowCat1)

cat1Workflows = workflowCat1.workflows;

Then you can iterate them.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
LuckyT
Contributor
Contributor
Jump to solution

Thanks, that was helpful. Can you tell me how can i pass value for input WorkflowCategory from Java using SDKObject?

Actually, i'm trying to call workflow and pass WorkflowCategory as input to Java using SdkObject:

SdkObject obj = createSDKObject("WorkflowCategory","localhost/MyWorkflows");

but i'm unable to set.

Reply
0 Kudos