[rules-users] Guvnor another few questions...

Michael Anstis michael.anstis at gmail.com
Wed Jul 6 12:06:44 EDT 2011


Hi Justin,

I've answered some points you've raised below.

Hopefully others with greater knowledge in the areas in question can help
with the blanks.

With kind regards,

Mike

On 6 July 2011 16:15, Justin Case <send_lotsa_spam_here at yahoo.com> wrote:

> Hi all,
>
> I played a bit with 5.2.0.Final and I have a couple of more questions, I
> don't
> know whether I misread the documentation or I just expect too much...
>
> 1. Can I use functions in a web decision table columns? Because if yes, I
> just
> can't figure out how... Either way would be good, calling a function
> defined in
> Guvnor or calling a static function of some model class (like
> ModelClass.getMyParameter(...) ). Anything which would result to an eval()
> block... or should I use a "formula" caclulation type then enter in each
> cell
> the same eval(function()) call? Even so, I still need a rule like:
> rule"mine"
> when
>  eval($var.myFunction($date.lastTime))...
>
>
You can use a predicate within a pattern by selecting "Predicate" as the
Condition Column type. These compile to inline evals. It is not however
possible to define a predicate that is not part of a pattern.

If, in your example, $var and $date are constants you could look into using
a Template instead of Decision Table. You'll find there is greater
flexibility to what DRL you can define.


> 2. I see discussions about translations of Guvnor GUI, and I see them
> mentioning
> a certain Constants.properties file. I can't see that file anywhere in my
> installation, nor any other language translation for that matter although
> French
> and Spanish were mentioned. Is there by chance a German translation around,
> and
> even if no, how can one generate and use one?
>
>
The community edition (i.e. Guvnor, not JBoss BRMS) has translations for
es_ES, fr_FR, ja_JP, pt_BR, zh_CN and en_US. GWT compiles the resources away
into JScript. Depending upon your locale GWT will only dispatch the relevant
bundles to your browser. We have users on the mailing lists and IRC running
with fr_FR. I suspect some members of our community run es_ES or pt_BR.
Unfortunately all translations are undertaken by the community and as such,
unless somebody is willing to undertake a German translation it is unlikely
we will ever have one.


> 3. I have the feeling that uploading a new version of the POJO model jar
> updates
> the existing classes only. That is, if I remove a class from the Java model
> and
> upload it again, then package validation will fail because it doesn't find
> the
> old class (even when NOT used by any rule or anything I know of). Wasn't
> there
> somewhere a Guvnor dialog where one could remove POJO model classes by hand
> one
> by one? I kind of remember such a class list...
>

I find this observation strange, as the JAR is just stored as a BLOB in JCR
and the latest version retrieved to build suggestions available for rule
authoring.

There are however known issues, logged in JIRA, with Validation not clearing
down correctly which could lead to what you report.


> 4. And is it really that way that uploading a new POJO model requires an
> application restart to actually use it?
>

Not in my experience. I often upload POJO JARs (with 5.2 at least) and am
able to work with the classes defined therein without a restart.

>
> 5. If I upload something from Eclipse it lands under "Other assets,
> documentation" even if they are Java classes which I hoped would land under
> Model... is there anything I can do about that? A Java POJO model once
> uploaded
> is just a jar blob afterwards, not usable from Eclipse anymore...
>
> 6. The declarative model defined in Guvnor is not much usable in Eclipse
> either,
> comes as an unrecognized text file. I didn't try to edit it in Eclipse, the
> lack
> of integration in the application classes would bring nothing. Could the
> declarative model mapped somehow to some Java classes (or generate classes
> out
> of it)?
>

Declarative classes are made available using the syntax documented in Drools
Expert's user-guide when either (a) the DRL containing them is added to a
KnowledgeBase, (b) A serialised KnowledgeBase (as would be available from
Guvnor after building the package) is used. I suspect you are accessing the
"Declarative Model" resources from a Guvnor repository using the Eclipse
WebDAV facilities (given the context of your surrounding questions). AFAIK,
Declarative models are not available this way - they are stored on the Asset
in the repository using XStream to serialise the internal object graph to
XML. It might however be an interesting idea to provide a means to retrieve
their DRL equivalent through WebDAV. If you'd like to pursue this please
raise a JIRA capturing your requirement and details of your specification.

>
> 7. Clicking a Guvnor repository business rule file in Eclipse throws a
> WebDav
> error "not found", both for brl and gdsl files. Could it have to do with
> the
> fact that the package doesn't validate at the moment?
>
> 8. Clicking in Eclipse in the Guvnor perspective a freshly created rule
> flow
> (nothing uploaded yet) throws an exception as well...
>
> 9. If I have a model class with a field called aThing, it will have an
> accessor
> called getAThing(). Guvnor after POJO import will keep both capitals - thus
> in
> the field selection dropdowns I will have the field AThing... should this
> be my
> only problem.
>

Why is this a problem? As you say the field, presumably privately called
"aThing" is accessible via the getter "AThing"?

Does your DRL not compile?


> Thank you for any answers,
> JC
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110706/467e9d84/attachment.html 


More information about the rules-users mailing list