those sorts of market objects used to be pretty common. Adding in a dummy field is probably acceptable for now though. <br><br><div class="gmail_quote">On Thu, Nov 11, 2010 at 3:12 AM, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">    Wolfgang,<br>
<br>
    I am not sure how useful such a no-field control fact is, but<br>
anyway, feel free to open a JIRA and propose a way to support that<br>
from a syntax perspective. I.e., we will probably need to use a new<br>
annotation to allow users to explicitly tell the engine to generate<br>
the no-field bean, what could be more cumbersome than simply use a<br>
dummy field in these specific cases.<br>
<br>
    Open for suggestions,<br>
<div><div></div><div class="h5">    Edson<br>
<br>
<br>
2010/11/10 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;:<br>
&gt; I can declare a useful event type which doesn&#39;t have any fields<br>
&gt; except the implicit timestamp and duration. As you&#39;ve described,<br>
&gt; the compiler assumes that this is an extension of an imported<br>
&gt; fact, and complains if this cannot be found.<br>
&gt;<br>
&gt; Here is a complete, not too contrived use case.<br>
&gt;<br>
&gt; declare Trigger<br>
&gt;  @role( event )<br>
&gt;  @expires( 1s )<br>
&gt;  void: Void         ## required due to compiler&#39;s insistence of<br>
&gt; Trigger being defined elsewhere<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;1m ticker&quot;<br>
&gt;    timer(int: 1m 1m)<br>
&gt; when<br>
&gt; then<br>
&gt;    insert( new Trigger() );<br>
&gt; end<br>
&gt;<br>
&gt; rule &quot;count jobs 30 minutes before Trigger&quot;<br>
&gt; when<br>
&gt;    $t: Trigger()<br>
&gt;    Number( $i: intValue &gt; 3 ) from accumulate(<br>
&gt;       Job( this before[0,30m] $t )<br>
&gt;       count( 1 ) )<br>
&gt; then<br>
&gt;    retract( $t );<br>
&gt;    System.out.println( &quot;Too many jobs (&quot; + $i + &quot;) at &quot; + clockAsString() );<br>
&gt; end<br>
&gt;<br>
&gt; Cheers<br>
&gt; Wolfgang<br>
&gt;<br>
&gt; On 10 November 2010 16:03, Edson Tirelli &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt; wrote:<br>
&gt;&gt;   Hi Wolfgang,<br>
&gt;&gt;<br>
&gt;&gt;   Not sure what is the intent with that?<br>
&gt;&gt;<br>
&gt;&gt;   Just to explain the design, the compiler differentiates two use<br>
&gt;&gt; cases: (1) if a declare has no fields in it, it understands the user<br>
&gt;&gt; is annotating an existing class. (2) If a declare has at least one<br>
&gt;&gt; field, then the compiler tries to generate a new class and annotate<br>
&gt;&gt; it.<br>
&gt;&gt;<br>
&gt;&gt;   In case (1) above, if the compiler does not find an existing class,<br>
&gt;&gt; it (correctly, IMO) raises an error.<br>
&gt;&gt;<br>
&gt;&gt;   Can you please clarify?<br>
&gt;&gt;<br>
&gt;&gt;   Thanks,<br>
&gt;&gt;       Edson<br>
&gt;&gt;<br>
&gt;&gt; 2010/11/10 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;:<br>
&gt;&gt;&gt; This simple declare for a new (not imported) class isn&#39;t permitted by<br>
&gt;&gt;&gt; the compiler, although it makes sense.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Of course, it&#39;s possible to work around by adding a dummy field.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; But is this restriction intentional by design, to alert users when<br>
&gt;&gt;&gt; they misspell a class name, or forget to import a class?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If not, I&#39;ll make a request to permit this.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -W<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt;   Edson Tirelli<br>
&gt;&gt;   JBoss Drools Core Development<br>
&gt;&gt;   JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-dev mailing list<br>
&gt;&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michael D Neale<br>home: <a href="http://www.michaelneale.net">www.michaelneale.net</a><br>blog: <a href="http://michaelneale.blogspot.com">michaelneale.blogspot.com</a><br>