facts custom sort
by Syargey
Hello all,
I experienced a problem I can't solve.
After rules firing I got a number of facts of certain type.
I would like to get a collection of facts sorted by custom field with a
query.
Drools guide proposes to sort facts by a rule like:
rule "Rule 03"
when
$number : Number( )
not Number( intValue < $number.intValue )
then
System.out.println("Number found with value: "+$number.intValue() );
retract( $number );
end
But it doesn't suit me:
1) I can't retract facts from session
2) I need to get sorted collection with a query which doesn't have 'then'
part.
Is there any method to get custom sorted collection with a query?
--
View this message in context: http://drools.46999.n3.nabble.com/facts-custom-sort-tp3538410p3538410.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Guvnor Versioning - eclipse plug-in
by Ronald Albury
JBoss Developer Studio 4.1.1.GA
Guvnor 5.2.0.Final
Tomcat 7.0.23
Guvnor: Created categories and packages. Imported Pojo jar file
Eclipse: Created drl rules. Added to Guvnor via plug-in
Guvnor: Confirmed drl rules showed up. Everything validated and verified
Eclipse: Modified drl rule. Update via plug-in and discovered that update
meant that I got a new copy from Guvnor and overwrote my changes ....
rats-changing the name for that command would be nice.
Eclipse: Modified drl rule again. Commit via plug-in.
Guvnor: The drl changes didn't show up when I opened the rule. Checked
Version History - it showed three versions (the third being the one with my
changes), but indicated that Current Version is 2. If I 'view' version 3 I
see my changes.
I tried re-validating and re-verifying rule. I tried saving rule (didn't
work). I tried re-validating and rebuilding the package.
I give up ... how do I get Version 3 to be the 'Current Version'.
14 years, 7 months
Autoreply: Travis Smith is out of the office
by Travis_Smith@bnz.co.nz
I will be out of the office starting 02/12/2011 and will return on
12/12/2011.
I am on Annual Leave for the above duration.
For any URGENT issues in Lending Manager, HotDocs or Transact, please
contact BNZ Systems Support.
Regards,
-Trav
_______________________________________________
Travis Smith
Analyst Programmer
BTS Development Centre
Tel: +64 4 474 6356 Email: Travis_Smith(a)bnz.co.nz
CAUTION - This message may contain privileged and confidential information
intended only for the use of the addressee named above. If you are not the
intended recipient of this message you are hereby notified that any use,
dissemination, distribution or reproduction of this message is prohibited.
This email was sent by the Bank of New Zealand. You can contact us on
0800 ASK BNZ (0800 275 269). Any views expressed in this message are those
of the individual sender and may not necessarily reflect the views of Bank
of New Zealand.
14 years, 7 months
Re: [rules-users] Guvnor hates me
by Ronald Albury
Guvnor hated me at home on Linux.
I had to install/config everything again at work - only on Windows-7
Things are behaving much differently here at work ... in a good way
I will wipe and reinstall at home and see if it all gets better there
Thanks for your help and for your patience.
Ron
14 years, 7 months
Guvnor "inheritance"
by Joe Ammann
Hi
my users asked me to provide something like "package inheritance" in
Guvnor. They would like to be able to define some artefact types (most
notably DLSs, Working Sets, function definitions and extensible rules)
in a "parent package", and then create "sub packages" where only the
pure rule definitions live, but can use the artefacts from the "parent
package".
Now I realise that Guvnor/Drools packages are not really hierarchical.
They may happen to have dots in their name and be displayed in a tree,
but that's all.
I can implement this by doing "inheritance by copying", since I provide
the access to the Guvnor tree with my own Eclipse RCP application and
only use the asset editors from Guvnor. But I was wondering if I'm
missing some fundamental concept in Guvnor that would make this easy?
I could also imagine this to be realized by extending the concept of
working sets from fact types and fields to also include DSL, functions
and rules. That would even be more flexible :-)
--
CU, Joe
14 years, 7 months
removing reference to Global Data Model from Drools Package in Guvnor
by Welsh, Armand
Hello community,
I have noticed in interesting paradox in Guvnor.
If I promote my data model to the Global package, I can then import the model from global into my individual packages, so that I can update the model once, and all packages that use the model automatically have the new model.
However, I have a need to remove the imported model from one of my packages.
If I select the Model view, I have three buttons, Refresh List, Open Selected, and Open Selected to Single Tab.
If I open the model, and select the Attributes tab, it show the model comes from Global. If I archive the model, the global model is archived, and removed from all packages. If I restore the model, it is restored to all the packages that referenced it prior to archiving the model.
So my question: how to I remove a model, that was imported into a package from the Global Area, from my package, without remove the global model from the global area?
Regards,
Armand Welsh
14 years, 7 months
Re: [rules-users] Guvnor hates me
by Ronald Albury
Thanks Michael ... you've been very helpful.
Yes, I am considering helping out on the documentation (my undergrad is in
Instructional Technology) ... if I can ever figure out how all of this
works. I have also read thru some of the 3rd party books on the subject,
and I find them quite lacking also. I am not a dumb person, and I am not
inexperienced (been programming since 1980) ... so either I am just having
issues with the writing style of the manuals/books, or other people are
having trouble with them as well.
While we're waiting for an eclipse person to speak up, I have another
eclipse question. If I do a Project->Build All, I can see the errors in my
rule files. How can I configure eclipse to see the drl errors when I save
the files (as happens with my Java files).
Thanks.
14 years, 7 months
Re: [rules-users] Regular expression problem in .dsl
by FrankVhh
Hi,
The placeholder will just be replaced by whatever the user input is, there
is no need to do those String operations.
In your dsl, copy your DRL and replace everything that is user input by
{keyword}. Nothing else has to be done.
Regards,
Frank
fiitkar wrote
>
> Hello,
>
> I have a problem how to define the proper regular expression in .dsl file,
> LHS part, when searching a string with a defined input character.
>
> Before I used .drl file, the rule looks like:
> plan : Plan( item matches "S.*|.*[^#]S.*" ) - that's OK. So it matches an
> input with S, but not #S - that is not the point...
>
> But how to define it in .dsl file?
> Keep in mind that character "S" comes from the user, so it have to be
> merged with my regular expression.
>
> I tried it that way:
> [condition][]There is a Plan with item1 {inputCharacter}=$Plan : Plan(item
> matches {inputCharacter} + ".*|.*[^#]" + {inputCharacter} + ".*" )
>
> But I got compilation error: mismatched token ....
> So I want to create a regular expression using the input character.
> I use Drools 4.0.7
>
> Regards,
> Peter
>
--
View this message in context: http://drools.46999.n3.nabble.com/Regular-expression-problem-in-dsl-tp355...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months