<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Interesting.. can you define a package
in the global declarative model without it<br>
clashing with the separate rule packages?<br>
Otherwise, I'd consider it a bug<br>
<br>
On 09/04/2013 10:43 AM, Lance Leverich wrote:<br>
</div>
<blockquote
cite="mid:CAFkuzNdYT9qMP4PKWNJau23w6Uij4gSCn19rrttOAMazOvvQ+w@mail.gmail.com"
type="cite">
<div dir="ltr">The issue isn't that Foo cannot be resolved, as it
was imported into both packages from the Global Area. The
packages compile just fine. I believe what might be happening,
though, is that each package is creating its own version of Foo.
<div>
For example, am I experiencing something like...</div>
<div> <font face="courier new, monospace">com.mypkg.a</font>
generates a class with a fully qualified name of <font
face="courier new, monospace">drools.com.mypkg.a.Foo</font></div>
<div> <font face="courier new, monospace">com.mypkg.b</font>
generates a class with a fully qualified name of <font
face="courier new, monospace">drools.com.mypkg.b.Foo</font></div>
<div>?</div>
<div><br>
</div>
<div>If this is the case, is there someway within Guvnor to
refer to a particular version? I'm beginning to think that my
best option might be to create a POJO and import it. At least
that way, I can make sure I know the fully qualified (i.e.
canonical) class name.<br>
<div class="gmail_extra"><br clear="all">
<div>~ Lance</div>
<br>
<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: <br>
Date: Wed, 4 Sep 2013 15:41:55 +0100<br>
Subject: Re: [rules-users] Fully qualified name for
generated classes<br>
<div dir="ltr">
<div>
<div>Guvnor's Global Area has no affect on fully
qualified type names; it's just a container for
things you want to share.<br>
<br>
</div>
If Foo could not be resolved in myRuleB the rule
would fail to compile.<br>
<br>
</div>
What do you observations show if you don't have any
rule flow?<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 4 September 2013 15:28,
Lance Leverich <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:lance.leverich@gmail.com"
target="_blank">lance.leverich@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">What would be the fully qualified
name for a generated class, that is based upon a
fact type (for example a type named "Foo") that
is defined inside a declarative model?
<div>
How is the fully qualified name affected if
the model resides in the Global Area, and is
imported into multiple packages?</div>
<div><br>
</div>
<div>The reason for my question is that I have
the following issue:</div>
<div><br>
</div>
<div>In the Global Area, I have a declarative
model (named MyModel) with a definition
like...</div>
<div><font face="courier new, monospace">
declare Foo</font></div>
<div><font face="courier new, monospace">
bar: String</font></div>
<div><font face="courier new, monospace">
version: String</font></div>
<div><font face="courier new, monospace"> end</font></div>
<div><br>
</div>
<div>In a package (com.mypkg.a), I have imported
MyModel from the Global Area. I have a rule
like...</div>
<div><br>
</div>
<div><font face="courier new, monospace"> rule
"myRuleA"</font></div>
<div><font face="courier new, monospace">
ruleflow-group "firstGroup"</font></div>
<div><font face="courier new, monospace"> when</font></div>
<div><font face="courier new, monospace">
not Foo( bar=="bar" )</font></div>
<div><font face="courier new, monospace"> then</font></div>
<div><font face="courier new, monospace">
Foo fact = new Foo();</font></div>
<div><font face="courier new, monospace">
fact.setBar("bar");</font></div>
<div><font face="courier new, monospace">
fact.setVersion("1");</font></div>
<div><font face="courier new, monospace">
insert(fact);</font></div>
<div><br>
</div>
<div>In another package (com.mypkg.b), I have
also imported MyModel from the Global Area. I
have a rule like</div>
<div><br>
</div>
<div> <font face="courier new, monospace"> rule
"myRuleB"</font></div>
<div><font face="courier new, monospace">
ruleflow-group "secondGroup"<br>
</font></div>
<div><font face="courier new, monospace"> when</font></div>
<div><font face="courier new, monospace">
Foo()</font></div>
<div><font face="courier new, monospace"> then</font></div>
<div><font face="courier new, monospace">
System.out.println("got at least one Foo");</font></div>
<div><br>
</div>
<div>Looking at logs, the rule myRuleA fires as
is appropriate; however, the rule myRuleB does
not fire, even though both ruleflow groups are
represented in the ruleflow. I have verified
that both of the ruleflow groups are
activated, using the logs. My best guess at
this point is that the class generated for
fact type Foo is different for each package.
So, how can I make sure that I am
instantiating and checking for the same type
across packages?</div>
<span><font color="#888888">
<div><br>
</div>
<div><br>
</div>
<div><br clear="all">
<div>Lance Leverich</div>
</div>
</font></span></div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org"
target="_blank">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</body>
</html>