You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "mariofusco (via GitHub)" <gi...@apache.org> on 2024/04/11 14:43:55 UTC

[PR] [KIE-1085] avoid wasteful creation of a custom operator per constraint at runtime when using the executable model [incubator-kie-drools]

mariofusco opened a new pull request, #5844:
URL: https://github.com/apache/incubator-kie-drools/pull/5844

   See https://github.com/apache/incubator-kie-issues/issues/1085
   
   With this change the operator instance is stored in a static field of the package model 
   
   ```
   public static final org.drools.model.functions.Operator.SingleValue<Object, Object> OPERATOR_supersetOf_INSTANCE = new org.drools.model.codegen.execmodel.generator.operatorspec.CustomOperatorWrapper(new org.drools.compiler.integrationtests.CustomOperatorTest.SupersetOfEvaluatorDefinition().getEvaluator(org.drools.base.base.ValueType.OBJECT_TYPE, "supersetOf", false, null), "supersetOf");
   ```
   
   so that the same instance can be reused by all constraints
   
   ```
        @Override()
       public boolean test(org.drools.testcoverage.common.model.Person _this, org.drools.testcoverage.common.model.Person $alice) throws java.lang.Exception {
           return D.eval(defaultpkg.Rules68EE95F12A426D19D8745A5FE99E2A61.OPERATOR_supersetOf_INSTANCE, _this.getAddresses(), $alice.getAddresses());
       }
   ```


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [KIE-1085] avoid wasteful creation of a custom operator per constraint at runtime when using the executable model [incubator-kie-drools]

Posted by "mariofusco (via GitHub)" <gi...@apache.org>.
mariofusco merged PR #5844:
URL: https://github.com/apache/incubator-kie-drools/pull/5844


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org