This commit is contained in:
Nicolas Héron 2016-06-03 11:44:59 +02:00
commit e86dc983cb
78 changed files with 1567 additions and 2602 deletions

View file

@ -1,22 +0,0 @@
//#created on: 30 oct. 2010
package cours
//list any import classes here.
import droolscours.Account;
import droolscours.util.OutputDisplay;
//#declare any global variables here
global OutputDisplay showResult;
rule "Your First Rule revisited"
when
Account( )
then
showResult.showText("Le compte existe donc déjà");
end

View file

@ -1,22 +0,0 @@
//#created on: 30 oct. 2010
package cours
//list any import classes here.
import droolscours.Account;
import droolscours.util.OutputDisplay;
//#declare any global variables here
global OutputDisplay showResult;
rule "Your First Rule revisited"
when
Account( )
then
showResult.showText("Le compte existe donc déjà");
end

View file

@ -1,46 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4"> <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" /> <output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="drools-framework-runtime-base" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: org.kie:kie-api:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.drools:drools-compiler:6.4.0.Final" level="project" /> <orderEntry type="library" name="Maven: org.drools:drools-compiler:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.drools:drools-core:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" />
<orderEntry type="library" name="Maven: org.kie:kie-internal:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.5" level="project" /> <orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.5" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jdt.core.compiler:ecj:3.5.1" level="project" />
<orderEntry type="library" name="Maven: org.mvel:mvel2:2.2.8.Final" level="project" /> <orderEntry type="library" name="Maven: org.mvel:mvel2:2.2.8.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-bpmn2:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow-builder:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.1" level="project" />
<orderEntry type="module" module-name="drools-framework-common" />
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.7" level="project" /> <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.7" level="project" />
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" /> <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
<orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" /> <orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" /> <orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.drools:drools-core:6.4.0.Final" level="project" /> <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" /> <orderEntry type="library" name="Maven: org.eclipse.jdt.core.compiler:ecj:3.5.1" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-bpmn2:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow-builder:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow:6.4.0.Final" level="project" /> <orderEntry type="library" name="Maven: org.jbpm:jbpm-flow:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" /> <orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
<orderEntry type="library" name="Maven: org.kie:kie-internal:6.4.0.Final" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.5" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" /> <orderEntry type="library" name="Maven: org.kie:kie-api:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" /> <orderEntry type="module" module-name="drools-lesson-pojo" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
<orderEntry type="module" module-name="drools-framework-runtime-entity" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.4.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.4.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.4.0" level="project" />
</component> </component>
</module> </module>

43
cost-calculation/pom.xml Normal file
View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>droolscourse</artifactId>
<groupId>com.pymma-software.droolscourse</groupId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cost-calculation</artifactId>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
</dependency>
<dependency>
<groupId>com.pymma-software.droolscourse</groupId>
<artifactId>drools-lesson-pojo</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,57 @@
package cost;
public class CalculatedElement {
private String key;
private int numberValue;
private String stringValue;
private long longValue;
private double doubleValue;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getNumberValue() {
return numberValue;
}
public void setNumberValue(int numberValue) {
this.numberValue = numberValue;
}
public String getStringValue() {
return stringValue;
}
public void setStringValue(String stringValue) {
this.stringValue = stringValue;
}
public long getLongValue() {
return longValue;
}
public void setLongValue(long longValue) {
this.longValue = longValue;
}
public double getDoubleValue() {
return doubleValue;
}
public void setDoubleValue(double doubleValue) {
this.doubleValue = doubleValue;
}
@Override
public String toString() {
return "CalculatedElement [key=" + key + ", numberValue=" + numberValue + ", stringValue=" + stringValue
+ ", longValue=" + longValue + ", doubleValue=" + doubleValue + "]";
}
}

View file

@ -0,0 +1,30 @@
package cost;
public class City {
public static String ShangaiCityName = "Shangai";
public static String RotterdamCityName = "Rotterdam";
public static String TournaiCityName = "Tournai";
public static String LilleCityName = "Lille";
private String name;
public City(String name) {
super();
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "City [name=" + name + "]";
}
}

View file

@ -0,0 +1,47 @@
package cost;
import java.util.ArrayList;
import java.util.List;
public class CostCalculationRequest {
private Order order;
private Trip trip;
private List<Pallet> pallets = new ArrayList<Pallet>();
private List<CostElement> costElements = new ArrayList<CostElement>();
public Order getOrder() {
return order;
}
public void setOrder(Order order) {
this.order = order;
}
public Trip getTrip() {
return trip;
}
public void setTrip(Trip trip) {
this.trip = trip;
}
public List<Pallet> getPallets() {
return pallets;
}
public void setPallets(List<Pallet> pallets) {
this.pallets = pallets;
}
public List<CostElement> getCostElements() {
return costElements;
}
public void setCostElements(List<CostElement> costElements) {
this.costElements = costElements;
}
}

View file

@ -0,0 +1,5 @@
package cost;
public interface CostElement {
}

View file

@ -0,0 +1,6 @@
package cost;
public class CostItem {
}

View file

@ -0,0 +1,31 @@
package cost;
public class HandlingCostElement implements CostElement {
private double amount;
private City city;
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
@Override
public String toString() {
return "HandlingCostElement [amount=" + amount + ", city=" + city + "]";
}
}

View file

@ -0,0 +1,53 @@
package cost;
public class LeftToDistribute {
private OrderLine orderLine;
private long quantityLeft;
private double weightLeft;
public LeftToDistribute(OrderLine orderLine, double weightLeft) {
super();
this.orderLine = orderLine;
this.weightLeft = weightLeft;
}
public LeftToDistribute(OrderLine orderLine, long quantityLeft) {
super();
this.orderLine = orderLine;
this.quantityLeft = quantityLeft;
}
public OrderLine getOrderLine() {
return orderLine;
}
public void setOrderLine(OrderLine orderLine) {
this.orderLine = orderLine;
}
public long getQuantityLeft() {
return quantityLeft;
}
public void setQuantityLeft(long quantityLeft) {
this.quantityLeft = quantityLeft;
}
public double getWeightLeft() {
return weightLeft;
}
public void setWeightLeft(double weightLeft) {
this.weightLeft = weightLeft;
}
@Override
public String toString() {
return "LeftToDistribute [orderLine=" + orderLine + ", quantityLeft=" + quantityLeft + ", weightLeft="
+ weightLeft + "]";
}
}

View file

