Adding data into DataStream object before matches the rules in DRL file

93 views
Skip to first unread message

Anas Sakhnini

unread,
Apr 7, 2024, 5:43:36 AM4/7/24
to Kogito development mailing list
Hi all,

I create a RuleUint class which implements RuleUnitData, and its contains a DataSream called persons, I want to know how can add a data into persons before matching the rules in DRL file

Richard Bourner

unread,
Apr 8, 2024, 12:44:42 PM4/8/24
to Kogito development mailing list
Your "persons" attribute should be of type DataStore [1].
Then you can add your data in that store, either using the Java API before firing the rules, or passing it in the payload of a REST request directly if you are using Kogito (which will generate the endpoint for this RuleUnit automatically).

Marija

unread,
Oct 21, 2024, 10:20:55 AM10/21/24
to Kogito development mailing list
Hi, so drl rules cant be executed in kogito with Java API, that is just for drools apps, and kogito uses only rest endpoints
?


Jeremy Legros

unread,
Jan 14, 2025, 7:41:09 AM1/14/25
to Kogito development mailing list
Hi!
It took me a while to find some docs regarding DataStream vs. DataStore, but here it is:
https://docs.drools.org/latest/drools-docs/drools/KIE/index.html#_data_sources

Hope this helps, cheers

Gabriele Cardosi

unread,
Jan 14, 2025, 7:51:45 AM1/14/25
to kogito-de...@googlegroups.com
Hi Marija,
about
"Hi, so drl rules cant be executed in kogito with Java API, that is just for drools apps, and kogito uses only rest endpoints ?"
If it may help, the current main branch of kogito-examples contains a couple of "java" examples, and maybe this one could be useful.

Hope it helps

Cheers




--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/98002d95-981d-45d8-a594-77dc48bbb5ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages