Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

Trying to create a Resource Action and its target criteria with vRO (vCO) workflow

$
0
0

I can successfully create the resource action, however I am stumped on how to create target criteria.  Has anyone done this or have any suggestions on how to do this?

 

Here is what I have so far (import param in a vCACCAFE:ResourceAction) action:

// only want to be visible when vm status is On or Off

var statusLiteral = new vCACCAFEStringLiteral("Status");

var onLiteral = new vCACCAFEStringLiteral("On");

var offLiteral = new vCACCAFEStringLiteral("Off");

var statusEqualsOn = new vCACCAFEEqualsOperator().evaluate(statusLiteral, onLiteral);

var statusEqualsOff = new vCACCAFEEqualsOperator().evaluate(statusLiteral, offLiteral);

var orClause = new vCACCAFEOrClause([statusEqualsOn, statusEqualsOff]);

action.setTargetCriteria(orClause);

 

But this throws the following error:

Unable to create object : vCACCAFEEqualsOperator : Class ch.dunes.vso.sdk.DynamicWrapper can not access a member of class com.vmware.vcac.platform.content.operators.EqualsOperator with modifiers "protected"

 

I tried just as a static method vCACCAFEEqualsOperator.evaluate(...   and received this error:

TypeError: Cannot find function evaluate in object DynamicWrapper (Class) : [vCACCAFEEqualsOperator]-[class com.vmware.vcac.platform.content.operators.EqualsOperator] -- VALUE : null. (Workflow:TestUpdateResourceAction / Scriptable task (item1)#4)

 

I also very skeptical that the statusLiteral will actually do what I want above.

 

Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>