[JBoss JIRA] (DROOLS-5088) allowed values for a field check
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5088?page=com.atlassian.jira.plug... ]
Mario Fusco reassigned DROOLS-5088:
-----------------------------------
Assignee: Toni Rikkola (was: Mario Fusco)
> allowed values for a field check
> --------------------------------
>
> Key: DROOLS-5088
> URL: https://issues.redhat.com/browse/DROOLS-5088
> Project: Drools
> Issue Type: Feature Request
> Reporter: Werner Van Herrewegen
> Assignee: Toni Rikkola
> Priority: Major
>
> as a rule creator I want to be able to specify 'value in' based on an business central created 'enumeration'
> tech:
> Given:
> FACT address
> field string countryCode
> enumeration created by the business in business central to prevent mistyping at rule entry: 2digitIsoCountryCodes ['AF','AX','AL','DZ','AS','AD','AO','AI','AQ','AG','AR','AM','AW','AU','AT','AZ','BS','BH','BD','BB','BY','BE','BZ','BJ','BM','BT','BO','BQ','BA','BW','BV','BR','IO','BN','BG','BF','BI','KH','CM','CA','CV','KY','CF','TD','CL','CN','CX','CC','CO','KM','CG','CD','CK','CR','CI','HR','CU','CW','CY','CZ','DK','DJ','DM','DO','EC','EG','SV','GQ','ER','EE','ET','FK','FO','FJ','FI','FR','GF','PF','TF','GA','GM','GE','DE','GH','GI','GR','GL','GD','GP','GU','GT','GG','GN','GW','GY','HT','HM','VA','HN','HK','HU','IS','IN','ID','IR','IQ','IE','IM','IL','IT','JM','JP','JE','JO','KZ','KE','KI','KP','KR','XK','KW','KG','LA','LV','LB','LS','LR','LY','LI','LT','LU','MO','MK','MG','MW','MY','MV','ML','MT','MH','MQ','MR','MU','YT','MX','FM','MD','MC','MN','ME','MS','MA','MZ','MM','NA','NR','NP','NL','AN','NC','NZ','NI','NE','NG','NU','NF','MP','NO','OM','PK','PW','PS','PA','PG','PY','PE','PH','PN','PL','PT','PR','QA','RS','RE','RO','RU','RW','BL','SH','KN','LC','MF','PM','VC','WS','SM','ST','SA','SN','CS','SC','SL','SG','SX','SK','SI','SB','SO','ZA','GS','SS','ES','LK','SD','SR','SJ','SZ','SE','CH','SY','TW','TJ','TZ','TH','TL','TG','TK','TO','TT','TN','TR','XT','TM','TC','TV','UG','UA','AE','GB','US','UM','UY','UZ','VU','VE','VN','VG','VI','WF','EH','YE','ZM','ZW']
> they most likely create a data validation rule
> rule "checkValidCountryCode"
> dialect "mvel"
> when
> DeliveryAddress( countryCode not in ( "AF","AX","AL",.... ) ) <--manual comma separated entry
> .....
> I would like to have something like:
> rule "checkValidCountryCode"
> dialect "mvel"
> when
> DeliveryAddress( countryCode not in ( 2digitIsoCountryCodes.getEnumValues() ) )
> .....
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5084) grouping rules
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5084?page=com.atlassian.jira.plug... ]
Mario Fusco reassigned DROOLS-5084:
-----------------------------------
Assignee: Toni Rikkola (was: Mario Fusco)
> grouping rules
> --------------
>
> Key: DROOLS-5084
> URL: https://issues.redhat.com/browse/DROOLS-5084
> Project: Drools
> Issue Type: Feature Request
> Components: tools
> Reporter: Werner Van Herrewegen
> Assignee: Toni Rikkola
> Priority: Major
>
> As a business user I would like to have an easy way to +*visibly *+group certain rules together in the business central.
> As a business user I want to have an intuitive way to afterwards find rules related to one of those groups.
> constraints:
> I don't want to use package (physical folder structure)
> I don't want to use the current tags implementation as I don't use the left side 'developer' project/repository treeview
> multiple rules can have the same group
> some rules might fit under multiple groups and should thus be found under multiple 'groups'
> workaround:
> Currently I use my own naming convention to allow business people to search for rules having to do with a certain topic.
> But it is tedious to maintain as rule names are free text and I have no way to force them to use the convention.
> And also the user needs to currently guess the 'topic'-names in the rule search window instead of having a list of 'topics'
> suggested solution:
> I like the tags idea. this allows to have the many to many relationship of rules and 'rule groups'
> But the way it is implemented in the UI is not user friendly enough to get business people to use it. I would also force them to put at least 1 tag.
> And really important, tags must be forced to ALL_CAPITALS and no special signs but must ALLOW spaces (no underscores or hyphens for business users!).
> When creating a rule (the popup dialog where you name the rule and select the package), that is the time to add tags to it. (and not hidden in the overview>metadata tab)
> And afterwards they can be amended in this overview>metadata tab (though I would recommend to name it for business users 'rule info' tab, and make it easier to find) :-)
> This will ensure that business people categorize their rules to keep track of them when the list gets longer. (and not get IT to find them for them)
> For the second part ...
> Now that business people have tagged their rules with 'business topics', they need to have an easy way to find all rules related to this 'business topic' (tag)
> The rule filter window is an excellent place for this.
> I would like an additional filter text box that allows a collection of tags that will be used to filter the rules list.
> This text box is NOT 'free text' and should be fillable only with existing tags (think of the '+search +for labels' feature in jira)
> ->only allow valid tags (no free text)
> ->allow multiple tags (logic = OR/AND(perhaps also a NOT?) : use these words between selected tags iso just using a comma)
> ->drop down list sorted alphabetically with remaining valid tags
> In the result set, it would be also nice to to have an indication of the tags that apply to the specific rules.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5086) undo button
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5086?page=com.atlassian.jira.plug... ]
Mario Fusco reassigned DROOLS-5086:
-----------------------------------
Assignee: Toni Rikkola (was: Mario Fusco)
> undo button
> -----------
>
> Key: DROOLS-5086
> URL: https://issues.redhat.com/browse/DROOLS-5086
> Project: Drools
> Issue Type: Feature Request
> Components: tools
> Reporter: Werner Van Herrewegen
> Assignee: Toni Rikkola
> Priority: Major
>
> As a business user using the business central webapp I don't know what git is and want to have my 'undo' button that rolls back the last commit on 'my branch' when I make a mistake.
> tech:
> make sure a diff is shown and explicit validation is requested with an explicit 'confirm' button
> also take into account the case where a user deletes a file
> or wants to reverse the renaming or a file
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5362) Make kjar dependencies to be included in classpath even when it doesn't contain the pom.xml file (e.g. when build with gradle)
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5362?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-5362:
--------------------------------
Summary: Make kjar dependencies to be included in classpath even when it doesn't contain the pom.xml file (e.g. when build with gradle) (was: Dependencies not necessarily loaded)
> Make kjar dependencies to be included in classpath even when it doesn't contain the pom.xml file (e.g. when build with gradle)
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-5362
> URL: https://issues.redhat.com/browse/DROOLS-5362
> Project: Drools
> Issue Type: Feature Request
> Components: kie server
> Affects Versions: 7.29.0.Final
> Reporter: Steve Davidson
> Assignee: Mario Fusco
> Priority: Minor
> Labels: Kie-Server, Maven, kie-server, maven
> Attachments: KieDependencyDemo.tbz
>
>
> If the pom.xml is not included in the (k)jar, KieServer can not find the dependencies. While most Maven built projects include the pom.xml, not all do. Projects built & published from ANT and Gradle do not embed Maven's pom.xml by default in the generated jars -- although they ARE published to the Maven-style repos.
> Initial Description:
> When a Rule has a dependency on a class imported from a library jar in the local repository, the rule fails to compile/load:
> {code}
> May 22, 2020 3:35:05 PM org.drools.compiler.kie.builder.impl.AbstractKieProject buildKnowledgePackages
> SEVERE: Unable to build KieBaseModel:default-dependency-demo
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 001']
> Unable to resolve ObjectType 'DemoData' : [Rule name='Inventory Item 002']
> Rule Compilation error : [Rule name='Inventory Item 001']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0012002200180.java (9:543) : jds cannot be resolved
> Rule Compilation error : [Rule name='Inventory Item 002']
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (2:40) : Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (8:490) : jds cannot be resolved
> com/j2eeguys/demo/rules/Rule_Inventory_Item_0021364978446.java (9:543) : jds cannot be resolved
> Error importing : 'com.j2eeguys.demo.data.DemoData'
> May 22, 2020 3:35:05 PM org.kie.server.services.impl.KieServerImpl createContainer
> SEVERE: Error creating container 'Kie Dependency Demo: kie-server' for module 'com.j2eeguys.demo:demo-dependency-rules:0.1.0-SNAPSHOT'
> java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=7, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=2, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=16, column=0
> text=Unable to resolve ObjectType 'DemoData'], Message [id=3, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=5, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=4, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=14, column=0
> text=Rule Compilation error Only a type can be imported. com.j2eeguys.demo.data.DemoData resolves to a package
> jds cannot be resolved
> jds cannot be resolved], Message [id=5, kieBase=default-dependency-demo, level=ERROR, path=com/j2eeguys/demo/rules/kieIssueDemo.drl, line=1, column=0
> text=Error importing : 'com.j2eeguys.demo.data.DemoData']]
> at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:379)
> at org.kie.server.services.drools.DroolsKieServerExtension.createContainer(DroolsKieServerExtension.java:98)
> at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:286)
> at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:157)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
> at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:509)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:399)
> at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:363)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:365)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:337)
> at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:310)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:443)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:233)
> at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:139)
> at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:358)
> at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:142)
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:219)
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1401)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
> at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:501)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1296)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1211)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:500)
> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months
[JBoss JIRA] (DROOLS-5329) Review externalizing lambda failure case
by Kris Verlaenen (Jira)
[ https://issues.redhat.com/browse/DROOLS-5329?page=com.atlassian.jira.plug... ]
Kris Verlaenen updated DROOLS-5329:
-----------------------------------
Sprint: 2020 Week 19-21 (from May 4), 2020 Week 22-24 (from May 25), 2020 Week 25-27 (from Jun 15) (was: 2020 Week 19-21 (from May 4), 2020 Week 22-24 (from May 25))
> Review externalizing lambda failure case
> ----------------------------------------
>
> Key: DROOLS-5329
> URL: https://issues.redhat.com/browse/DROOLS-5329
> Project: Drools
> Issue Type: Task
> Components: executable model
> Affects Versions: 7.37.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> In CompilerTest#testStringValueOf, there is a case where MaterializedLambdaPredicate is not created.
> {code:java}
> public static org.drools.model.Rule rule_R() {
> final org.drools.model.Variable<java.lang.Integer> var_GENERATED_$pattern_Integer$1$ = D.declarationOf(java.lang.Integer.class,
> DomainClassesMetadata81A66AD685F7689036AAA5128956C14B.java_lang_Integer_Metadata_INSTANCE,
> "GENERATED_$pattern_Integer$1$");
> final org.drools.model.Variable<Integer> var_$i = D.declarationOf(Integer.class, "$i");
> final org.drools.model.Variable<org.drools.modelcompiler.domain.Person> var_GENERATED_$pattern_Person$1$ = D.declarationOf(org.drools.modelcompiler.domain.Person.class,
> DomainClassesMetadata81A66AD685F7689036AAA5128956C14B.org_drools_modelcompiler_domain_Person_Metadata_INSTANCE,
> "GENERATED_$pattern_Person$1$");
> org.drools.model.Rule rule = D.rule("R").build(D.pattern(var_GENERATED_$pattern_Integer$1$).bind(var_$i, (java.lang.Integer _this) -> _this.intValue()),
> D.pattern(var_GENERATED_$pattern_Person$1$).expr("476633DA7C4638FC84A32859E0C843E6",
> var_$i,
> (_this, $i) -> org.drools.modelcompiler.util.EvaluationUtil.areNullSafeEquals(_this.getName(),
> (String.valueOf($i))),
> D.reactOn("name")),
> D.on(var_$i).execute(defaultpkg.P1D.LambdaConsequence1D5F4C5CA006007B1D3974ED5A5A05B6.INSTANCE));
> return rule;
> }
> {code}
> See
> {code:java}
> expr("476633DA7C4638FC84A32859E0C843E6",
> var_$i,
> (_this, $i) -> org.drools.modelcompiler.util.EvaluationUtil.areNullSafeEquals(_this.getName(),
> (String.valueOf($i)))
> {code}
> It throws DoNotConvertLambdaException in ExecModelLambdaPostProcessor.
> {code:java}
> private void extractLambdaFromMethodCall(MethodCallExpr methodCallExpr, Supplier<MaterializedLambda> lambdaExtractor) {
> methodCallExpr.getArguments().forEach(a -> {
> if (a.isLambdaExpr()) {
> LambdaExpr lambdaExpr = a.asLambdaExpr();
> try {
> CreatedClass aClass = lambdaExtractor.get().create(lambdaExpr.toString(), imports, staticImports);
> lambdaClasses.put(aClass.getClassNameWithPackage(), aClass);
> ClassOrInterfaceType type = StaticJavaParser.parseClassOrInterfaceType(aClass.getClassNameWithPackage());
> a.replace(lambdaInstance(type));
> } catch(DoNotConvertLambdaException e) {
> logger.debug("Cannot externalize lambdas {}", e.getMessage());
> }
> }
> });
> }
> {code}
> Review if it's something can be fixed.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 7 months