VMware Aria Automation Orchestrator

 View Only
  • 1.  How do I add a description to scheduled workflow?

    Posted Jun 26, 2019 02:15 PM

    Hello!

    Here is some code that will schedule a workflow with the specified ID. In this case, it's just passing in one parameter, hostname. It's scheduling the workflow according to the "date" parameter.

    My question is, is there a way to pass in a schedule description? Or even a name? In the screenshot below, I manually updated the schedule description to contain "test", but I'd like to pass in a description (or name) in an automated fashion. I appreciate any help!

    var workflowToLaunch = Server.getWorkflowWithId("41392622-b385-4124-9b9b-15a99ddb794c");

    if (workflowToLaunch == null) {

    throw "Workflow not found";

    }

    var workflowParameters = new Properties();

    workflowParameters.put("hostname",hostname);

    var scheduledTask = workflowToLaunch.schedule(workflowParameters,date);



  • 2.  RE: How do I add a description to scheduled workflow?

    Posted Jun 26, 2019 02:33 PM

    Hi,

    maybe this helps:

    var scheduledTaskManager = VcPlugin.allSdkConnections[0].scheduledTaskManager;

    var scheduler = new VcDailyTaskScheduler(); // use this for a daily schedule only
    scheduler.interval = 1;
    scheduler.hour = 9;
    scheduler.minute = 41;

    var taskSpec = new VcScheduledTaskSpec();

    taskSpec.name = "My task name";

    taskSpec.description = "My task description";

    taskSpec.enabled = true;

    taskSpec.scheduler = scheduler;

    // ... use scheduledTaskManager to create your task



  • 3.  RE: How do I add a description to scheduled workflow?
    Best Answer

    Broadcom Employee
    Posted Jun 26, 2019 02:45 PM

    Hi,

    You can use special parameters named __taskName and __taskDescription

    // ...

    workflowParameters.put("__taskName", "custom task name");

    workflowParameters.put("__taskDescription", "custom task description");

    var scheduledTask = workflowToLaunch.schedule(workflowParameters,date);

    LukasWe​ - vRO scheduled workflows are not vCenter tasks.



  • 4.  RE: How do I add a description to scheduled workflow?

    Posted Jun 26, 2019 03:17 PM

    That worked perfectly Ilian! I was hoping it would be simple. Thank you!



  • 5.  RE: How do I add a description to scheduled workflow?

    Posted Jun 27, 2019 05:40 AM

    Thanks for the clarification iiliev