use of org.drools.compiler.lang.Expander in project drools-wb by kiegroup.
the class GuidedRuleDslrFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String dslr = ioService.readAllString(path);
final Expander expander = getDSLExpander(path);
final String drl = expander.expand(dslr);
return fillDrlIndexBuilder(path, drl);
}
use of org.drools.compiler.lang.Expander in project drools-wb by kiegroup.
the class GuidedRuleTemplateSourceService method getDSLExpander.
/**
* Returns an expander for DSLs (only if there is a DSL configured for this package).
*/
private Expander getDSLExpander(final Path path) {
final Expander expander = new DefaultExpander();
final List<DSLMappingFile> dsls = getDSLMappingFiles(path);
for (DSLMappingFile dsl : dsls) {
expander.addDSLMapping(dsl.getMapping());
}
return expander;
}
use of org.drools.compiler.lang.Expander in project drools-wb by kiegroup.
the class GuidedRuleTemplateSourceService method getSource.
@Override
public String getSource(final Path path, final TemplateModel model) throws SourceGenerationFailedException {
try {
if (model == null) {
return "";
} else {
final String dslr = RuleTemplateModelDRLPersistenceImpl.getInstance().marshal(model);
final Expander expander = getDSLExpander(path);
final String drl = expander.expand(dslr);
return drl;
}
} catch (Exception e) {
throw new SourceGenerationFailedException(e.getMessage());
}
}
use of org.drools.compiler.lang.Expander in project drools-wb by kiegroup.
the class DslrFileIndexer method getDSLExpander.
/**
* Returns an expander for DSLs (only if there is a DSL configured for this package).
*/
private Expander getDSLExpander(final Path path) {
final Expander expander = new DefaultExpander();
final List<DSLMappingFile> dsls = getDSLMappingFiles(path);
for (DSLMappingFile dsl : dsls) {
expander.addDSLMapping(dsl.getMapping());
}
return expander;
}
use of org.drools.compiler.lang.Expander in project drools-wb by kiegroup.
the class DslrFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String dslr = ioService.readAllString(path);
final Expander expander = getDSLExpander(path);
final String drl = expander.expand(dslr);
return fillDrlIndexBuilder(path, drl);
}
Aggregations