VMware {code} Community
RyanMiller20111
Contributor
Contributor

Complex boolean propertyConditions for plugin.xml actions?

Is there a way to have more complex conditions before showing a context menu option?  Right now we use compositeConstraints with nested propertyConstraints and a conjoiner.  But that only gives us AND/OR for all nested constraints.  Is there a way to make a compositeConstraint of compositeContraints? So that we can use "if ( A or B ) and C, show menu option".  I tried just inserting one but it didn't work.  I got a #1034 type coercion error compositeConstraint cannot be converted to propertyConstraint.  Attached is a snippet with what I tried.

Reply
0 Kudos
2 Replies
laurentsd
VMware Employee
VMware Employee

CompositeConstraints were not meant to support multiple OR/AND levels.  The way to implement complex conditions in plugin.xml is to introduce a custom boolean property "my-condition" and write the PropertyProviderAdapter for that property that will compute conditions on the java side.

Reply
0 Kudos
RyanMiller20111
Contributor
Contributor


Thanks Laurent!  I was already using a custom provider as part of my hypothetical complex conditions so I decided as you suggested to move the logic into that provider.  Then I realized that I was just trying to verfiy one or two types of folder and discovered the CONTAINS_ANY_OF comparator.


Thanks for the help anyway!

Reply
0 Kudos