Guided Decision Tree - update/insert value based on lookup table

33 views
Skip to first unread message

Radovan Tomala

unread,
Jan 6, 2022, 3:35:42 AM1/6/22
to Drools Usage
Hello,

I am currently working on a PoC for our client to find out the capabilities of Business Central.

I have a table of Job names and their ids and recieve a Job name as an input. I need to create a new variable with id of given job which I have to find in the lookup table. I need to work with this value in the nexts steps of the tree.  Would this be possible using Guided decision tree? I tried using guided decision table for the lookup but I did not find a way to insert it into the tree.

Thank you.


Michael Anstis

unread,
Jan 6, 2022, 7:45:40 AM1/6/22
to Drools Usage
Sadly the Guided Decision Tree capabilities within Business Central are quite limited and do not support your need.

With a Guided Decision Table you could probably use a "global variable" to provide a lookup service; calling this from the RHS (THEN) of a rule to retrieve ID from Name.

The User Guide provides details of rules' RHS and use of "global variables".

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/eba60b1e-7fa4-41a0-b77b-8ffd682bc6cfn%40googlegroups.com.

Radovan Tomala

unread,
Jan 7, 2022, 2:28:03 AM1/7/22
to Drools Usage
Thank you for the answer. I will look into the RHS.
Dne čtvrtek 6. ledna 2022 v 13:45:40 UTC+1 uživatel michael...@gmail.com napsal:

Davi Sáránszky Mesquita

unread,
Jan 8, 2022, 8:16:02 PM1/8/22
to drools...@googlegroups.com
Well, i dont know where to start.

I am using Amazon Corretto 8 and everything its fine.

When i build a docker image with Amazon Corretto with Amazon Linux 2 jdk 8. The error its absolute not clear what i am doing wrong or whats is going on.

The command:

kieServices.newKieBuilder(kfs).buildAll();

Code:
private static synchronized KieResources getFactoryService() {
return LazyHolder.service;
}

private static class LazyHolder {
private static final KieResources service = ServiceRegistry.getService(KieResources.class);
}

File: org.kie.internal.io.ResourceFactory

OBS: The LazyHolder.service its always null and get a npe.


Stack:
java.lang.NullPointerException: null
        at org.kie.internal.io.ResourceFactory.newByteArrayResource(ResourceFactory.java:66)
        at org.drools.compiler.kie.builder.impl.AbstractKieModule.getResource(AbstractKieModule.java:296)
        at org.drools.compiler.kie.builder.impl.AbstractKieModule.addResourceToCompiler(AbstractKieModule.java:259)
        at org.drools.compiler.kie.builder.impl.AbstractKieModule.addResourceToCompiler(AbstractKieModule.java:254)
        at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:257)
        at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:75)
        at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:271)
        at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:239)
        at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:192)






Davi
+55 (11) 9-6395-3728


Davi Sáránszky Mesquita

unread,
Jan 8, 2022, 9:23:27 PM1/8/22
to drools...@googlegroups.com
Well, i tested with other docker jdk and Ubuntun + apt-get openjdk ... and does not work anymore.

i also downgrade to verison 7.29.0.Final and does not work

Davi
+55 (11) 9-6395-3728


Davi Sáránszky Mesquita

unread,
Jan 8, 2022, 11:36:29 PM1/8/22
to drools...@googlegroups.com
I found the issue. The “shade” process are missing some files.

Anyone has a codesample of Maven Shade that works on latest version of drools?
--

Davi
+55 (11) 9-6395-3728

Reply all
Reply to author
Forward
0 new messages