VMware Cloud Community
kujeter
Enthusiast
Enthusiast

Dynamic data in presentation

I'm trying to get a presentation working that selects out the datastores I want presented based on the VC:ClusterComputeResource that is selected earlier in the wizard. This is working perfectly in the vRO java client and displays correctly. My issue is when I try to run the work flow in the vsphere web client, the same field does not work falls back to the object browser. Here is what is looks like in the respective clients, note the options available are what are being returned from clusterDS

in_orc.PNG

in_web_client.PNG

My presentation options like like so.

pres.PNG

Here is the action that I wrote to built to return the Array/VC:Datastore objects. cluster.name comes from an in on the workflow that gets set on a prior step in the workflow wizard.

var clusterDS = new Array();

    var allDs = VcPlugin.getAllDatastores();

   

   

    var searchObj = {

    "clust1" : "clust1",

    "clust2" : "clust2",

    };

   

   

    for (i in searchObj) {

  

    if (cluster.name == i){

    var searchPat = searchObj[i];

   

    for (i in allDs) {

    if (allDs[i].name.match(searchPat)){

    clusterDS.push(allDs[i]);

    }

    }

    }

    }

   

    return clusterDS;

I can't for the life of me figure out what it won't work in the web client. I tested it against the getAllDatastoresMatchingRegexp workflow which is written very similar to my code and it works fine. That actions code is as follows.

   // Get all datastores for all vCenter connections defined for this plugin

    var allDatastores = VcPlugin.getAllDatastores();

    var datastores = new Array();

    // Check if the datastore match the regexp

    for (var i in allDatastores) {

    if (allDatastores[i].name.match(regexp)) {

    datastores.push(allDatastores[i]);

    }

    }

    return datastores;

 

Any thoughts or ideas would be much appreciated

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee

Well, just a note that presentation inside Web Client is a subset of the presentation of vRO Java Client, so not all features are expected to work in the Web Client.

'Predefined list of elements' is supposed to work, though. The fact that the field falls back to plain object chooser usually means that the bound action is not working properly/throws an exception.

Could you export your action and your workflow and attach the files there? This way it would be easier to reproduce the problem in my environment.

Looking at your action code, most likely the error is on the following line:

if (cluster.name == i)

Are you sure the cluster variable has a proper value? If it is a NULL or undefined, trying to fetch name property will cause an error. I'd suggest to add some System.log() statements to dump the values of variables in your action and verify that they have the expected values.

BTW, which versions of vRO and Web Client do you use?

Reply
0 Kudos
kujeter
Enthusiast
Enthusiast

Yes, it has me baffled also. I'd agree it seems though the cluster in isn't getting passed through correctly via the web client interface. I'm going to do some testing as you recommend with System.log. I attached a copy of the action and workflow. This is vRO 7.0.1 and the web client is running from a 6.0U2 VCSA it reports as Version 6.0.0 Build 3617395.

Thanks

Reply
0 Kudos