if (parentElement instanceof Package) {
Package pkg = (Package) parentElement;
return pkg.getGroups();
}
if (parentElement instanceof RuleGroup) {
RuleGroup group = (RuleGroup) parentElement;
return group.getRules();
}
if (parentElement instanceof DroolsElement) {
return ((DroolsElement) parentElement).getChildren();
}
return new Object[0];