title: Declarative Pipeline - Use of when condition, how to do nested conditions anyOf/allOf/not
body: <p>I am stuck at how to properly use nested conditions as proposed in the Jenkins syntax.</p>
  
  <p><a href="https://jenkins.io/doc/book/pipeline/syntax/#when" rel="noreferrer">https://jenkins.io/doc/book/pipeline/syntax/#when</a></p>
  
  <p>This is my current stage:</p>
  
  <pre><code>stage('Build'){
  when{
      anyOf{
          allOf{
              expression{env.BRANCH_NAME != 'master'}
              expression{env.AUTO_BUILD == true &amp;&amp; env.BUILD_OPT == snapshot &amp;&amp; env.BRANCH_NAME !=~ /feature.+/} 
          }
          expression{env.AUTO_BUILD == false}
      }
  }
  steps{
      echo env.AUTO_BUILD
      echo env.BUILD_OPT
      echo env.BRANCH_NAME
  }
  </code></pre>
  
  <p>From my point of understanding is, if I set <code>env.AUTO_BUILD = false</code>, then this stage should be executed, since it is enclosed in an <code>anyOf</code> OR it would execute if my branch was e.g. <code>develop</code> and <code>AUTO_BUILD = true, BUILD_OPT = snapshot</code>. <br>
  However, this was not the case when I set <code>AUTO_BUILD = false</code>. The stage was not executed. Am I missing something?</p>