diff --git a/easyrules-samples/src/main/resources/org/easyrules/samples/spring/application-context.xml b/easyrules-samples/src/main/resources/org/easyrules/samples/spring/application-context.xml index 5e19f32..a0fc79a 100644 --- a/easyrules-samples/src/main/resources/org/easyrules/samples/spring/application-context.xml +++ b/easyrules-samples/src/main/resources/org/easyrules/samples/spring/application-context.xml @@ -5,7 +5,7 @@ http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/site/user-guide/embedding-rules-engine.md b/site/user-guide/embedding-rules-engine.md index 8903e2e..dd8dea2 100644 --- a/site/user-guide/embedding-rules-engine.md +++ b/site/user-guide/embedding-rules-engine.md @@ -33,7 +33,7 @@ Then, you can configure your rules and the rules engine as follows: http://www.springframework.org/schema/beans/spring-beans.xsd"> - + @@ -66,6 +66,12 @@ As you can see, this factory bean is the main entry point to configure: * Rules listeners * And engine parameters (priority threshold, skipOnFirstAppliedRule, silentMode, etc) +
+
Heads up!
+

If your rules are not thread safe, you should consider make them of scope prototype.

+

The rules engine instance returned by the RulesEngineFactoryBean is already of scope prototype.

+
+ To get the engine and fires rules, you can use the following snippet: ```java @@ -75,7 +81,7 @@ RulesEngine rulesEngine = (RulesEngine) context.getBean("rulesEngine"); rulesEngine.fireRules(); ``` -
+
Hint:

The main advantage of using Easy Rules with Spring is the ability to register/unregister rules through the Xml configuration without recompiling your application.