VMware Cloud Community
oscaralvarez
Enthusiast
Enthusiast

Renaming a Workflow Task from code

I can do that on the vRO console.. but can't this be done from code??? 

 I'm surprised I do not see any way to do that in the docs..

4 Replies
iiliev
VMware Employee
VMware Employee

Not everything is exposed to scripting code.

In this particular case, I think you can set a custom task name when you schedule a workflow from scripting code, but you cannot rename it later.

0 Kudos
oscaralvarez
Enthusiast
Enthusiast

Understood. but how can i set the Task name??

using

workflowToLaunch.scheduleRecurrently(workflowParameters, strRecurrencePattern, strRecurrenceCycle, job_start_date, job_end_date);

or

workflowToLaunch.schedule(workflowParameters,job_start_date);

i do not have any option for that and I always get the Workflow Name as the Task name!!!

Oscar

0 Kudos
iiliev
VMware Employee
VMware Employee

When calling these APIs, you can use the special parameters __taskName and __taskDescription to set custom task name/description.

Something like:

var params = new Properties();

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

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

... // other parameters

workflowToLaunch.schedule(params, ...);

oscaralvarez
Enthusiast
Enthusiast

Awesome! thanks

0 Kudos