update tutorials

pull/3/head
Mahmoud Ben Hassine 10 years ago
parent 0fc49f9e61
commit 50897c12c9

@ -34,12 +34,12 @@ import io.github.benas.easyrules.core.BasicRule;
public class HelloWorldRule extends BasicRule {
/**
* The user input
* The user input which represents the data that the rule will operate on.
*/
private String input;
public HelloWorldRule(String name, String description, int priority) {
super(name, description, priority);
public HelloWorldRule(String name, String description) {
super(name, description);
}
@Override

@ -24,7 +24,6 @@
package io.github.benas.easyrules.samples.helloworld;
import io.github.benas.easyrules.api.RulesEngine;
import io.github.benas.easyrules.core.DefaultRulesEngine;
import java.util.Scanner;
@ -45,7 +44,7 @@ public class HelloWorldSampleLauncher {
/**
* Define the rule
*/
HelloWorldRule helloWorldRule = new HelloWorldRule("Hello World rule", "Say Hello to only duke's friends", 1);
HelloWorldRule helloWorldRule = new HelloWorldRule("Hello World rule", "Say Hello to only duke's friends");
/**
* Set data to operate on
@ -55,7 +54,7 @@ public class HelloWorldSampleLauncher {
/**
* Create a default rules engine and register the business rule
*/
RulesEngine rulesEngine = new DefaultRulesEngine();
DefaultRulesEngine rulesEngine = new DefaultRulesEngine();
rulesEngine.registerRule(helloWorldRule);
/**

@ -46,8 +46,7 @@ public class OrderSampleLauncher {
*/
SuspectOrderRule suspectOrderRule = new SuspectOrderRule(
"Suspect Order",
"Send alert if a new customer places an order with amount greater than a threshold",
1);
"Send alert if a new customer places an order with amount greater than a threshold");
/**
* Set data to operate on
@ -58,7 +57,7 @@ public class OrderSampleLauncher {
/**
* Create a default rules engine and register the business rule
*/
RulesEngine rulesEngine = new DefaultRulesEngine();
DefaultRulesEngine rulesEngine = new DefaultRulesEngine();
rulesEngine.registerRule(suspectOrderRule);
/**

@ -50,4 +50,4 @@ public interface SuspectOrderJmxManagedRule extends Rule {
*/
void setSuspectOrderAmountThreshold(float suspectOrderAmountThreshold);
}
}

@ -26,11 +26,14 @@ package io.github.benas.easyrules.samples.order;
import io.github.benas.easyrules.core.BasicRule;
import javax.management.MXBean;
/**
* Business rule class that defines suspect order rule.
*
* @author Mahmoud Ben Hassine (md.benhassine@gmail.com)
*/
@MXBean
public class SuspectOrderRule extends BasicRule implements SuspectOrderJmxManagedRule {
private float suspectOrderAmountThreshold = 1000;
@ -39,8 +42,8 @@ public class SuspectOrderRule extends BasicRule implements SuspectOrderJmxManage
private Customer customer;
SuspectOrderRule(String name, String description, int priority) {
super(name, description, priority);
SuspectOrderRule(String name, String description) {
super(name, description);
}
@Override

Loading…
Cancel
Save