drools 7.57.0.Final

195 views
Skip to first unread message

Joud Kassem

unread,
Aug 9, 2021, 11:36:35 AM8/9/21
to drools...@googlegroups.com
Hello all,

I'm upgrading from drools 6.5.0.Final to drools 7.57.0.Final. I see many differences and I'm getting many errors in my app.

First, what are the alternatives to the following in the new version:
"org.drools.core.command.CommandService" and "org.drools.core.marshalling.impl.TimersInputMarshaller"
"org.drools.core.command.impl.FixedKnowledgeCommandContext"
"org.drools.core.command.impl.GenericCommand"
"org.drools.core.command.impl.KnowledgeCommandContext"

Is there any guide for the changes?

Thanks in advance!

Best regards,
Joud

Toshiya Kobayashi

unread,
Aug 10, 2021, 1:15:33 AM8/10/21
to Drools Usage
Hi Joud,

Those classes are changed like below. If you have further problems, please share your code for review.

Unfortunately, we don't have a guide for such class changes but if you look at the commits (especially, unit test changes), it could be a hint how to change your app codes.

~~~

* org.drools.core.command.CommandService -> org.kie.api.runtime.ExecutableRunner


* org.drools.core.marshalling.impl.TimersInputMarshaller -> org.drools.serialization.protobuf.TimersInputMarshaller


* org.drools.core.command.impl.GenericCommand -> org.kie.api.command.ExecutableCommand
* org.drools.core.command.impl.FixedKnowledgeCommandContext -> org.drools.core.command.impl.ContextImpl
* org.drools.core.command.impl.KnowledgeCommandContext -> org.kie.internal.command.RegistryContext


~~~

Regards,
Toshiya



2021年8月10日火曜日 0:36:35 UTC+9 joud.k...@gmail.com:

Joud Kassem

unread,
Aug 10, 2021, 4:31:09 AM8/10/21
to drools...@googlegroups.com, toshiyak...@gmail.com
Thanks a lot Toshiya for the information. It's very helpful. I managed to change few things based on the info you sent but haven't reached the testing phase yet. Still working on making the code compiles successfully.

I have another question, I extended before the "MarshallerReaderContext" class and used its constructors + "resolveClass" method in my plugin. Now I see it turned into an interface. Is there an alternative to it or I need to reimplement everything I used before?

Many thanks for your help,
Joud

--
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/e1be6f68-0928-4791-8149-106b37075064n%40googlegroups.com.

Toshiya Kobayashi

unread,
Aug 10, 2021, 10:39:29 PM8/10/21
to Drools Usage
Hi Joud,

The change was done by this commit:

MarshallerReaderContext's impl is now org.drools.serialization.protobuf.ProtobufMarshallerReaderContext which exists in drools-serialization-protobuf module.

Cheers,
Toshiya


2021年8月10日火曜日 17:31:09 UTC+9 joud.k...@gmail.com:

Joud Kassem

unread,
Aug 12, 2021, 9:11:37 AM8/12/21
to drools...@googlegroups.com, toshiyak...@gmail.com
Hi Toshiya,

Thank you so much again. I found it after searching yesterday and it works finally.

One final related question. In my plugin code, I register a gorm kiestrore using:
org.kie.internal.utils.ServiceRegistryImpl.getInstance().registerLocator(KieStoreServices.class, {
            return applicationContext.getBean('kstore')
        })

Now I see there's no "org.kie.internal.utils.ServiceRegistryImpl" anymore while there's "org.kie.api.internal.utils.ServiceRegistry" which doesn't have "registerLocator". How can I do the registration in this case?

Thank you in advance!

All the best,
Joud

Toshiya Kobayashi

unread,
Aug 16, 2021, 6:01:55 AM8/16/21
to Drools Usage
Hi Joud,

Now ServiceRegistry discovers services from kie.conf files.

Please create kie.conf file under your app's META-INF directory and write like this. 

```
org.kie.api.persistence.jpa.KieStoreServices = com.sample.MyKieStoreServices;1
```

Replace `com.sample.MyKieStoreServices` with your custom impl class. `;1` is required to specify its priority. (default org.drools.persistence.jpa.KnowledgeStoreServiceImpl has priority 0 so yours will be used)

You can find the detail of the discovery logic in this class:

Cheers,
Toshiya

Reply all
Reply to author
Forward
0 new messages