Search in sources :

Example 1 with ActivityType

use of org.drools.examples.templates.ActivityType in project drools by kiegroup.

the class DataDrivenTemplateExample method testCompiler.

public void testCompiler() {
    ArrayList<FeeScheduleRule> rules = new ArrayList<FeeScheduleRule>();
    FeeScheduleType standard = new FeeScheduleType("STANDARD");
    FeeScheduleType flat = new FeeScheduleType("FLAT");
    ProductType sblc = new ProductType("SBLC");
    ProductType rrc = new ProductType("RRC");
    ActivityType iss = new ActivityType("ISS");
    ActivityType osx = new ActivityType("OSX");
    FeeType commission = new FeeType("Commission");
    FeeType postage = new FeeType("Postage");
    FeeType telex = new FeeType("Telex");
    rules.add(createRule(1, flat, "", sblc, iss, commission, "Party 1", "USD", "", 0, 750, true));
    rules.add(createRule(2, standard, "Entity Branch 1", rrc, iss, commission, "", "YEN", "", 0, 1600, false));
    rules.add(createRule(3, standard, "", sblc, iss, postage, "", "YEN", "", 0, 40, true));
    rules.add(createRule(4, flat, "", sblc, osx, telex, "", "YEN", "<", 30000, 45, false));
    TestDataProvider tdp = new TestDataProvider(rules);
    final DataProviderCompiler converter = new DataProviderCompiler();
    final String drl = converter.compile(tdp, getTemplate());
    System.out.println(drl);
}
Also used : FeeType(org.drools.examples.templates.FeeType) FeeScheduleType(org.drools.examples.templates.FeeScheduleType) ArrayList(java.util.ArrayList) ProductType(org.drools.examples.templates.ProductType) ActivityType(org.drools.examples.templates.ActivityType) FeeScheduleRule(org.drools.examples.templates.FeeScheduleRule) DataProviderCompiler(org.drools.template.DataProviderCompiler)

Aggregations

ArrayList (java.util.ArrayList)1 ActivityType (org.drools.examples.templates.ActivityType)1 FeeScheduleRule (org.drools.examples.templates.FeeScheduleRule)1 FeeScheduleType (org.drools.examples.templates.FeeScheduleType)1 FeeType (org.drools.examples.templates.FeeType)1 ProductType (org.drools.examples.templates.ProductType)1 DataProviderCompiler (org.drools.template.DataProviderCompiler)1