VMware Cloud Community
LaxmiRagi
Enthusiast
Enthusiast
Jump to solution

How to schedule a workflow programmatically.

Hi there,

I have one requirement that I need to schedule a workflow programmatically.

I found something like this in the API reference "schedule(Object properties, Object startDate, Object uname, string pwd);"  So here what are the keys I need to pass in the properties object.

Thanks and Regards,

Laxminarsaiah Ragi

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

When you schedule a workflow in the client UI, you can provide values to some (or all) of workflow input parameters, so when the schedule is triggered and the workflow is executed, these provided parameters will be passed as actual parameters to the execution.

When you schedule a workflow programmatically, the keys of this properties parameter are the names of the workflow's input parameters, and the its values are the corresponding values for the input parameters.

View solution in original post

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

Hi,

When you schedule a workflow in the client UI, you can provide values to some (or all) of workflow input parameters, so when the schedule is triggered and the workflow is executed, these provided parameters will be passed as actual parameters to the execution.

When you schedule a workflow programmatically, the keys of this properties parameter are the names of the workflow's input parameters, and the its values are the corresponding values for the input parameters.

Reply
0 Kudos
LaxmiRagi
Enthusiast
Enthusiast
Jump to solution

Hi Ilian Iliev,

Thank you so much for your response, whatever mentioned in the above I tried that and worked fine. I want to ask you something like, I want to call a function within the workflow based on the some time interval like we have a setInterval and setTimeout function in javascript, is it possible in the vRO? if yes, please provide a sample code or link.

--

Thanks & Regards,

Laxmi

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

setInterval and setTimeout are DOM functions and so they are not available in Rhino (the Javascript engine used by vRO).

vRO provides a function System.sleep(milliseconds) that allows your code to wait a given number of milliseconds. Using this function, you can kind of simulate the behavior of setInterval and setTimeout by explicitly waiting when necessary.

Reply
0 Kudos