<div dir="ltr">The rule should be formatted as he originally posted:<div><br></div><div><span class="im" style="font-size:12.8000001907349px"><rule id="TagLib release"><br> <when><br></span><span style="font-size:12.8000001907349px"> <filecontent matches="{*}" filename="</span><span style="font-size:12.8000001907349px">{*}Tag.java</span><span style="font-size:12.8000001907349px">"/></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> </when></span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px"> <otherwise></span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"><span style="color:rgb(80,0,80);font-size:12.8000001907349px"> <hint message="C7.1 : No release in Tag" effort="4" /></span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"><span style="color:rgb(80,0,80);font-size:12.8000001907349px"> </otherwise></span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"> </rule></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">It sounds like there might be a bug here if the "otherwise" clause is not being picked up. We'll have to look into this! I created an issue for it: <a href="https://issues.jboss.org/browse/WINDUP-613">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"><br><div class="gmail_quote">On Wed, May 27, 2015 at 7:07 AM, Ondrej Zizka <span dir="ltr"><<a href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am no expert on <otherwise>, but I think that it has no context of<br>
what was found.<br>
In other words, you are trying to apply <hint>, but Windup doesn't know<br>
what to apply it to. The file is only "known" in the scope of nested<br>
<when> and in <perform> .<br>
Again, that's my guess, someone more knowledgable may confirm or not.<br>
<br>
If I am right, then you could either do a nested <perform><iteration>:<br>
The first would find {*}Tag.java, the nested <when> would find the<br>
pattern, or not:<br>
<span class=""><br>
<rule id="TagLib release"><br>
<when><br>
</span> <filename pathPattern="{*}Tag.java" as="file"/><br>
</when><br>
<perform><iteration><br>
<when><br>
<filecontent pattern="release" fileref="file" /><br>
<span class=""> </when><br>
<otherwise><br>
<hint message="C7.1 : No release in Tag" effort="4" /><br>
</otherwise><br>
</span> </iteration></perform><br>
</rule><br>
<br>
This won't work, we don't have <filename> and <filecontent> doesn't have fileref.<br>
A chance for you to submit a Jira :)<br>
<br>
HTH,<br>
<br>
Ondra<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 22.5.2015 12:14, Gilles Bardouillet wrote:<br>
><br>
> Hi,<br>
><br>
> I wrote an XML rule with an action specified in "otherwise" part, but<br>
> the action is not launched when the condition is false :-(<br>
><br>
> Here is my rule :<br>
> <rule id="TagLib release"><br>
> <when><br>
> <filecontent pattern="release" filename="{*}Tag.java" /><br>
> </when><br>
> <otherwise><br>
> <hint message="C7.1 : No release in Tag" effort="4" /><br>
> </otherwise><br>
> </rule><br>
><br>
> In overview panel, this xml rule is converted in<br>
> addRule()<br>
> .when(And.all(FileContent.matches(release).inFilesNamed({*}Tag.java).as(default))<br>
> )<br>
> .perform(new NoOp()<br>
> )<br>
> withId("TagLib release")<br>
><br>
> It seems that "otherwise" action disappeared !<br>
><br>
> Any tip ?<br>
><br>
><br>
> Gilles.<br>
><br>
> _______________________________________________<br>
> Windup-users mailing list<br>
> <a href="mailto:Windup-users@lists.jboss.org">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>
<br>
_______________________________________________<br>
Windup-users mailing list<br>
<a href="mailto:Windup-users@lists.jboss.org">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>-- <br><div class="gmail_signature">Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>"Simpler is better."</div>
</div>