<div dir="ltr"><div>Actually, on further thought, I bet that the negated rule *is* created, but the system doesn&#39;t really know how to handle this situation.</div><div><br></div><div>You should see a second rule in the output:</div><div><br></div><div><span style="font-size:12.8000001907349px">addRule()</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">.when(Not.any(And.all(FileContent.</span><span style="font-size:12.8000001907349px">matches(release).inFilesNamed(</span><span style="font-size:12.8000001907349px">{*}Tag.java).as(default)))</span><span style="font-size:12.8000001907349px">)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">.perform(Hint.message(&quot;</span><span style="color:rgb(80,0,80);font-size:12.8000001907349px">C7.1 : No release in Tag&quot;</span><span style="font-size:12.8000001907349px">))</span></div><div><span style="font-size:12.8000001907349px">.withId(&quot;TagLib release&quot;)</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">However, with the way our system currently works, the otherwise will never fire because there probably ARE matches in teh system the have that filecontent. This is something we need to address.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">~Lincoln</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 12:20 PM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">The rule should be formatted as he originally posted:<div><br></div><div><span class=""><span style="font-size:12.8000001907349px">&lt;rule id=&quot;TagLib release&quot;&gt;<br>       &lt;when&gt;<br></span></span><span style="font-size:12.8000001907349px">            &lt;filecontent matches=&quot;{*}&quot; filename=&quot;</span><span style="font-size:12.8000001907349px">{*}Tag.java</span><span style="font-size:12.8000001907349px">&quot;/&gt;</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">       &lt;/when&gt;</span></div><span class=""><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">        &lt;otherwise&gt;</span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"><span style="color:rgb(80,0,80);font-size:12.8000001907349px">                      &lt;hint message=&quot;C7.1 : No release in Tag&quot; effort=&quot;4&quot; /&gt;</span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"><span style="color:rgb(80,0,80);font-size:12.8000001907349px">        &lt;/otherwise&gt;</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">  &lt;/rule&gt;</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div></span><div><span style="font-size:12.8000001907349px">It sounds like there might be a bug here if the &quot;otherwise&quot; clause is not being picked up. We&#39;ll have to look into this! I created an issue for it: <a href="https://issues.jboss.org/browse/WINDUP-613" target="_blank">https://issues.jboss.org/browse/WINDUP-613</a></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Thanks,</span></div><div><span style="font-size:12.8000001907349px">Lincoln</span></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, May 27, 2015 at 7:07 AM, Ondrej Zizka <span dir="ltr">&lt;<a href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I am no expert on &lt;otherwise&gt;, but I think that it has no context of<br>
what was found.<br>
In other words, you are trying to apply &lt;hint&gt;, but Windup doesn&#39;t know<br>
what to apply it to. The file is only &quot;known&quot; in the scope of nested<br>
&lt;when&gt; and in &lt;perform&gt; .<br>
Again, that&#39;s my guess, someone more knowledgable may confirm or not.<br>
<br>
If I am right, then you could either do a nested &lt;perform&gt;&lt;iteration&gt;:<br>
The first would find {*}Tag.java, the nested &lt;when&gt; would find the<br>
pattern, or not:<br>
<span><br>
&lt;rule id=&quot;TagLib release&quot;&gt;<br>
       &lt;when&gt;<br>
</span>            &lt;filename pathPattern=&quot;{*}Tag.java&quot; as=&quot;file&quot;/&gt;<br>
       &lt;/when&gt;<br>
       &lt;perform&gt;&lt;iteration&gt;<br>
              &lt;when&gt;<br>
                  &lt;filecontent pattern=&quot;release&quot; fileref=&quot;file&quot; /&gt;<br>
<span>              &lt;/when&gt;<br>
              &lt;otherwise&gt;<br>
                      &lt;hint message=&quot;C7.1 : No release in Tag&quot; effort=&quot;4&quot; /&gt;<br>
              &lt;/otherwise&gt;<br>
</span>       &lt;/iteration&gt;&lt;/perform&gt;<br>
  &lt;/rule&gt;<br>
<br>
This won&#39;t work, we don&#39;t have &lt;filename&gt; and &lt;filecontent&gt; doesn&#39;t have fileref.<br>
A chance for you to submit a Jira :)<br>
<br>
HTH,<br>
<br>
Ondra<br>
<div><div><br>
<br>
On 22.5.2015 12:14, Gilles Bardouillet wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I wrote an XML rule with an action specified in &quot;otherwise&quot; part, but<br>
&gt; the action is not launched when the condition is false :-(<br>
&gt;<br>
&gt; Here is my rule :<br>
&gt; &lt;rule id=&quot;TagLib release&quot;&gt;<br>
&gt;               &lt;when&gt;<br>
&gt;                   &lt;filecontent pattern=&quot;release&quot; filename=&quot;{*}Tag.java&quot; /&gt;<br>
&gt;               &lt;/when&gt;<br>
&gt;               &lt;otherwise&gt;<br>
&gt;                       &lt;hint message=&quot;C7.1 : No release in Tag&quot; effort=&quot;4&quot; /&gt;<br>
&gt;               &lt;/otherwise&gt;<br>
&gt; &lt;/rule&gt;<br>
&gt;<br>
&gt; In overview panel, this xml rule is converted in<br>
&gt; addRule()<br>
&gt; .when(And.all(FileContent.matches(release).inFilesNamed({*}Tag.java).as(default))<br>
&gt; )<br>
&gt;       .perform(new NoOp()<br>
&gt; )<br>
&gt; withId(&quot;TagLib release&quot;)<br>
&gt;<br>
&gt; It seems that &quot;otherwise&quot; action disappeared !<br>
&gt;<br>
&gt; Any tip ?<br>
&gt;<br>
&gt;<br>
&gt; Gilles.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Windup-users mailing list<br>
&gt; <a href="mailto:Windup-users@lists.jboss.org" target="_blank">Windup-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/windup-users" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-users</a><br>
<br>
_______________________________________________<br>
Windup-users mailing list<br>
<a href="mailto:Windup-users@lists.jboss.org" target="_blank">Windup-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/windup-users" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class=""><font color="#888888">-- <br><div>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;</div>
</div></div>