mariofusco commented on PR #6352:
URL:
https://github.com/apache/incubator-kie-drools/pull/6352#issuecomment-2921571440
> @mariofusco can you provide a high level list of items missing in
RuleUnits? It sounds to me that addressing those gaps could be turned a strong
roadmap for Drools.
I agree with everything @gitgabrio wrote, finding especially relevant his
point 3.
Moreover:
1. As a replacement for agenda-groups, ruleunits are supposed to encapsulate
groups of related rules. However it has been never made clear how to pass the
execution flow from a ruleunit(instance) to another, especially within the drl.
The main problem there is that you can create multiple instances from the same
ruleunit, but it isn't clear how to identify a specific instance. I made many
experiments on this in the past, but without reaching a solution that made me
happy.
2. Differently from agenda-groups each ruleunit is backed by its own
session. In theory this design promotes better encapsulation. In practice this
creates the problem of how to share facts and events across different
ruleunits. This should be done by feeding multiple ruleunits with the same
datasource, but I always found this idea difficult to understand for users.
3. The use of ruleunits also implies the use of the oopath notation in the
drl. You could use the pattern matching notation referring to datasource as
entry-points, but this would be extremely verbose and makes useless the fact
that datasources are strongly typed. I must admit that I have never been
satisfied with oopath: try to translate a drl of medium to high complexity in
oopath and you will understand why. Some key features, like accumulate, are
particularly inconvenient to be written in oopath. Finally oopath also has some
unresolvable ambiguities, for instance if you write something like
```
b: /a/b
/c/d
```
it's impossible for the parser to decide if these are 2 different oopath or
simply the second line is the continuation of the oopath started in the first.
The parser always assumes the second option, concatenating the 2 lines in a
single oopath, but this is often very confusing and surprising for users.
In essence for sure we are not in the position to say that ruleunits+oopath
are battle-tested and fully functional equivalent to the traditional KieSession
approach and that's why it's difficult to me to consider them the preferred way
to write rules in drools.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]