0

I have a question about using a certian drools functionality in drools decision spreadsheet, that would help a lot in reducing the files and making them more readable.

I can't add more than two links so please downlad this .zip file that includes: Version1.PNG, Version1.drl, Version2.PNG, Version2.drl, Version3desired.drl

http://s000.tinyupload.com/?file_id=89653236807266194978

So here is the sample rule that we are using right now (something similar)Version1.PNG

And this when converted to a drl gives us the following 193 line long drl file. (Version1.drl)

It is ok and it works well, but after some research we found out we could use the "extends" functionality in drl.

And it works in a drl, what I would like to know is how would I use it in an Excel spreadsheet?

I designed the rule in this way: Version2.PNG

Clearly this is not how "extends" should be used in Excel, since this returns the following drl (Version2.drl)

You can see the extends is inside the "" of the rule name. Makes sense I guess, what I woudl like to know however is, how would I use it correctly? a seperate column? That didn't work, at least not the way I did it.

Does anyone know how It should be done?

The correct DRL that should be made after the Excel is converted is this: (Version3desired.drl)

Thank you for any help :) Cheers!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

There is no gain in using extends with spreadsheets in the way you describe it in your question.

I suggest that you stick to the spreadsheet layout shown in Version1.png. If data entry personnel complains about the dull repetition of 1/7/30 in oodles of rows, teach them how to join cells so they need to type each value only once.

laune
  • 31,114
  • 3
  • 29
  • 42
  • But the gain is a greatly reduced drl size (reduced by 25% in this example) And yes it might not be much here, since it's just a small rule, but if we could use it correctly in our working projects it could reduce the drl by 2000-3000 lines of code on just one drl. – Žiga Hanžič Apr 10 '17 at 07:41
  • I've heard this more than once. It usually turns out that using the decision table is a rash decision. As soon as people provide realistic data on the structure of their fact(s) and the expected numbers of rows etc. a superior solution can be found. For instance: 50,000 rules collapsed into one, while data entry technique remains the same. – laune Apr 11 '17 at 02:35