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"><<a href="mailto:tirelli@post.com">tirelli@post.com</a>></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 <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
> I can declare a useful event type which doesn't have any fields<br>
> except the implicit timestamp and duration. As you've described,<br>
> the compiler assumes that this is an extension of an imported<br>
> fact, and complains if this cannot be found.<br>
><br>
> Here is a complete, not too contrived use case.<br>
><br>
> declare Trigger<br>
> @role( event )<br>
> @expires( 1s )<br>
> void: Void ## required due to compiler's insistence of<br>
> Trigger being defined elsewhere<br>
> end<br>
><br>
> rule "1m ticker"<br>
> timer(int: 1m 1m)<br>
> when<br>
> then<br>
> insert( new Trigger() );<br>
> end<br>
><br>
> rule "count jobs 30 minutes before Trigger"<br>
> when<br>
> $t: Trigger()<br>
> Number( $i: intValue > 3 ) from accumulate(<br>
> Job( this before[0,30m] $t )<br>
> count( 1 ) )<br>
> then<br>
> retract( $t );<br>
> System.out.println( "Too many jobs (" + $i + ") at " + clockAsString() );<br>
> end<br>
><br>
> Cheers<br>
> Wolfgang<br>
><br>
> On 10 November 2010 16:03, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>> wrote:<br>
>> Hi Wolfgang,<br>
>><br>
>> Not sure what is the intent with that?<br>
>><br>
>> Just to explain the design, the compiler differentiates two use<br>
>> cases: (1) if a declare has no fields in it, it understands the user<br>
>> is annotating an existing class. (2) If a declare has at least one<br>
>> field, then the compiler tries to generate a new class and annotate<br>
>> it.<br>
>><br>
>> In case (1) above, if the compiler does not find an existing class,<br>
>> it (correctly, IMO) raises an error.<br>
>><br>
>> Can you please clarify?<br>
>><br>
>> Thanks,<br>
>> Edson<br>
>><br>
>> 2010/11/10 Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
>>> This simple declare for a new (not imported) class isn't permitted by<br>
>>> the compiler, although it makes sense.<br>
>>><br>
>>> Of course, it's possible to work around by adding a dummy field.<br>
>>><br>
>>> But is this restriction intentional by design, to alert users when<br>
>>> they misspell a class name, or forget to import a class?<br>
>>><br>
>>> If not, I'll make a request to permit this.<br>
>>><br>
>>> -W<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>
>>><br>
>><br>
>><br>
>><br>
>> --<br>
>> 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>
>><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>
><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>