@ -0,0 +1,37 @@
package cost;
import java.util.ArrayList;
import java.util.List;
public class Order {
private String id;
private List<OrderLine> orderLines = new ArrayList();
public Order(String id) {
super();
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<OrderLine> getOrderLines() {
return orderLines;
}
public void setOrderLines(List<OrderLine> orderLines) {
this.orderLines = orderLines;
}
}

View file

@ -0,0 +1,51 @@
package cost;
public class OrderLine {
private int numberItems;
private double weight;
private Product product;
public OrderLine(int numberItems, Product product) {
super();
this.numberItems = numberItems;
this.product = product;
}
public OrderLine(double weight, Product product) {
super();
this.weight = weight;
this.product = product;
}
public int getNumberItems() {
return numberItems;
}
public void setNumberItems(int numberItems) {
this.numberItems = numberItems;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
@Override
public String toString() {
return "OrderLine [numberItems=" + numberItems + ", weight=" + weight + ", product=" + product + "]";
}
}

View file

@ -0,0 +1,89 @@
package cost;
import java.util.HashMap;
import java.util.Map;
public class Pallet {
private boolean isFull = false;
private double heightLeft = 2.0;
private double width = 0.8;
private double depth = 1.2;
private Map<Product, Long> contentQuantity = new HashMap<Product, Long>();
private Map<Product, Double> contentWeight = new HashMap<Product, Double>();
private int palletType;
public Map<Product, Long> getContentQuantity() {
return contentQuantity;
}
public Map<Product, Double> getContentWeight() {
return contentWeight;
}
public void addContent(Product product, Long quantity) {
if (contentQuantity.containsKey(product) == false) {
contentQuantity.put(product, quantity);
} else {
Long oldQuantity = contentQuantity.get(product);
oldQuantity = oldQuantity + quantity;
}
}
public void addContent(Product product, Double weight) {
if (contentWeight.containsKey(product) == false) {
contentWeight.put(product, weight);
} else {
Double oldQuantity = contentWeight.get(product);
oldQuantity = oldQuantity + weight;
}
}
public boolean isFull() {
return isFull;
}
public void setFull(boolean isFull) {
this.isFull = isFull;
}
public double getHeightLeft() {
return heightLeft;
}
public void setHeightLeft(double heightLeft) {
this.heightLeft = heightLeft;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public double getDepth() {
return depth;
}
public void setDepth(double depth) {
this.depth = depth;
}
public int getPalletType() {
return palletType;
}
public void setPalletType(int palletType) {
this.palletType = palletType;
}
@Override
public String toString() {
return "Pallet [isFull=" + isFull + ", heightLeft=" + heightLeft + ", width=" + width + ", depth=" + depth
+ ", palletType=" + palletType + "]";
}
}

View file

@ -0,0 +1,106 @@
package cost;
public class Product {
public static int transportType_pallet = 1;
public static int transportType_individual = 2;
public static int transportType_bulkt = 3;
private String name;
private double height;
private double width;
private double depth;
private double weight;
private int transportType;
public Product(String name, double height, double width, double depth, double weight, int transportType) {
super();
this.name = name;
this.height = height;
this.width = width;
this.depth = depth;
this.weight = weight;
this.transportType = transportType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public double getDepth() {
return depth;
}
public void setDepth(double depth) {
this.depth = depth;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public int getTransportType() {
return transportType;
}
public void setTransportType(int transportType) {
this.transportType = transportType;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Product other = (Product) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
@Override
public String toString() {
return "Product [name=" + name + ", height=" + height + ", width=" + width + ", depth=" + depth + ", weight="
+ weight + ", transportType=" + transportType + "]";
}
}

View file

@ -0,0 +1,61 @@
package cost;
public class Step {
public static int Ship_TransportType = 1;
public static int train_TransportType = 2;
public static int truck_TransportType = 3;
private City stepStart;
private City stepEnd;
private double distance;
private int transportType;
public Step(City stepStart, City stepEnd, double distance, int transportType) {
super();
this.stepStart = stepStart;
this.stepEnd = stepEnd;
this.distance = distance;
this.transportType = transportType;
}
public City getStepStart() {
return stepStart;
}
public void setStepStart(City stepStart) {
this.stepStart = stepStart;
}
public City getStepEnd() {
return stepEnd;
}
public void setStepEnd(City stepEnd) {
this.stepEnd = stepEnd;
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public int getTransportType() {
return transportType;
}
public void setTransportType(int transportType) {
this.transportType = transportType;
}
@Override
public String toString() {
return "Step [stepStart=" + stepStart + ", stepEnd=" + stepEnd + ", distance=" + distance + ", transportType="
+ transportType + "]";
}
}

View file

@ -0,0 +1,39 @@
package cost;
public class TaxesCostElement implements CostElement {
private double amount;
private City city;
private Pallet pallet;
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
public Pallet getPallet() {
return pallet;
}
public void setPallet(Pallet pallet) {
this.pallet = pallet;
}
@Override
public String toString() {
return "TaxesCostElement [amount=" + amount + ", city=" + city + ", pallet="
+ pallet + "]";
}
}

View file

@ -0,0 +1,5 @@
package cost;
public class TotalAmount {
}

View file

@ -0,0 +1,29 @@
package cost;
public class TransportCostElement implements CostElement {
private double amount;
private Step step;
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public Step getStep() {
return step;
}
public void setStep(Step step) {
this.step = step;
}
@Override
public String toString() {
return "TransportCostElement [amount=" + amount + ", step=" + step + "]";
}
}

View file

@ -0,0 +1,37 @@
package cost;
import java.util.ArrayList;
import java.util.List;
public class Trip {
private String id;
private List<Step> steps = new ArrayList<Step>();
public Trip(String id) {
super();
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<Step> getSteps() {
return steps;
}
public void setSteps(List<Step> steps) {
this.steps = steps;
}
@Override
public String toString() {
return "Trip [id=" + id + "]";
}
}

View file

@ -0,0 +1,19 @@
package util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateHelper {
public static String sFormat = "yyyy-MM-dd";
public static Date getDate(String sDate) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
return sdf.parse(sDate);
}
public static Date getDate(String sDate, String anotherFormat)
throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(anotherFormat);
return sdf.parse(sDate);
}
}

View file

@ -0,0 +1,174 @@
package util;
import org.jbpm.workflow.instance.node.RuleSetNodeInstance;
import org.kie.api.KieServices;
import org.kie.api.event.process.*;
import org.kie.api.event.rule.*;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.StatelessKieSession;
public class KnowledgeSessionHelper {
public static KieContainer createRuleBase() {
KieServices ks = KieServices.Factory.get();
KieContainer kieContainer = ks.getKieClasspathContainer();
return kieContainer;
}
public static StatelessKieSession getStatelessKnowledgeSession(KieContainer kieContainer, String sessionName) {
StatelessKieSession kSession = kieContainer.newStatelessKieSession(sessionName);
return kSession;
}
public static KieSession getStatefulKnowledgeSession(KieContainer kieContainer, String sessionName) {
KieSession kSession = kieContainer.newKieSession(sessionName);
return kSession;
}
public static KieSession getStatefulKnowledgeSessionForJBPM(
KieContainer kieContainer, String sessionName) {
KieSession session = getStatefulKnowledgeSessionWithCallback(kieContainer, sessionName);
session.addEventListener(new ProcessEventListener() {
@Override
public void beforeVariableChanged(ProcessVariableChangedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void beforeProcessStarted(ProcessStartedEvent arg0) {
System.out.println("Process Name " + arg0.getProcessInstance().getProcessName() + " has been started");
}
@Override
public void beforeProcessCompleted(ProcessCompletedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void beforeNodeTriggered(ProcessNodeTriggeredEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void beforeNodeLeft(ProcessNodeLeftEvent arg0) {
if (arg0.getNodeInstance() instanceof RuleSetNodeInstance) {
System.out.println("Node Name " + arg0.getNodeInstance().getNodeName() + " has been left");
}
}
@Override
public void afterVariableChanged(ProcessVariableChangedEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void afterProcessStarted(ProcessStartedEvent arg0) {
}
@Override
public void afterProcessCompleted(ProcessCompletedEvent arg0) {
System.out.println("Process Name " + arg0.getProcessInstance().getProcessName() + " has stopped");
}
@Override
public void afterNodeTriggered(ProcessNodeTriggeredEvent arg0) {
if (arg0.getNodeInstance() instanceof RuleSetNodeInstance) {
System.out.println("Node Name " + arg0.getNodeInstance().getNodeName() + " has been entered");
}
}
@Override
public void afterNodeLeft(ProcessNodeLeftEvent arg0) {
}
});
return session;
}
public static KieSession getStatefulKnowledgeSessionWithCallback(
KieContainer kieContainer, String sessionName) {
KieSession session = getStatefulKnowledgeSession(kieContainer, sessionName);
session.addEventListener(new RuleRuntimeEventListener() {
public void objectInserted(ObjectInsertedEvent event) {
System.out.println("Object inserted \n"
+ event.getObject().toString());
}
public void objectUpdated(ObjectUpdatedEvent event) {
System.out.println("Object was updated \n"
+ "new Content \n" + event.getObject().toString());
}
public void objectDeleted(ObjectDeletedEvent event) {
System.out.println("Object retracted \n"
+ event.getOldObject().toString());
}
});
session.addEventListener(new AgendaEventListener() {
public void matchCreated(MatchCreatedEvent event) {
System.out.println("The rule "
+ event.getMatch().getRule().getName()
+ " can be fired in agenda");
}
public void matchCancelled(MatchCancelledEvent event) {
System.out.println("The rule "
+ event.getMatch().getRule().getName()
+ " cannot b in agenda");
}
public void beforeMatchFired(BeforeMatchFiredEvent event) {
System.out.println("The rule "
+ event.getMatch().getRule().getName()
+ " will be fired");
}
public void afterMatchFired(AfterMatchFiredEvent event) {
System.out.println("The rule "
+ event.getMatch().getRule().getName()
+ " has be fired");
}
public void agendaGroupPopped(AgendaGroupPoppedEvent event) {
}
public void agendaGroupPushed(AgendaGroupPushedEvent event) {
}
public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event) {
}
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event) {
}
public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event) {
}
public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event) {
}
});
return session;
}
}

View file

@ -0,0 +1,10 @@
package util;
public class OutputDisplay {
public void showText(String someText) {
long time = System.currentTimeMillis();
System.out.println("time=" + time + "-" + someText);
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="rules" packages="rules">
<ksession name="ksession-rules"/>
</kbase>
</kmodule>

View file

@ -0,0 +1,3 @@
groupId=CostCalculation.group
artifactId=CostCalculation.artifact
version=1.0

View file

@ -0,0 +1,219 @@
package cost.calculation
import cost.OrderLine;
import cost.LeftToDistribute;
import cost.Product;
import cost.Pallet;
import cost.CostCalculationRequest;
import cost.CalculatedElement;
import cost.HandlingCostElement;
import cost.TaxesCostElement;
import cost.TransportCostElement;
import cost.Step;
import cost.City;
import java.lang.Math;
import java.util.ArrayList;
rule "boatTransportCost"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$s : Step(transportType ==Step.Ship_TransportType)
then
TransportCostElement t = new TransportCostElement();
t.setStep($s);
t.setAmount($c.getPallets().size()*$s.getDistance()*0.2);
$c.getCostElements().add(t);
insert(t);
end
rule "trainTransportCost"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$s : Step(transportType ==Step.train_TransportType)
then
TransportCostElement t = new TransportCostElement();
t.setStep($s);
t.setAmount($c.getPallets().size()*$s.getDistance()*0.5);
$c.getCostElements().add(t);
insert(t);
end
rule "truckTransportCost"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$s : Step(transportType ==Step.truck_TransportType)
then
TransportCostElement t = new TransportCostElement();
t.setStep($s);
t.setAmount($c.getPallets().size()*$s.getDistance()*1.0);
$c.getCostElements().add(t);
insert(t);
end
rule "ShangaiTaxesCost_bulk"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.ShangaiCityName)
$listPallet : ArrayList( )
from collect( Pallet(palletType == Product.transportType_bulkt) )
then
TaxesCostElement t = new TaxesCostElement();
t.setCity($ci);
double totalWeight=0;
for (Object oo : $listPallet){
Pallet pp = (Pallet)oo;
for (Double d : pp.getContentWeight().values()){
totalWeight=totalWeight+d;
}
}
t.setAmount(totalWeight*0.02);
$c.getCostElements().add(t);
insert(t);
end
rule "ShangaiTaxesCost_notbulk"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.ShangaiCityName)
$listPallet : ArrayList( )
from collect( Pallet(palletType != Product.transportType_bulkt) )
then
TaxesCostElement t = new TaxesCostElement();
t.setCity($ci);
double totalWeight=0;
for (Object oo : $listPallet){
Pallet pp = (Pallet)oo;
for (Product p : pp.getContentQuantity().keySet()){
totalWeight=totalWeight+p.getWeight()* pp.getContentQuantity().get(p);
}
}
t.setAmount(totalWeight*0.05);
$c.getCostElements().add(t);
insert(t);
end
rule "RotterdamTaxesCost_bulk_weight"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.RotterdamCityName)
$listPallet : ArrayList( )
from collect( Pallet(palletType == Product.transportType_bulkt) )
then
TaxesCostElement t = new TaxesCostElement();
t.setCity($ci);
double totalWeight=0;
for (Object oo : $listPallet){
Pallet pp = (Pallet)oo;
for (Double d : pp.getContentWeight().values()){
totalWeight=totalWeight+d;
}
}
t.setAmount(totalWeight*0.05);
$c.getCostElements().add(t);
insert(t);
end
rule "RotterdamTaxesCost_notbulk_weight"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.RotterdamCityName)
$listPallet : ArrayList( )
from collect( Pallet(palletType != Product.transportType_bulkt) )
then
TaxesCostElement t = new TaxesCostElement();
t.setCity($ci);
double totalWeight=0;
for (Object oo : $listPallet){
Pallet pp = (Pallet)oo;
for (Product p : pp.getContentQuantity().keySet()){
totalWeight=totalWeight+p.getWeight()* pp.getContentQuantity().get(p);
}
}
t.setAmount(totalWeight*0.05);
$c.getCostElements().add(t);
insert(t);
end
rule "ShangaiHandlingCost"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.ShangaiCityName)
then
int n = $c.getPallets().size();
int nbrePalletPerHour = Math.round( n/12)+1;
int nbrePerson = Math.round( nbrePalletPerHour/13)+1;
HandlingCostElement t = new HandlingCostElement();
t.setCity($ci);
t.setAmount(nbrePerson*12*20.0);
$c.getCostElements().add(t);
insert(t);
end
rule "RotterdamHandlingCostAndPersonTaxes"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.RotterdamCityName)
then
int n = $c.getPallets().size();
int nbrePalletPerHour = Math.round( n/12)+1;
int nbrePerson = Math.round( nbrePalletPerHour/60)+1;
HandlingCostElement t = new HandlingCostElement();
t.setCity($ci);
t.setAmount(nbrePerson*12*45.0);
$c.getCostElements().add(t);
insert(t);
TaxesCostElement t1 = new TaxesCostElement();
t1.setAmount(nbrePerson*1.0);
$c.getCostElements().add(t1);
insert(t1);
end
rule "TournaiHandlingCostAndPersonTaxes"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.TournaiCityName)
then
int n = $c.getPallets().size();
int nbrePalletPerHour = Math.round( n/12)+1;
int nbrePerson = Math.round( nbrePalletPerHour/40)+1;
HandlingCostElement t = new HandlingCostElement();
t.setCity($ci);
t.setAmount(nbrePerson*12*67.0);
$c.getCostElements().add(t);
insert(t);
TaxesCostElement t1 = new TaxesCostElement();
t1.setAmount(nbrePerson*2.0);
$c.getCostElements().add(t1);
insert(t1);
end
rule "LilleHandlingCostAndPersonTaxes"
ruleflow-group "calculate"
when
$c : CostCalculationRequest( )
$ci : City(name==City.LilleCityName)
then
int n = $c.getPallets().size();
int nbrePalletPerHour = Math.round( n/12)+1;
int nbrePerson = Math.round( nbrePalletPerHour/30)+1;
HandlingCostElement t = new HandlingCostElement();
t.setCity($ci);
t.setAmount(nbrePerson*12*79.0);
$c.getCostElements().add(t);
insert(t);
TaxesCostElement t1 = new TaxesCostElement();
t1.setAmount(nbrePerson*30.0);
$c.getCostElements().add(t1);
insert(t1);
end

View file

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<process processType="Private" isExecutable="true" id="P1" name="CalcuateCostProces" tns:packageName="cost.calculation" >
<!-- nodes -->
<startEvent id="_1" isInterrupting="true">
</startEvent>
<endEvent id="_3" >
<terminateEventDefinition />
</endEvent>
<businessRuleTask id="_jbpm-unique-2" name="pallet" g:ruleFlowGroup="distribution" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
</businessRuleTask>
<businessRuleTask id="_jbpm-unique-0" name="Amount " g:ruleFlowGroup="calculate" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
</businessRuleTask>
<businessRuleTask id="_jbpm-unique-1" name="Sum" g:ruleFlowGroup="total" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
</businessRuleTask>
<!-- connections -->
<sequenceFlow id="_jbpm-unique-1-_3" sourceRef="_jbpm-unique-1" targetRef="_3" />
<sequenceFlow id="_1-_jbpm-unique-2" sourceRef="_1" targetRef="_jbpm-unique-2" />
<sequenceFlow id="_jbpm-unique-2-_jbpm-unique-0" sourceRef="_jbpm-unique-2" targetRef="_jbpm-unique-0" />
<sequenceFlow id="_jbpm-unique-0-_jbpm-unique-1" sourceRef="_jbpm-unique-0" targetRef="_jbpm-unique-1" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="P1" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="24" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="433" y="21" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-2" >
<dc:Bounds x="123" y="18" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-0" >
<dc:Bounds x="233" y="20" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-1" >
<dc:Bounds x="337" y="22" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-1-_3" >
<di:waypoint x="377" y="46" />
<di:waypoint x="457" y="45" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_1-_jbpm-unique-2" >
<di:waypoint x="48" y="40" />
<di:waypoint x="163" y="42" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-2-_jbpm-unique-0" >
<di:waypoint x="163" y="42" />
<di:waypoint x="273" y="44" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-0-_jbpm-unique-1" >
<di:waypoint x="273" y="44" />
<di:waypoint x="377" y="46" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View file

@ -0,0 +1,134 @@
package cost.calculation
import cost.OrderLine;
import cost.LeftToDistribute;
import cost.Product;
import cost.Pallet;
import cost.CostCalculationRequest;
import cost.CalculatedElement;
import java.lang.Math;
rule "Create Counter leftToDistribute quantity"
ruleflow-group "distribution"
when
$elt : OrderLine( numberItems >0 )
not (LeftToDistribute(orderLine==$elt))
then
LeftToDistribute e= new LeftToDistribute($elt,$elt.getNumberItems());
insert(e);
end
rule "Create Counter leftToDistribute weight"
ruleflow-group "distribution"
when
$elt : OrderLine( weight >0 )
not (LeftToDistribute(orderLine==$elt))
then
LeftToDistribute e= new LeftToDistribute($elt,$elt.getWeight());
insert(e);
end
rule "Create PalletForIndividual"
ruleflow-group "distribution"
when
$c : CostCalculationRequest()
$p : Product(transportType==Product.transportType_individual)
$elt : OrderLine(product==$p )
$l : LeftToDistribute(quantityLeft> 0,orderLine==$elt)
then
Pallet pp = new Pallet();
pp.setPalletType($p.getTransportType());
pp.addContent($p,new Long(1));
insert(pp);
$c.getPallets().add(pp);
$l.setQuantityLeft($l.getQuantityLeft()-1);
update($l);
end
rule "Create PalletForBulkMore1400Kg"
ruleflow-group "distribution"
when
$c : CostCalculationRequest()
$p : Product(transportType==Product.transportType_bulkt)
$elt : OrderLine(product==$p )
$l : LeftToDistribute(weightLeft > 1400,orderLine==$elt)
then
Pallet pp = new Pallet();
pp.setPalletType($p.getTransportType());
pp.addContent($p,new Long(1400));
insert(pp);
$c.getPallets().add(pp);
$l.setWeightLeft($l.getWeightLeft()-1400);
update($l);
end
rule "Create PalletForBulkless1400Kg"
ruleflow-group "distribution"
when
$c : CostCalculationRequest()
$p : Product(transportType==Product.transportType_bulkt)
$elt : OrderLine(product==$p )
$l : LeftToDistribute(weightLeft <= 1400,weightLeft > 0,orderLine==$elt)
then
Pallet pp = new Pallet();
pp.setPalletType($p.getTransportType());
pp.addContent($p,$l.getWeightLeft());
insert(pp);
$c.getPallets().add(pp);
$l.setWeightLeft(0);
update($l);
end
rule "Create Empty Pallet"
ruleflow-group "distribution"
when
not (Pallet (palletType == Product.transportType_pallet,full ==false))
then
Pallet p = new Pallet();
p.setPalletType(Product.transportType_pallet);
insert (p);
end
rule "Create PalletFortransportType_pallet"
ruleflow-group "distribution"
when
$c : CostCalculationRequest()
$pp : Pallet($hl : heightLeft ,full ==false,palletType == Product.transportType_pallet)
$p : Product(height <= $hl,transportType==Product.transportType_pallet)
$elt : OrderLine(product==$p )
$l : LeftToDistribute(quantityLeft > 0,orderLine==$elt)
then
long a = (long) Math.round($pp.getWidth()/$p.getWidth());
long b = (long) Math.round($pp.getDepth()/$p.getDepth());
long n = Math.min(a*b,$l.getQuantityLeft());
$pp.addContent($p,n);
$pp.setHeightLeft($pp.getHeightLeft()-$p.getHeight());
update($pp);
$l.setQuantityLeft($l.getQuantityLeft()-n);
update($l);
end
rule "FillPalletIfNoProductGoesIn"
ruleflow-group "distribution"
when
CalculatedElement($min : doubleValue ,key=="minValue.product")
$p : Pallet(heightLeft!= 2.0,$hl : heightLeft < $min ,full ==false,palletType == Product.transportType_pallet)
then
$p.setFull(true);
System.out.println("MinValue="+$min);
update($p);
end
rule "GetSmallestHeight"
ruleflow-group "distribution"
when
accumulate( Product( $h : height ,transportType==Product.transportType_pallet );
$min : min( $h );
true )
then
CalculatedElement elt = new CalculatedElement();
elt.setKey("minValue.product");
elt.setDoubleValue((Double)$min);
insert(elt);
end

View file

@ -0,0 +1,72 @@
package cost.calculation
import cost.OrderLine;
import cost.LeftToDistribute;
import cost.Product;
import cost.Pallet;
import cost.CostCalculationRequest;
import cost.CalculatedElement;
import cost.HandlingCostElement;
import cost.TaxesCostElement;
import cost.TransportCostElement;
import cost.Step;
import cost.City;
import java.lang.Math;
rule "CalculateTotal"
ruleflow-group "total"
when
$c : CostCalculationRequest( )
$totalBoatTransport : Number( doubleValue > 100 )
from accumulate( $s : Step(transportType ==Step.Ship_TransportType) &&
TransportCostElement(step ==$s, $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
$totalTrainTransport : Number( doubleValue > 100 )
from accumulate( $s : Step(transportType ==Step.train_TransportType) &&
TransportCostElement(step ==$s, $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
$totalTruckTransport : Number( doubleValue > 100 )
from accumulate( $s : Step(transportType ==Step.truck_TransportType) &&
TransportCostElement(step ==$s, $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
$totalTransport : Number( doubleValue > 100 )
from accumulate( TransportCostElement( $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
$totalTaxes : Number( doubleValue > 100 )
from accumulate( TaxesCostElement( $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
$totalHandling : Number( doubleValue > 100 )
from accumulate( HandlingCostElement( $value : amount ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
then
System.out.println("NumberOfPallets="+$c.getPallets().size());
System.out.println("TotalShipTransport="+$totalBoatTransport);
System.out.println("TotalTrainTransport="+$totalTrainTransport);
System.out.println("TotalTruckTransport="+$totalTruckTransport);
System.out.println("TotalTransport="+$totalTransport);
System.out.println("TotalTaxes="+$totalTaxes);
System.out.println("TotalHandling="+$totalHandling);
end;

View file

@ -0,0 +1,96 @@
package calculation;
import cost.*;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.StatelessKieSession;
import util.KnowledgeSessionHelper;
@SuppressWarnings("restriction")
public class TestExecercice {
static KieContainer kieContainer;
StatelessKieSession sessionStateless = null;
KieSession sessionStatefull = null;
@BeforeClass
public static void beforeClass() {
kieContainer = KnowledgeSessionHelper.createRuleBase();
}
@Before
public void setUp() throws Exception {
System.out.println("------------Before------------");
}
@After
public void tearDown() throws Exception {
System.out.println("------------After------------");
}
private void insertIntoSession(KieSession sessionStatefull, CostCalculationRequest request) {
sessionStatefull.insert(request);
if (request.getOrder() != null) {
sessionStatefull.insert(request.getOrder());
for (OrderLine orderLine : request.getOrder().getOrderLines()) {
sessionStatefull.insert(orderLine);
sessionStatefull.insert(orderLine.getProduct());
}
}
if (request.getTrip() != null) {
sessionStatefull.insert(request.getTrip());
for (Step step : request.getTrip().getSteps()) {
sessionStatefull.insert(step);
sessionStatefull.insert(step.getStepStart());
sessionStatefull.insert(step.getStepEnd());
}
}
}
@Test
public void testFirstOne() {
sessionStatefull = KnowledgeSessionHelper.getStatefulKnowledgeSessionForJBPM(kieContainer, "ksession-rules");
City cityOfShangai = new City(City.ShangaiCityName);
City cityOfRotterdam = new City(City.RotterdamCityName);
City cityOfTournai = new City(City.TournaiCityName);
City cityOfLille = new City(City.LilleCityName);
Step step1 = new Step(cityOfShangai, cityOfRotterdam, 22000, Step.Ship_TransportType);
Step step2 = new Step(cityOfRotterdam, cityOfTournai, 300, Step.train_TransportType);
Step step3 = new Step(cityOfTournai, cityOfLille, 20, Step.truck_TransportType);
Trip myTrip = new Trip("trip1");
myTrip.getSteps().add(step1);
myTrip.getSteps().add(step2);
myTrip.getSteps().add(step3);
CostCalculationRequest request = new CostCalculationRequest();
request.setTrip(myTrip);
Product drillProduct = new Product("Drill", 0.2, 0.4, 0.3, 2, Product.transportType_pallet);
Product screwDriverProduct = new Product("Screwdriver", 0.03, 0.02, 0.2, 0.2, Product.transportType_pallet);
Product sandProduct = new Product("Sand", 0.0, 0.0, 0.0, 0.0, Product.transportType_bulkt);
Product gravelProduct = new Product("Gravel", 0.0, 0.0, 0.0, 0.0, Product.transportType_bulkt);
Product furnitureProduct = new Product("Furniture", 0.0, 0.0, 0.0, 0.0, Product.transportType_individual);
Order myOrder = new Order("1");
myOrder.getOrderLines().add(new OrderLine(1000, drillProduct));
myOrder.getOrderLines().add(new OrderLine(1000, screwDriverProduct));
myOrder.getOrderLines().add(new OrderLine(35000.0, sandProduct));
myOrder.getOrderLines().add(new OrderLine(14000.0, gravelProduct));
myOrder.getOrderLines().add(new OrderLine(500, furnitureProduct));
request.setOrder(myOrder);
long before = System.currentTimeMillis();
this.insertIntoSession(sessionStatefull, request);
sessionStatefull.startProcess("P1");
int i = sessionStatefull.fireAllRules();
long after = System.currentTimeMillis();
System.out.println("NumberRules Executed " + i);
System.out.println("Rules executed in " + (after - before) + " ms");
Double dd = new Double(i) / (after - before) * 1000;
System.out.println("NbreRules/seconde=" + dd);
}
}

View file

@ -1,2 +0,0 @@
/target
/.idea

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="?*.properties" />
<entry name="?*.xml" />
<entry name="?*.gif" />
<entry name="?*.png" />
<entry name="?*.jpeg" />
<entry name="?*.jpg" />
<entry name="?*.html" />
<entry name="?*.dtd" />
<entry name="?*.tld" />
<entry name="?*.ftl" />
</wildcardResourcePatterns>
<annotationProcessing enabled="false" useClasspath="true" />
</component>
</project>

View file

@ -1,5 +0,0 @@
<component name="CopyrightManager">
<settings default="">
<module2copyright />
</settings>
</component>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View file

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsStructureConfigurable.UI">
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
<settings />
</component>
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="FacetStructureConfigurable.UI">
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
</component>
<component name="GlobalLibrariesConfigurable.UI">
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
</component>
<component name="IdProvider" IDEtalkID="ACBF8106F24FCCF9F09445427263241A" />
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="ModuleStructureConfigurable.UI">
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
</component>
<component name="ProjectLibrariesConfigurable.UI">
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
</project>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/../AccountProject/AccountProject.iml" filepath="$PROJECT_DIR$/../AccountProject/AccountProject.iml" />
<module fileurl="file://$PROJECT_DIR$/demodrools.iml" filepath="$PROJECT_DIR$/demodrools.iml" />
</modules>
</component>
</project>

View file

@ -1,125 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
</component>
</project>

View file

@ -1,670 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CCaseConfig">
<option name="checkoutReserved" value="false" />
<option name="markExternalChangeAsUpToDate" value="true" />
<option name="checkInUseHijack" value="true" />
<option name="useUcmModel" value="true" />
<option name="synchOutside" value="false" />
<option name="isHistoryResticted" value="true" />
<option name="useIdenticalSwitch" value="true" />
<option name="synchActivitiesOnRefresh" value="true" />
<option name="lastScr" value="" />
<option name="scrTextFileName" value="" />
<option name="historyRevisionsNumber" value="4" />
</component>
<component name="ChangeListManager">
<list default="true" readonly="true" id="73ef924e-9b62-4b42-a083-49699e61920c" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/demo/TicketLine.java" afterPath="$PROJECT_DIR$/src/main/java/demo/TicketLine.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/service/TickerService.java" afterPath="$PROJECT_DIR$/src/main/java/service/TickerService.java" />
</list>
<ignored path="demodrools.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
<option name="REVERSE_PATCH" value="false" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="FavoritesManager">
<favorites_list name="demodrools" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="JAVA/demo" pinned="false" current="false" current-in-tab="false">
<entry file="uml://JAVA/demo">
<provider selected="true" editor-type-id="UmlEditorProvider">
<state>
<ID>JAVA</ID>
<OriginalElement>demo</OriginalElement>
<nodes>
<node x="-455.0" y="-198.0">demo.TicketLine</node>
<node x="554.0" y="45.0">demo.Gender</node>
<node x="-465.0" y="72.0">demo.Product</node>
<node x="379.0" y="242.0">demo.Card</node>
<node x="-86.0" y="280.0">demo.Price</node>
<node x="-420.0" y="338.0">demo.Provider</node>
<node x="-273.0" y="416.0">demo.Currency</node>
<node x="161.0" y="-232.0">demo.Customer</node>
<node x="-144.0" y="-157.0">demo.Ticket</node>
</nodes>
<notes />
<edges />
<settings isCamel="false" isColorManagerEnabled="true" isShowDependencies="false" isVcsFilterEnabled="false" layout="Hierarchic Group" zoom="1.0" x="-317.0" y="-52.5" />
<SelectedNodes>
<node>demo.Currency</node>
</SelectedNodes>
<Categories>
<Category>Fields</Category>
</Categories>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JAVA/droolscours" pinned="false" current="true" current-in-tab="true">
<entry file="uml://JAVA/droolscours">
<provider selected="true" editor-type-id="UmlEditorProvider">
<state>
<ID>JAVA</ID>
<OriginalElement>droolscours</OriginalElement>
<nodes>
<node x="187.0" y="0.0">droolscours.Account</node>
<node x="0.0" y="158.0">droolscours.AccountingPeriod</node>
<node x="0.0" y="0.0">droolscours.CashFlow</node>
</nodes>
<notes />
<edges />
<settings isCamel="false" isColorManagerEnabled="true" isShowDependencies="false" isVcsFilterEnabled="false" layout="Hierarchic Group" zoom="1.0" x="71.5" y="88.5" />
<SelectedNodes />
<Categories>
<Category>Fields</Category>
</Categories>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="MavenRunner">
<option name="jreName" value="#JAVA_INTERNAL" />
</component>
<component name="ModuleEditorState">
<option name="LAST_EDITED_MODULE_NAME" />
<option name="LAST_EDITED_TAB_NAME" />
</component>
<component name="ProjectLevelVcsManager">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<OptionsSetting value="true" id="Undo Check Out" />
<OptionsSetting value="true" id="Get Latest Version" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Favorites" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="demodrools" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="demodrools" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="AccountProject" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="demodrools" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="AccountProject" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="demodrools" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="AccountProject" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="droolscours" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="demodrools" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="AccountProject" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="project.structure.proportion" value="0.0" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
</component>
<component name="RunManager">
<configuration default="true" type="PhpRunConfigurationType" factoryName="PHP">
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="FtpUpload" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
<option name="ValidateXdebugSetup" enabled="true" />
</method>
</configuration>
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
<option name="ValidateXdebugSetup" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" adl_options="" air_descriptor_path="" air_program_params="" air_publisher_id="" air_root_dir_path="" air_run_mode="AppDescriptor" browser_family="FIREFOX" class_name="" debugger_sdk="Module SDK" html_or_swf_file_path="" launcher_type="OSDefault" main_class_name="" method_name="" module_name="" output_log_level="" package_name="" player_path="/usr/bin/flashplayer" port="0" run_mode="HtmlOrSwfFile" run_trusted="false" scope="Class" socket_policy_port="0" url_to_launch="http://">
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" />
<extension name="snapshooter" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" />
<extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server">
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="FtpUpload" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
<option name="ValidateXdebugSetup" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" />
<extension name="snapshooter" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="0" />
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
<option name="PORT" value="49201" />
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="PROJECT" value="" />
<option name="VIEW" value="" />
<option name="ALTERNATIVE_WORKING_PATH" value="" />
<option name="LOCK_ON_CHECKOUT" value="false" />
<option name="UNLOCK_ON_CHECKIN" value="false" />
</component>
<component name="SvnConfiguration" maxAnnotateRevisions="500">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="LAST_MERGED_REVISION" />
<option name="UPDATE_RUN_STATUS" value="false" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="true" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<configuration useDefault="true">$USER_HOME$/.subversion_IDEA</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="SvnFileUrlMappingImpl">
<option name="myMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="$PROJECT_DIR$" />
<option name="myCopyRoot" value="$PROJECT_DIR$" />
</SvnCopyRootSimple>
</list>
</option>
<option name="myMoreRealMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="$PROJECT_DIR$" />
<option name="myCopyRoot" value="$PROJECT_DIR$" />
</SvnCopyRootSimple>
</list>
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="73ef924e-9b62-4b42-a083-49699e61920c" name="Default" comment="" />
<created>1286719839048</created>
<updated>1286719839048</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-4" y="1" width="1928" height="1083" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24959914" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/main/java/demo/TicketLine.java">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="13" selection-start="28" selection-end="28" vertical-scroll-proportion="0.033259425" />
</provider>
</entry>
<entry file="uml://JAVA/demo">
<provider selected="true" editor-type-id="UmlEditorProvider">
<state>
<ID>JAVA</ID>
<OriginalElement>demo</OriginalElement>
<nodes>
<node x="-455.0" y="-198.0">demo.TicketLine</node>
<node x="554.0" y="45.0">demo.Gender</node>
<node x="-465.0" y="72.0">demo.Product</node>
<node x="379.0" y="242.0">demo.Card</node>
<node x="-86.0" y="280.0">demo.Price</node>
<node x="-420.0" y="338.0">demo.Provider</node>
<node x="-273.0" y="416.0">demo.Currency</node>
<node x="161.0" y="-232.0">demo.Customer</node>
<node x="-144.0" y="-157.0">demo.Ticket</node>
</nodes>
<notes />
<edges />
<settings isCamel="false" isColorManagerEnabled="true" isShowDependencies="false" isVcsFilterEnabled="false" layout="Hierarchic Group" zoom="1.0" x="-317.0" y="-52.5" />
<SelectedNodes>
<node>demo.Currency</node>
</SelectedNodes>
<Categories>
<Category>Fields</Category>
</Categories>
</state>
</provider>
</entry>
<entry file="uml://JAVA/droolscours">
<provider selected="true" editor-type-id="UmlEditorProvider">
<state>
<ID>JAVA</ID>
<OriginalElement>droolscours</OriginalElement>
<nodes>
<node x="187.0" y="0.0">droolscours.Account</node>
<node x="0.0" y="158.0">droolscours.AccountingPeriod</node>
<node x="0.0" y="0.0">droolscours.CashFlow</node>
</nodes>
<notes />
<edges />
<settings isCamel="false" isColorManagerEnabled="true" isShowDependencies="false" isVcsFilterEnabled="false" layout="Hierarchic Group" zoom="1.0" x="71.5" y="88.5" />
<SelectedNodes />
<Categories>
<Category>Fields</Category>
</Categories>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>Android</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.6</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>demodrools</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.5" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.5" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
</component>
</module>

View file

@ -1,44 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pymma-software.droolscourse</groupId>
<artifactId>droolscourse</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>demodrools</artifactId>
<name>demodrools</name>
<description>demodrools</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
</dependencies>
</project>

View file

@ -1,59 +0,0 @@
package demo;
public class Card {
private String number;
private String name;
private Customer customer;
public void setNumber(String number) {
this.number = number;
}
public void setName(String name) {
this.name = name;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public void setCartType(String cartType) {
this.cartType = cartType;
}
private String cartType;
public Card(String number, String cartName, String cartType,
String customerID, String name, String surname, String maritalName,
Gender gender) {
this.number = number;
this.name = cartName;
this.cartType = cartType;
this.customer = new Customer(customerID, name, surname, maritalName,
gender, null);
}
public String getName() {
return name;
}
public String getCartType() {
return cartType;
}
public String getNumber() {
return number;
}
public Customer getCustomer() {
return customer;
}
public Card() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,5 +0,0 @@
package demo;
public enum Currency {
Euro, Dollar, Yen
}

View file

@ -1,77 +0,0 @@
package demo;
import java.util.Date;
public class Customer {
private String customerID;
private String surName;
private String name;
private String maritalName;
private Gender gender;
private Date birthDate;
public String getCustomerID() {
return customerID;
}
public void setCustomerID(String customerID) {
this.customerID = customerID;
}
public String getSurName() {
return surName;
}
public void setSurName(String surName) {
this.surName = surName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMaritalName() {
return maritalName;
}
public void setMaritalName(String maritalName) {
this.maritalName = maritalName;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Customer(String customerID, String surName, String name,
String maritalName, Gender gender, Date birthDate) {
super();
this.customerID = customerID;
this.surName = surName;
this.name = name;
this.maritalName = maritalName;
this.gender = gender;
this.birthDate = birthDate;
}
public Customer() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,5 +0,0 @@
package demo;
public enum Gender {
Mr,Mrs,Miss
}

View file

@ -1,35 +0,0 @@
package demo;
public class Price {
private Float price;
private Currency currency;
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public Currency getCurrency() {
return currency;
}
public void setCurrency(Currency currency) {
this.currency = currency;
}
public Price(Float price, Currency currency) {
super();
this.price = price;
this.currency = currency;
}
public Price() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,84 +0,0 @@
package demo;
import org.joda.time.DateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class Product {
private String Id;
private String Name;
private Map<Date, Map<Currency, Price>> prices = new HashMap<Date, Map<Currency, Price>>();
private Provider provider;
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public Provider getProvider() {
return provider;
}
public void setProvider(Provider provider) {
this.provider = provider;
}
public Product(String id, String name, Provider provider) {
super();
Id = id;
Name = name;
this.provider = provider;
}
public void setPrice(Date startTime, Float price, Currency currency) {
if (prices.containsKey(startTime) == false) {
Price newprice = new Price(price, currency);
Map<Currency, Price> priceMap = new HashMap<Currency, Price>();
priceMap.put(currency, newprice);
prices.put(startTime, priceMap);
} else {
Map<Currency, Price> priceMap = prices.get(startTime);
if (priceMap.containsKey(currency) == false) {
Price aNewPrice = new Price(price, currency);
priceMap.put(currency, aNewPrice);
} else {
Price aExistingPrice = priceMap.get(currency);
aExistingPrice.setPrice(price);
}
}
}
public void delPrice(DateTime startTime) {
if (prices.containsKey(startTime) == true) {
prices.remove(startTime);
}
}
public Product() {
super();
// TODO Auto-generated constructor stub
}
public Map<Date, Map<Currency, Price>> getPrices() {
return prices;
}
public void setPrices(Map<Date, Map<Currency, Price>> prices) {
this.prices = prices;
}
}

View file

@ -1,34 +0,0 @@
package demo;
public class Provider {
private String name;
private String country;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public Provider(String name, String country) {
super();
this.name = name;
this.country = country;
}
public Provider() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,85 +0,0 @@
package demo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Ticket {
private String Id;
private Date date;
private Float amount;
private Card loyaltyCard;
private Customer customer;
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Card getLoyaltyCard() {
return loyaltyCard;
}
public void setLoyaltyCard(Card loyaltyCard) {
this.loyaltyCard = loyaltyCard;
}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
private List<TicketLine> ticketLines = new ArrayList<TicketLine>();
public long AddLine(Product product, Float price, long quantity) {
TicketLine newLine = new TicketLine(this, product, quantity, price);
ticketLines.add(newLine);
this.amount = this.amount + newLine.getLineTotal();
return newLine.getLineNumber();
}
public void delLine(int lineNumber) {
if (lineNumber <= this.ticketLines.size()) {
TicketLine lineToDel = this.ticketLines.get(lineNumber);
lineToDel.setValid(false);
this.amount = this.amount-lineToDel.getLineTotal();
}
}
public Ticket() {
super();
// TODO Auto-generated constructor stub
}
public Float getAmount() {
return amount;
}
public void setAmount(Float amount) {
this.amount = amount;
}
public List<TicketLine> getTicketLines() {
return ticketLines;
}
public void setTicketLines(List<TicketLine> ticketLines) {
this.ticketLines = ticketLines;
}
}

View file

@ -1,97 +0,0 @@
package demo;
public class TicketLine {
private static int numberLines = 0;
private Ticket ticket;
private int lineNumber;
private Product product;
private long quantity;
private Float price = null;
private Float lineTotal;;
private boolean valid;
public int getLineNumber() {
return lineNumber;
}
public Float getLineTotal() {
return lineTotal;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
public Ticket getTicket() {
return ticket;
}
public void setTicket(Ticket ticket) {
this.ticket = ticket;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public long getQuantity() {
return quantity;
}
public TicketLine(Ticket ticket, Product product, long quantity, Float price) {
super();
numberLines = numberLines + 1;
this.lineNumber = numberLines;
this.ticket = ticket;
this.product = product;
this.quantity = quantity;
this.price = price;
this.lineTotal = price * quantity;
}
public void setQuantity(long quantity) {
this.quantity = quantity;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public TicketLine() {
super();
// TODO Auto-generated constructor stub
}
public static int getNumberLines() {
return numberLines;
}
public static void setNumberLines(int numberLines) {
TicketLine.numberLines = numberLines;
}
public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}
public void setLineTotal(Float lineTotal) {
this.lineTotal = lineTotal;
}
public void AddProductToTicketLine(Product p){
this.product = p;
}
}

View file

@ -1,40 +0,0 @@
package service;
import java.util.List;
import demo.Product;
import demo.Ticket;
import demo.TicketLine;
public class TickerService {
public void CalculateAmountTicket(Ticket ticket) {
if (ticket != null) {
Float total = new Float(0.0);
for (TicketLine line : ticket.getTicketLines()) {
total = total + line.getQuantity() * line.getPrice();
}
ticket.setAmount(total);
}
}
public void CalculateTicketLineAmount(TicketLine line) {
if (line != null) {
Float total = new Float(0.0);
total = line.getQuantity() * line.getPrice();
line.setLineTotal(total);
}
}
public void CalculateTicketLinesAmount(List<TicketLine> lines) {
if (lines != null) {
Float total = new Float(0.0);
for (TicketLine aLine : lines) {
total = aLine.getQuantity() * aLine.getPrice();
aLine.setLineTotal(total);
}
}
}
public void addProductTicket(Product p, TicketLine t){
t.setProduct(p);
}
}

View file

@ -1,20 +0,0 @@
package util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateHelper {
public static String sFormat = "yyyy-MM-dd";
public static Date getDate(String sDate) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
return sdf.parse(sDate);
}
public static Date getDate(String sDate, String anotherFormat)
throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(anotherFormat);
return sdf.parse(sDate);
}
}

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>droolscourse</artifactId>
<groupId>com.pymma-software.droolscourse</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>droolscourse-service</artifactId>
<dependencies>
<dependency>
<groupId>org.chtijbug.drools</groupId>
<artifactId>drools-framework-runtime-base</artifactId>
</dependency>
<dependency>
<groupId>org.chtijbug.drools</groupId>
<artifactId>drools-framework-runtime-entity</artifactId>
</dependency>
</dependencies>
</project>

View file

@ -1,55 +0,0 @@
package loyalty;
import loyalty.domains.Ticket;
import org.chtijbug.drools.runtime.DroolsChtijbugException;
import org.chtijbug.drools.runtime.RuleBaseBuilder;
import org.chtijbug.drools.runtime.RuleBasePackage;
import org.chtijbug.drools.runtime.RuleBaseSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.CoursHistoryContainer;
public class DroolsServiceCalculate implements IDroolsServiceCalculate {
/*
* (non-Javadoc)
*
* @see
* IDroolsServiceCalculate#calculate(droolscours.loyalty.domains
* .Ticket)
*/
/**
* Class Logger
*/
private static Logger logger = LoggerFactory.getLogger(DroolsServiceCalculate.class);
private RuleBasePackage ruleBasePackage = null;
@Override
public Ticket calculate( Ticket ticket) {
if (ruleBasePackage == null) {
try {
CoursHistoryContainer coursHistoryContainer = new CoursHistoryContainer();
ruleBasePackage= RuleBaseBuilder.createPackageBasePackageWithListener(coursHistoryContainer, "File1.drl");
//ruleBasePackage= RuleBaseBuilder.createGuvnorRuleBasePackageWithListener(coursHistoryContainer,"http://localhost:8080", "drools-guvnor", "mypackage","1.27.0-PROD",
// "admin", "admin");
} catch (DroolsChtijbugException e) {
logger.error("Could not create RuleBase", e);
}
}
RuleBaseSession sessionStatefull = null;
try {
sessionStatefull = ruleBasePackage.createRuleBaseSession();
sessionStatefull.insertByReflection(ticket);
sessionStatefull.fireAllRules();
// System.out.println(sessionStatefull.getHistoryContainer().getListHistoryEvent().toString());
} catch (DroolsChtijbugException e) {
logger.error("Error in fireallrules", e);
}
return ticket;
}
}

View file

@ -1,11 +0,0 @@
package loyalty;
import loyalty.domains.Ticket;
public interface IDroolsServiceCalculate {
public abstract Ticket calculate( Ticket ticket);
}

View file

@ -1,59 +0,0 @@
package loyalty.domains;
public class Card {
private String number;
private String name;
private Customer customer;
public void setNumber(String number) {
this.number = number;
}
public void setName(String name) {
this.name = name;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public void setCartType(String cartType) {
this.cartType = cartType;
}
private String cartType;
public Card(String number, String cartName, String cartType,
String customerID, String name, String surname, String maritalName,
Gender gender) {
this.number = number;
this.name = cartName;
this.cartType = cartType;
this.customer = new Customer(customerID, name, surname, maritalName,
gender, null);
}
public String getName() {
return name;
}
public String getCartType() {
return cartType;
}
public String getNumber() {
return number;
}
public Customer getCustomer() {
return customer;
}
public Card() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,5 +0,0 @@
package loyalty.domains;
public enum Currency {
Euro, Dollar, Yen
}

View file

@ -1,77 +0,0 @@
package loyalty.domains;
import java.util.Date;
public class Customer {
private String customerID;
private String surName;
private String name;
private String maritalName;
private Gender gender;
private Date birthDate;
public String getCustomerID() {
return customerID;
}
public void setCustomerID(String customerID) {
this.customerID = customerID;
}
public String getSurName() {
return surName;
}
public void setSurName(String surName) {
this.surName = surName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMaritalName() {
return maritalName;
}
public void setMaritalName(String maritalName) {
this.maritalName = maritalName;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Customer(String customerID, String surName, String name,
String maritalName, Gender gender, Date birthDate) {
super();
this.customerID = customerID;
this.surName = surName;
this.name = name;
this.maritalName = maritalName;
this.gender = gender;
this.birthDate = birthDate;
}
public Customer() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,5 +0,0 @@
package loyalty.domains;
public enum Gender {
Mr,Mrs,Miss
}

View file

@ -1,23 +0,0 @@
package loyalty.domains;
public class Ligneop {
private String nomOP;
private Float montantReduction;
public String getNomOP() {
return nomOP;
}
public void setNomOP(String nomOP) {
this.nomOP = nomOP;
}
public Float getMontantReduction() {
return montantReduction;
}
public void setMontantReduction(Float montantReduction) {
this.montantReduction = montantReduction;
}
public Ligneop() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,35 +0,0 @@
package loyalty.domains;
public class Price {
private Float price;
private Currency currency;
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public Currency getCurrency() {
return currency;
}
public void setCurrency(Currency currency) {
this.currency = currency;
}
public Price(Float price, Currency currency) {
super();
this.price = price;
this.currency = currency;
}
public Price() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,55 +0,0 @@
package loyalty.domains;
public class Product {
private String Id;
private String Name;
private Price price;
public Price getPrice() {
return price;
}
public void setPrice(Price price) {
this.price = price;
}
private Provider provider;
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public Provider getProvider() {
return provider;
}
public void setProvider(Provider provider) {
this.provider = provider;
}
public Product(String id, String name, Provider provider) {
super();
Id = id;
Name = name;
this.provider = provider;
}
public Product() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,34 +0,0 @@
package loyalty.domains;
public class Provider {
private String name;
private String country;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public Provider(String name, String country) {
super();
this.name = name;
this.country = country;
}
public Provider() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,85 +0,0 @@
package loyalty.domains;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Ticket {
private String Id;
private Date dateTicket;
private Float amount;
private Card loyaltyCard;
private Customer customer;
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Card getLoyaltyCard() {
return loyaltyCard;
}
public void setLoyaltyCard(Card loyaltyCard) {
this.loyaltyCard = loyaltyCard;
}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public Date getDateTicket() {
return dateTicket;
}
public void setDateTicket(Date date) {
this.dateTicket = date;
}
private List<TicketLine> ticketLines = new ArrayList<TicketLine>();
public long AddLine(Product product, Float price, long quantity) {
TicketLine newLine = new TicketLine(this, product, quantity, price);
ticketLines.add(newLine);
this.amount = this.amount + newLine.getLineTotal();
return newLine.getLineNumber();
}
public void delLine(int lineNumber) {
if (lineNumber <= this.ticketLines.size()) {
TicketLine lineToDel = this.ticketLines.get(lineNumber);
lineToDel.setValid(false);
this.amount = this.amount-lineToDel.getLineTotal();
}
}
public Ticket() {
super();
// TODO Auto-generated constructor stub
}
public Float getAmount() {
return amount;
}
public void setAmount(Float amount) {
this.amount = amount;
}
public List<TicketLine> getTicketLines() {
return ticketLines;
}
public void setTicketLines(List<TicketLine> ticketLines) {
this.ticketLines = ticketLines;
}
}

View file

@ -1,121 +0,0 @@
package loyalty.domains;
public class TicketLine {
private static int numberLines = 0;
private String ticketID;
private Ticket ticket;
private int lineNumber;
private String productID;
private Product product;
private long quantity;
private Float price = null;
private Float lineTotal;;
private Ligneop op;
public Ligneop getOp() {
return op;
}
public String getProductID() {
return productID;
}
public void setProductID(String productID) {
this.productID = productID;
}
public String getTicketID() {
return this.ticketID;
}
public void setTicketID(String ticketID) {
this.ticketID = ticketID;
}
public void setOp(Ligneop op) {
this.op = op;
}
private boolean valid;
public int getLineNumber() {
return lineNumber;
}
public Float getLineTotal() {
return lineTotal;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
public Ticket getTicket() {
return ticket;
}
public void setTicket(Ticket ticket) {
this.ticket = ticket;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public long getQuantity() {
return quantity;
}
public TicketLine(Ticket ticket, Product product, long quantity, Float price) {
super();
numberLines = numberLines + 1;
this.lineNumber = numberLines;
this.ticket = ticket;
this.product = product;
this.quantity = quantity;
this.price = price;
this.lineTotal = price * quantity;
}
public void setQuantity(long quantity) {
this.quantity = quantity;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public TicketLine() {
super();
// TODO Auto-generated constructor stub
}
public static int getNumberLines() {
return numberLines;
}
public static void setNumberLines(int numberLines) {
TicketLine.numberLines = numberLines;
}
public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}
public void setLineTotal(Float lineTotal) {
this.lineTotal = lineTotal;
}
public void AddProductToTicketLine(Product p){
this.product = p;
}
}

View file

@ -1,26 +0,0 @@
package util;
import org.chtijbug.drools.entity.history.HistoryEvent;
import org.chtijbug.drools.runtime.DroolsChtijbugException;
import org.chtijbug.drools.runtime.listener.HistoryListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by IntelliJ IDEA.
* Date: 14/02/14
* Time: 11:47
* To change this template use File | Settings | File Templates.
*/
public class CoursHistoryContainer implements HistoryListener {
/**
* Class Logger
*/
private static Logger logger = LoggerFactory.getLogger(CoursHistoryContainer.class);
@Override
public void fireEvent(HistoryEvent historyEvent) throws DroolsChtijbugException {
logger.info(historyEvent.toString());
}
}

View file

@ -1,20 +0,0 @@
package util;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateHelper {
public static String sFormat = "yyyy-MM-dd";
public static Date getDate(String sDate) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
return sdf.parse(sDate);
}
public static Date getDate(String sDate, String anotherFormat)
throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(anotherFormat);
return sdf.parse(sDate);
}
}

View file

@ -1,30 +0,0 @@
package util;
import loyalty.DroolsServiceCalculate;
import loyalty.domains.Product;
import loyalty.domains.Ticket;
import loyalty.domains.TicketLine;
/**
* Created by IntelliJ IDEA.
* Date: 14/02/14
* Time: 13:12
* To change this template use File | Settings | File Templates.
*/
public class Main {
public static void main(String args[]) throws Exception{
DroolsServiceCalculate droolsServiceCalculate = new DroolsServiceCalculate();
Ticket ticket = new Ticket();
ticket.setDateTicket(DateHelper.getDate("2012-01-01"));
TicketLine ticketLine = new TicketLine();
ticket.getTicketLines().add(ticketLine);
ticketLine.setLineTotal(new Float("2.0"));
Product product = new Product();
product.setName("pampers");
ticketLine.setProduct(product);
droolsServiceCalculate.calculate(ticket);
}
}

View file

@ -1,34 +0,0 @@
package util;
import java.util.Date;
public class MyDate {
private String uneOp;
private Date uneDate1;
private Date uneDate2;
public String getUneOp() {
return uneOp;
}
public void setUneOp(String uneOp) {
this.uneOp = uneOp;
}
public Date getUneDate1() {
return uneDate1;
}
public void setUneDate1(Date uneDate1) {
this.uneDate1 = uneDate1;
}
public Date getUneDate2() {
return uneDate2;
}
public void setUneDate2(Date uneDate2) {
this.uneDate2 = uneDate2;
}
public MyDate() {
super();
// TODO Auto-generated constructor stub
}
}

View file

@ -1,35 +0,0 @@
//#created on: 21 nov. 2010
package loyalty
import util.MyDate;
import loyalty.domains.Ticket;
import loyalty.domains.TicketLine;
import loyalty.domains.Ligneop;
import loyalty.domains.Product
import util.DateHelper;
dialect "mvel"
rule "createdateOpPampers"
when
then
MyDate t = new MyDate();
t.setUneDate1(DateHelper.getDate("2010-12-01"));
t.setUneDate2(DateHelper.getDate("2014-12-31"));
t.setUneOp("pampers");
insert(t);
end
rule "opPameprs"
when
MyDate(uneOp=="pampers",$d1:uneDate1,$d2:uneDate2)
$p : Product( name=="pampers")
$l : TicketLine(product==$p)
$t : Ticket(ticketLines contains $l,dateTicket >= $d1 && dateTicket <= $d2)
then
$l.setOp(new Ligneop());
$l.getOp().setMontantReduction(new Float($l.getLineTotal()*0.2));
$l.getOp().setNomOP("opPameprs");
end

View file

@ -11,12 +11,8 @@
<modules> <modules>
<module>AccountProject</module> <module>AccountProject</module>
<!-- <module>cost-calculation</module>
<module>demodrools</module>
<module>simpleWebApp</module>
<module>droolscourse-service</module>
<module>drools-lesson1</module>
-->
</modules> </modules>
<properties> <properties>

View file

@ -1,2 +0,0 @@
/target
/.idea

View file

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pymma-software.droolscourse</groupId>
<artifactId>droolscourse</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>simpleWebApp</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Calculation Service WebApp</name>
<url>http://www.springframework.org/spring-ws</url>
<packaging>war</packaging>
<build>
<finalName>simpleWebApp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>droolscourse-service</artifactId>
<groupId>com.pymma-software.droolscourse</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Apache CXF dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
</dependency>
<!-- Spring Dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View file

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration>
<fileset id="fileset" name="Spring Application Context" removed="false">
<file>file://$MODULE_DIR$/src/main/resources/application-context.xml</file>
</fileset>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="droolscourse-service" />
<orderEntry type="module" module-name="drools-framework-runtime-base" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: org.kie:kie-api:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.drools:drools-compiler:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.5" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jdt.core.compiler:ecj:3.5.1" level="project" />
<orderEntry type="library" name="Maven: org.mvel:mvel2:2.2.8.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-bpmn2:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow-builder:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.1" level="project" />
<orderEntry type="module" module-name="drools-framework-common" />
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.7" level="project" />
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
<orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
<orderEntry type="library" name="Maven: org.drools:drools-core:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" />
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
<orderEntry type="library" name="Maven: org.kie:kie-internal:6.4.0.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
<orderEntry type="module" module-name="drools-framework-runtime-entity" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.4.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.4.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:2.2.6" level="project" />
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jaxws_2.1_spec:1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.0.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:1.1.2" level="project" />
<orderEntry type="library" name="Maven: asm:asm:2.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-api:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-common-utilities:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1" level="project" />
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.ws.commons.schema:XmlSchema:1.4.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-annotation_1.0_spec:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:wstx-asl:3.2.9" level="project" />
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:2.0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-common-schemas:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-core:2.2.6" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.1.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-tools-common:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:2.2.6" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:2.2.6" level="project" />
<orderEntry type="library" name="Maven: javax.xml.soap:saaj-api:1.3" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.messaging.saaj:saaj-impl:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:2.2.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-asm:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:3.0.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.5" level="project" />
</component>
</module>

View file

@ -1,14 +0,0 @@
package loyalty.service;
import loyalty.domains.Ticket;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public interface IServiceCalculate {
@WebMethod(operationName = "calculate")
public abstract Ticket calculate(Ticket ticket);
}

View file

@ -1,41 +0,0 @@
package loyalty.service;
import loyalty.DroolsServiceCalculate;
import loyalty.domains.Ticket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(endpointInterface = "loyalty.service.IServiceCalculate")
public class ServiceCalculate implements IServiceCalculate {
/*
* (non-Javadoc)
*
* @see
* IDroolsServiceCalculate#calculate(droolscours.loyalty.domains
* .Ticket)
*/
/**
* Class Logger
*/
private static Logger logger = LoggerFactory.getLogger(DroolsServiceCalculate.class);
private DroolsServiceCalculate droolsServiceCalculate;
public void setDroolsServiceCalculate(DroolsServiceCalculate droolsServiceCalculate) {
this.droolsServiceCalculate = droolsServiceCalculate;
}
@Override
public Ticket calculate(@WebParam(name = "ticket") Ticket ticket) {
droolsServiceCalculate.calculate(ticket);
return ticket;
}
}

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<!-- Spring manage ServiceBean -->
<bean id="aDroolsCalculateService" class="loyalty.DroolsServiceCalculate"/>
<bean id="calculateService" class="loyalty.service.ServiceCalculate">
<property name="droolsServiceCalculate" ref="aDroolsCalculateService"/>
</bean>
<!-- JAX-WS Service Endpoint -->
<jaxws:endpoint id="personService" implementor="#calculateService" address="/calculateService"/>
</beans>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>CXF Example Webservice</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application-context.xml</param-value>
</context-param>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>