VMware Cloud Community
Lapawa
Contributor
Contributor
Jump to solution

Howto change the name of executed workflows?

Hello together,

I've got a question concerning the workflows overview.

After running a workflow several times it is impossible to distinguish them because of the same line of text.

Here's a screenshot of that list:

2011-01-07_122353.jpg

Has anyone found a way to change the workflow's name during execution.

I would like to have the name of the created virtual machine in this list.

Any ideas are welcome.

Best regards

  Tim Lapawa

0 Kudos
1 Solution

Accepted Solutions
Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Hi Tim,

as Christian mentioned there is no (known) implemented way to do this.

Using JDBC you can achieve following result (using input parameter Text as 01, 02, 03, 04, 05):

Lapava1.PNG

Between 04 and 05 there was a service restart!

Here the sample (DO NOT USE IN PRODUCTION)

var main = new JDBCConnection();
var con;
try  {
con = main.getConnection("jdbc:jtds:sqlserver://192.168.0.33:1433/VCO41","sa","yourPWD");
System.log( "Connection to database successful" );

var stat = con.prepareStatement("select title from VMO_Workflowtoken where id='" + workflow.id + "'");
result = stat.executeQuery();
if (result.next());
{
  System.log (result.getStringAt(1));
}
stat = con.prepareStatement("update VMO_Workflowtoken set title='ChangeTester" + Text + "' where id='" + workflow.id + "'");
result = stat.executeUpdate ();
if (result == 1)
{
  System.log ("Title changed!");
}
else
{
  System.log ("Title changed faild");
}
}
catch( ex )  {
throw "Connection to database failed (Reason: " + ex + ")";
} finally {
if (con) {
  con.close();
}
}

You can also wait some time (in my case about 15min.) and display refreshes without restarting.

Regards, Andreas


don't forget to award points for helpful or correct replies

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com

View solution in original post

0 Kudos
3 Replies
admin
Immortal
Immortal
Jump to solution

Hi Tim,

i think there is no way to change the displayed history of the workflow into a customized name. The runs are stored in the vCO database, so you could try to update them for example.

The other way is to create an external SQL table with the date/time stamp and the workflow id/name or an output parameter (or attribut) with the created VM name. I see what happened in the wokflow by looking into the "Variables" Tab and look for the filled attributes...

Hope this helps

best regards

Christian

Andreas_Diemer
Enthusiast
Enthusiast
Jump to solution

Hi Tim,

as Christian mentioned there is no (known) implemented way to do this.

Using JDBC you can achieve following result (using input parameter Text as 01, 02, 03, 04, 05):

Lapava1.PNG

Between 04 and 05 there was a service restart!

Here the sample (DO NOT USE IN PRODUCTION)

var main = new JDBCConnection();
var con;
try  {
con = main.getConnection("jdbc:jtds:sqlserver://192.168.0.33:1433/VCO41","sa","yourPWD");
System.log( "Connection to database successful" );

var stat = con.prepareStatement("select title from VMO_Workflowtoken where id='" + workflow.id + "'");
result = stat.executeQuery();
if (result.next());
{
  System.log (result.getStringAt(1));
}
stat = con.prepareStatement("update VMO_Workflowtoken set title='ChangeTester" + Text + "' where id='" + workflow.id + "'");
result = stat.executeUpdate ();
if (result == 1)
{
  System.log ("Title changed!");
}
else
{
  System.log ("Title changed faild");
}
}
catch( ex )  {
throw "Connection to database failed (Reason: " + ex + ")";
} finally {
if (con) {
  con.close();
}
}

You can also wait some time (in my case about 15min.) and display refreshes without restarting.

Regards, Andreas


don't forget to award points for helpful or correct replies

------ for correct and / or useful answers please award points visit http://www.vcoteam.info & http://mighty-virtualization.blogspot.com
0 Kudos
Lapawa
Contributor
Contributor
Jump to solution

Hello Andreas,

thank you very much for this code snippet. It works flawless and out of the box.

The only drawback is the delayed synchronization between DB and vCO.

And the idea feels to me a little bit brute force.

The VMware dev team should add such a functionality to the future releases.

best regards,

  Tim Lapawa

0 Kudos