3 Replies Latest reply on Jan 11, 2011 2:18 AM by Lapawa

    Howto change the name of executed workflows?

    Lapawa Lurker

      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

        • 1. Re: Howto change the name of executed workflows?
          Hot Shot

          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

          1 person found this helpful
          • 2. Re: Howto change the name of executed workflows?
            Andreas Diemer Hot Shot

            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

            • 3. Re: Howto change the name of executed workflows?
              Lapawa Lurker

              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