3 Replies Latest reply on Dec 7, 2018 5:03 AM by iiliev

    How to schedule a workflow programmatically.

    LaxmiRagi Novice

      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

       

       

       

        • 1. Re: How to schedule a workflow programmatically.
          iiliev Virtuoso
          Community WarriorsVMware Employees

          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.

          • 2. Re: How to schedule a workflow programmatically.
            LaxmiRagi Novice

            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

            • 3. Re: How to schedule a workflow programmatically.
              iiliev Virtuoso
              Community WarriorsVMware Employees

              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.