Last active
February 3, 2026 20:24
-
-
Save dacr/56f9252bd8877876ba1f7f48f0a293fe to your computer and use it in GitHub Desktop.
Drools Hello world smallest / published by https://github.com/dacr/code-examples-manager #25514626-7c53-4aeb-b574-3e2f186057e7/87a8e4a634b4d909104c5742e222fc76aaf62f2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // summary : Drools Hello world smallest | |
| // keywords : scala, drools, mvel, scalatest, ai, helloworld, @testable | |
| // publish : gist | |
| // authors : David Crosson | |
| // license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
| // id : 25514626-7c53-4aeb-b574-3e2f186057e7 | |
| // created-on : 2021-03-05T09:25:00Z | |
| // managed-by : https://github.com/dacr/code-examples-manager | |
| // run-with : scala-cli $file | |
| // --------------------- | |
| //> using scala "3.5.1" | |
| //> using dep "fr.janalyse::drools-scripting:1.2.0" | |
| //> using dep "org.scalatest::scalatest:3.2.19" | |
| // --------------------- | |
| import fr.janalyse.droolscripting.* | |
| val drl = | |
| """package test | |
| |rule "hello" when then | |
| | insert("HELLO WORLD"); | |
| |end""".stripMargin | |
| val engine = DroolsEngine(drl) | |
| engine.fireAllRules() | |
| engine.strings.foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment