Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active June 24, 2023 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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/cda841f8a7450c0dc5757945982c7a0f4cdec282
// 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.3.0"
//> 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