I found a workaround by extending the PackageDescr.
If somebody cares here is my solution to it:
public class MergeablePackageDescr extends PackageDescr{
public void merge(PackageDescr packageDescr){
for(AttributeDescr attribue : packageDescr.getAttributes()){
if(!this.getAttributes().contains(attribue)){
this.addAttribute(attribue);
}
}
for(FunctionImportDescr funktionimport :
packageDescr.getFunctionImports()){
if(!this.getFunctionImports().contains(funktionimport)){
this.addFunctionImport(funktionimport);
}
}
for(FunctionDescr function : packageDescr.getFunctions()){
if(!this.getFunctions().contains(function)){
this.addFunction(function);
}
}
for(GlobalDescr global : packageDescr.getGlobals()){
if(!this.getGlobals().contains(global)){
this.addGlobal(global);
}
}
for(ImportDescr importdes : packageDescr.getImports()){
if(!this.getImports().contains(importdes)){
this.addImport(importdes);
}
}
for(RuleDescr rule : packageDescr.getRules()){
if(!this.getRules().contains(rule)){
this.addRule(rule);
}
}
}
}
--
View this message in context:
http://drools.46999.n3.nabble.com/Merging-two-XML-rules-into-a-single-XML...
Sent from the Drools: User forum mailing list archive at
Nabble.com.