Clone
 

luca molteni <volothamp@gmail.com> in Drools

[DROOLS-4175] Error in compiling BigLiteral binding as literal (#2388)

* Two failing tests

* Avoid try to parse a String as a BigDecimal or BigInteger literal if it's a declaration

* Better fix

[DROOLS-4104] Mvel-compiler (#2381)

* First commit

Some data type

First two phases

Some design

Rules of the game

Improved visitors

Copy and pasted solution

Removed inlinecast

Removed other classes

Algorithm explained

Other possible phases

Try to parse only types

First commit

Removed imperative assignment

Create type information phase

Subtyping!

toString

Test runnning

Removed phase

Moved packages

Moved packages

Moved context

FlattenExpressionPhase

FlattenExpressionPhase

New Phase

Refactor test

* New test

* Flatten phase

* Avoid flatten

* Inverted phase 2 and 3

* Process first node using the tree

* Navigating tree?

* JavaParser utilities

* Removed javaparser-utilities

* Removed javaparser-utilities

* Removed stream

* Only one phase, visiting the tree

* Moved error message

* Refactor

* Error message

* Reintroduced original grammar to support block

* Disabled comma expression in grammar, they should be only inside a modify block

* Variable declaration

* Multiple statements

* Refactor test

* Convert property access mixed

* Test modify

* Correct mvel modify syntax

* Renamed to DroolsConstraintParserTest.java

* New test in parser for modify

* Support MVEl modify statements

* Fix consequence

* Removed attach_pid files from git

* Modify is a statement, not an expression

* First draft of modify compiling

* testSetter

* StringLiteralExpressionT.java

* Removed duplicated test

* Method to find the stter

* Split among LHS and RHS

* String literal expression

* setter test passing, every other test failing

* Fixed property test

* Create a new declaration if missing

* Modify test

* Added transitive depedency

* Removed useless code

* Removed dependency from Drools Model Compiler

* Plugged in mvel compiler

* Refactor renaming

* Type is optional now

* Missing the scope from field accessors

* Public field accessor

* Pass scope instead of stack in context

* Refactor

* added todo

* Fix scope

* Refactor

* Uncompiled expression

* Plugged mvel compiler, found problems with modify and semicolons

* Added support for semicolon in mvel modify syntax

* Ignored test

* Added test

* Fix 7.20

* Preprocess methodcallexpr in modify statements

* sanitize single line scripts

* Plugged in compiler, removed validation of mvel scripts

* testAccessor ForArguments

* Better default method

* Fix testAccessorInArguments, broke other tests

* Fix all tests

* Removed println

* Better semicolons

* Semicolon sanitizier

* Also propagate errors

* Removed useless test

* Fix type in binary expressions

* Better sanitizier for modify

* Better sanitizer 2

* Do not append ; to empty strings

* Added modify object among modified properties

* Implement update with modify blocks

* Type resolver

* Better test

* Added trace of LHS

* Create new reference when missing

* Assume only one variable per decorator, removed declaration/declarator dualism

* testInitializerArrayAccess

* TypedExpression is an interface rather than an abstract class

* Map conversion

* testMixArrayMap and testMVELConsequenceWithMapsAndArray

* Test without semicolon

* Without semicolon test

* Fix rebase

* Fix hardcoded version

* Better test without semicolon

* simple test without semicolon

* Another test with method call

* Another test with method call

* Fix comment in GeneratedDrlConstraintParserTokenManagerBase.java

* Failing test with comment

* Test with comments passing

* Unignored test with comments

* New test for single line statement

* Single line block with comment with both and without semicolon

* Support empty statements with only new line

* All test passing

* Fix ModifyPreprocessPhase.java

* Fix first modify rewrite code, removed custom modify parsing

* Support new line in argument list

* Removed debug mode

* test property reactivity

* Fix modify empty block

* Fix new lines in argument list

* Removed SemicolonSanitizer.java

* Fix property reactivity

* Avoid processing nested methodCallExpr in modify setters

* fix NPE

* Refactor Mvel rewrite

* Removed mvel validation

* Removed unused import

* Fix AccumulateTest.testAccumulateMVELWithModify

* Fixed testNoLoopAccumulate

* Support target type when RHS type is missing

* Fix all AccumulaTest

* ImportsTest

* New test for EOL in BinaryExpr

* Support EOL after binary expr token

* Fix Nesting Test added new test for BinaryExpr with newLine

* Support variable declaration without initializer

* Fix StreamTest, correct drools scope

* Support arbitrary expressions in modify block

* Cep test, 4 tests left

* Better test

* Test for crashing pretty printer

* Fix rebase

* Added new test for new line expressions

* Added two new tests

* Fix typo

* Added negative test

* Formatting

* renamed test

* With statement support

* Constructor in with statement

* Correct implementation of with preprocessor

* Refactor

* Recurse over ModifyProcessor

* Fix MapInitializationDrools3800 by recursing the modify preprocessor

* Fix MapInitializationDrools3800 by recursing the modify preprocessor

* Use mvel compiler instead of ExpressionTyper during parsing of Mvel Accumulate Nodes

* Fix NPE

* Compilation after updating JP

* Fix mvel compiler dependency

* Fix version

* minimalized reproducer

* AST reproducer

* Compare reproducer with AssertJ

* Compare AST with diff, more similar

* Even more similar

* Avoid sharing static nodes that breaks the pretty printer

* Removed debugPrettyPrinter

* Reintroduced needed class generation

* Fix testPrettyPrinterCrashing

* Reverted model writer

* Revert packagemodel

* Reverted packageModel

* Removed PrettyPrinterTest.java

* Reverted ExpressionTyperTest.java

* Removed README.MD

* Duplication of removal of EmptyStmt

* Fixed ModifyCompilerTest

* Fix version

* Failing test for nested modify

* Recurse over blocks in consequence, new test for failing

* Fix ordering of with preprocessor

* Removed duplication in nested Modify preprocessor and fixed ordering

* Removed TODO

* Removed unused properties

* Public fields on LHS

* Removed another TODO

* Better type check

* Removed last todo

* Dependency in -boostrap

* Unsupported cases in DorolsConstraintParserTest

* Also support window EOL

* Renamed drools-constraint-parser to drools-mvel-parser

* Fix OSGI

* Assertj to test

* Removed ignore to 3505 test

* Fix typo

* Fix trace message

* Formatting

* Removed trace

* Added README.md of the module that explains how it works

* Fix typo

* Removed currying renamed method

* Renamed modified properties to used bindings

* Typo

* Removed drlconstraintparser

* Used consumer in test, reformatting

* Unused statement

* Added some documentation

* Improved documentation of the module

  1. … 144 more files in changeset.
[DROOLS-4085] Added change set xsd to avoid fetching it from the internet (#2373)

[DROOLS-4085] Support follow redirects and avoid using external URL (#2369)

* [DROOLS-4085] Support follow redirects and avoid using external URL for change set XSD

* Remove all other references to external XSD

* Avoid getting XSD from the internet

Update Java Parser from 3.10.2 to 3.13.10 (#2353)

* Drools compile after upgrade of JP from 3.10.2 to 3.13.10

* DrlNameExpr is a NameExpr

* support toString in DroolsConstraintParser nodes

  1. … 13 more files in changeset.
[DROOLS-4010] Improved Shading of drools-model file (#2348)

* [DROOLS-4010] Improved Shading of drools-model:

- Removed double slash

- Uses internalKieModule.getResource instead of kproject class loader

(ensures running MultiModuleTest in drools-jbpm-integration)

* Removed useless cast

[DROOLS-3875] Shade drools-model file based on the GAV of the KJar in… (#2340)

* [DROOLS-3875] Shade drools-model file based on the GAV of the KJar in order to

support multiple modules in a KieClassPathContainer

* Removed the downcast and the version as different version with same GA are not supported anyway.

[DROOLS-3960] Executable Model - kie-maven-plugin fails to generate model with a mix of Java and DRL facts (#2327)

* test

* Removed test

* Use eclipse compiler instead of Native to handle 3960

NativeCompiler won't compile DeclaredTypes with fields using class from the KJar

as it won't resolve any Maven compiled class

[DROOLS-3802] Build error with executable-model, nested property with double-bytes property name (#2302)

* testCapitalLetter

* Remove hack for enums

[DROOLS-3800] Parser error with executable-model on Map literal expression in constraint (#2300)

* Test case for map initialization

* MVEL Map initialization literal test

* Parsing of map initialization literal

* Support MapLiteralInitialization as argument

* Return type of map

* testMapInitialization passing

* Convert name to field accessor

* new test for failing two properties

* Ignored two pattern test

* Added regression test

* Empty Map literal

* Renamed test

* Added JIRA URLs

[DROOLS-3708] executable-model misses to raise an error for a non-exisiting method with Mvel dialect (#2269)

* First draft of validation

* Valid if no declared methods are present

* Removed useless code

* Removed compilation

* Added comment

* Moved consequenceValidation in the context

* Validate after having generated the types

* Validate classes with function

* Renamed memory file system

* Better class loader

* All MvelDialectTest passing

* Removed trace

* Optimized imports

* Avoid creating class loader when not needed

Drools Constraint Parser (#2266)

* Namespace changes

* Fix print util

* Compile

* Lots of test passing

* Other test passing

* 5 tests failing

* 4 tests filing

* 43 + 122

* 43+110

* 45+96

* 45+82

* 47+52

* 47+48

* NullSafeFieldAccess and NullSafeMethodCall

* 47 + 32

* 47 + 27

* 47+17

* 51+1

* 4 test failed! omg

* 2 test left

* Two tests left

* Fix cep tests

* 1 test left

* Fixed all tests in drools-model-compiler

* Sanitize scope during eval of constand fields

* Drools-constraint-parser

* FromVisitor support from DrlNameExpr

* Removed enforcer skip, explicit version

* Removed useless plugings

* Removed templating-maven-plugin and license tag

* Added brace statements

* Space after if

    • -0
    • +72
    /drools-model/drools-constraint-parser/pom.xml
  1. … 110 more files in changeset.
[DROOLS-3661] Executable model cannot parse enum in a constraint with from (#2263)

[Drools-3444] Support monitoring (#2236)

* Pass reference of before event in after

* Use timestamp instead of object

* Use shared event for n listeners

* After Activation has a reference to BeforeActivation

BeforeActivation has a timestamp

* Getter for before event

Avoid reinizialize n-time fields for bitmask each update (#2251)

[DROOLS-3598] Better error message while using the DummyKieScanner (#2244)

* [DROOLS-3598] Try remove lookup using KieScanner

* Revert remove scanner

Better error message

Better error message

Fix map access expression with recursive paths (#2240)

Fix for drlx-parser rebase (#2216)

* Added file

* Updated to drlx-parser after rebasing to 3.10.2

[DROOLS-3527] Added some test for BigDecimal with decimal values (#2218)

[DROOLS-3508] Search for Mvel dialect in Package attributes (#2215)

* [DROOLS-3508] Also search for Mvel dialect in pkg attributes

* Move setDialect in RuleContext

* Removed comment

Fixes 3505 - support comma in modify statements (#2214)

[DROOLS-3348] Support Compiled Feel Expression in the kie-maven-plugin (#2173)

* reproducer

* USe maven plugin to generate classes

* Added partner dmn file

* Generate Feel Expression Source

* Generated Feel Expression source

* Read class from source

* Use correct class name

* Refactor

* Also generate input clauses

* First draft of input clause

* INput clause

* Read input clauses

* Refactor

* Refactor

* Refactor

* Moved methods

* Generate rows

* Generate input rowsi

* Input rows

* Fix typo

* Removed class

* Reenabled test

* Fix compilation

* Fix generation

* Update version

* InitRows using JavaParser

* each two there should it be an array

* Fix test

* Input clause with JavaParser

* Removed output clauses

* Fix package

* Moved to separated class

* Removed StringBuilder

* Use JavaParserSourceGenerator

* Removed lambda from FeelEpxressionSourceGenerator

* Some more methods

* Removed yet another part of javaparser

* Source generator (almost) never use Javaparser

* Added license

* Fix regression

* Extracted field

* Generate Feel Expression class only when using it with the Maven Plugin

* Removed useless logger

* Read output clauses

* Avoid checking for exception

* Fix class reading

* Removed duplication

* Iterate over input clauses

* Removed context and interfaces

* Iterate over rows

* Reverted whitespace changes

* Removed method

* Listener to check the number of class generated

* Fix generation of FeelExpression class

* New test for DMN

* Removed test project

* Removed useless code

* Fix after review

* Space after if

[DROOLS-3238] Support DMN using CanonicalKieModule - Veryfing CI (#2141)

* Parse dmn resources in CanonicalKieModule.java

* Fix DMNIncrementalCompilationTest

* Fix DMNUpdateTest

* Fixes IncrementalCompilationTest

* Avoid readding same packages

* Fix IncrementalCompilationTest

* Separate changes

* Filter changes

* Update resources

* BuildAll without rules

* Invalidate accessor

* Removed getChanges

* Remove one method from public API

* Removed harcoding

* Renamed build2 to buildWithoutRules

* Parametrized DMNUpdateTest

* Parametrized DMNIncrementalCompilationTest

* Removed filter changes by executable model or not

* Removed public accessor

* Always parse drools file

* Smaller Changes in KieJarChangeSet.java

* Do not track for changes in CanonicalKieBaseUpdater.java

* Removed duplication

[DROOLS-2989] Avoid refire of rules with synthetic Fact Handles (#2106)

* Added test for deserialization

* Test for simple alpha node in MarshallerTest.java

* private node memories, add synthetic facts' object to a map in the agenda

* Proto syntax

* Regenerated protobuf messages

* Add object during serialization

* Added object to FromNodeMemory

* Need an index to serialize the object

* Added index to object serialization

* Read node memories object

* Avoid refire marshalled FactHandle

* Use old mechanism to avoid refiring in node != FromNode

* New test for unfired tuples

* Serialize dormant objecgt

* NodeId

* Match against object

* Dormient objects are already serialized

* Correct matching of objects

* Nullcheck

* Refactor

* Fix regression

* Removed useless code

* Removed dead code

* Fix regression

* Accumulate test

* Rebase

* RenamedTest

* New test for accumulate

* New test for RIAN

* new test

* JavaSerializableResolverStrategy

* Use java serialization encoder

* Changed testSubnetwork test

* Better test

* New test for subnetworks

* New test for subnetwork

* Do not serialize test

* ProtobufInputMarshaller returns the message along with the session

* testAgendaDoNotSerializeObject check if no objects are serialized

* Avoid deserializing if empty

* Serialize object only with FromNode

* Serialize object only with AccumulateNode

* Disposal of ksession

* Removed unnecessary code in ProtobufTestMarshaller

* Fix regression in test

* Removed assertion on demarshalling

* Explicit class loader

* Removed println

  1. … 4 more files in changeset.
[DROOLS-3072] kie-maven-plugin to persist DMN Compilation results in KJAR like for DRL exec model rules (#2117)

* Listener in configuration

* Move new instance of DMNCompilerConfigurationImpl outside the method

* Register listeners from configuration

* Listener gets filename and file contents

* Typesafe file path

* Avoid compile and define invoker based on listener

* Optimized import

* Deferred compiler

* Try read the evaluator from the class loader

* Removed boolean from event

* Events only in deferred

* Fix option of deferred

* Find the compiled class at runtime

* Find classes

* Instantiate evaluator

* Printout of invokator

* Avoid regenerate the classes if there's the META-INF file

* init parameters

* It workds

* Move generated class name to DTableModel.java

* DMNRuleClassFile

* Refactor

* Renamed ExecModelDMNMavenSourceCompiler.java to MavenSourceCompiler

* OOP

* Extracted method

* Inverted if condition

* Removed println

* Factory to createDMNEvaluator

* Factory to createDMNEvaluator

* Public Rule class flie

* Added debug

* Reverted useless changes

* Avoid caching configuration

* Cache CompilerConfigurationImpl

* Removed ExecModelCompilerDeferredOption.java

* Minor fixes

* minor fixes 2

[DROOLS-2625] Exec Model: support tests generating compositepatterns and count on multiple patterns (#2058)

* Fix test2AccumulatesWithOr

* Disabled accumulate test

* Support processing of ExistentialPatternImpl and CompositePatterns

* Ported failing test case from integrationTest

* Generate id for anonymous accumulate functions (fixes testAccumulateWithLessParameter)

* Better generator for missing accumulate binding id

* unique exprId for same constraint on different patterns

* Revert "unique exprId for same constraint on different patterns"

This reverts commit 8078322

* Avoid searching for declarations in a subnetworktuple if it's not needed (i.e. with accumulate)

* Disabled AccumulateTest

* Replace accumulate in DSL with a version that forces it to provide at least one accumulate function

* Fixed regression

[DROOLS-2625] Exec Model: support tests generating compositepatterns and count on multiple patterns (#2058)

* Fix test2AccumulatesWithOr

* Disabled accumulate test

* Support processing of ExistentialPatternImpl and CompositePatterns

* Ported failing test case from integrationTest

* Generate id for anonymous accumulate functions (fixes testAccumulateWithLessParameter)

* Better generator for missing accumulate binding id

* unique exprId for same constraint on different patterns

* Revert "unique exprId for same constraint on different patterns"

This reverts commit 8078322

* Avoid searching for declarations in a subnetworktuple if it's not needed (i.e. with accumulate)

* Disabled AccumulateTest

* Replace accumulate in DSL with a version that forces it to provide at least one accumulate function

* Fixed regression

(cherry picked from commit 7300c303ce331103b52264bd2e69f84fe666a5dc)

[DROOLS-2625] In the exec model use the legacy accumulator when the action uses globals (#2051)

* Fix test2AccumulatesWithOr

* Use legacyAccumulate when there's a global in the action block

* Disabled accumulate test

[DROOLS-2625] In the exec model use the legacy accumulator when the action uses globals (#2051)

* Fix test2AccumulatesWithOr

* Use legacyAccumulate when there's a global in the action block

* Disabled accumulate test

(cherry picked from commit 442bd46af866dfb69394362b14479396c5d1a4c3)

[DROOLS-2625] Better support for ArrayAccess Expression in Exec Model accumulate test (#2045)

* Better regexp match tests down to 26

* Disable accumulate tests

* New test for array access in AccumulateTest.java

* New test for array access

* Yet another new test for accumulate

* Parse element from arrayAccessExpr when it's a methodCallExpr

* First test of flattenScope

* Refactor test

* Flatten method call

* Unary expressions

* FlattenArrayAccess

* Fix testUseAccumulateFunctionWithArrayAccessOperation by supporting ArrayAccessExpression

* Support ArrayAccessExpr in AccumulateVisitor

* ArrayAccessExprWorking tests

* Expression Typer supports declarations with bindings

* First test of remove root node

* Removed println

* Converted arrayaccessexpr to methodcallexpr

* New FindRootViaNodeScope

* New remove node method

* Fix for method without scope

* Removed optional

* FIx regression of findRootNodeViaScope2Rec

* Rename

* Convert to methodCallExpr when using the accumulate

* Also coerce expressions on the right

* Support CastExpr in findLeftLeafOfMethod

* New test in FlowTest

* Fix ExpressionTyperTest.java

* Revert "Also coerce expressions on the right"

This reverts commit 5a42614

* Better test

* Removed test

* Moved unsupported test

* Regression test

* Fix regression

(cherry picked from commit 3fc8a354b7e0e176e11ee346d48e369c4f8ff522)