AnsweredAssumed Answered

Conditional aspects?

Question asked by on Mar 26, 2013
Latest reply on Mar 26, 2013 by michaelböckling

I have a document model like this;

<type name="oaciqdt:docLfermAssist">

The issue we have is that oaciqdt:aspectNumsPermis should be conditional, e.g. it should be mandatory if a value for the property who is part of that aspect is not null. The aspect is like this:

<aspect name="oaciqdt:aspectNumsPermis">
  <title>License numbers</title>
    <property name="oaciqdt:numsPermis">
        <constraint name="oaciqdt:numsPermisREGEX" type="REGEX">
          <parameter name="expression"><value>[A-Za-z]{1}[0-9]{4}</value></parameter>
          <parameter name="requiresMatch"><value>true</value></parameter>

So in short, if oaciqdt:numsPermis is empty, I don't want the validation to occur, but if the value is not empty, the regex should be run.

Looking at the documentation, I don't see how you can define a property to validate only if a value is present, and I don't see how we can make the aspect to be conditional if the value is empty.

Any tricks?