Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active May 25, 2024 10:20
Show Gist options
  • Save dacr/56f9252bd8877876ba1f7f48f0a293fe to your computer and use it in GitHub Desktop.
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/3dd66fba6b4e94c5747df100aaf919c06eb0f969
// summary : Drools Hello world smallest
// keywords : scala, drools, mvel, scalatest, ai, helloworld, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// 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.4.2"
//> using dep "fr.janalyse::drools-scripting:1.1.0"
//> using dep "org.scalatest::scalatest:3.2.16"
// ---------------------
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