Last active
October 6, 2024 10:54
-
-
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/5378d5db4d13186e6f49150386887f5738bae3e2
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 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.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