kBase.setKModule(kieModuleModel);
kBase.setName(kBaseName);
BeanArgument kbOptionsArg = metadata.getArguments().get(2);
PassThroughMetadata passThroughMetadata = (PassThroughMetadata) kbOptionsArg.getValue();
KBaseOptions kBaseOptions = (KBaseOptions) passThroughMetadata.getObject();
String packages = kBaseOptions.getPackages();
if ( !kBaseOptions.getPackages().isEmpty()) {
for ( String pkg : packages.split( "," ) ) {
kBase.addPackage( pkg.trim() );
}
}
String includes = kBaseOptions.getIncludes();
if ( !includes.isEmpty() ) {
for ( String include : includes.split( "," ) ) {
kBase.addInclude( include.trim() );
}
}
String equalsBehavior = kBaseOptions.getEqualsBehavior();
if ( !equalsBehavior.isEmpty() ) {
kBase.setEqualsBehavior( EqualityBehaviorOption.determineEqualityBehavior(equalsBehavior) );
}
String eventProcessingMode = kBaseOptions.getEventProcessingMode();
if ( !eventProcessingMode.isEmpty() ) {
kBase.setEventProcessingMode( EventProcessingOption.determineEventProcessingMode(eventProcessingMode) );
}
String declarativeAgenda = kBaseOptions.getDeclarativeAgenda();
if ( !declarativeAgenda.isEmpty() ) {
kBase.setDeclarativeAgenda( DeclarativeAgendaOption.determineDeclarativeAgenda(declarativeAgenda) );
}
kieModuleModel.getRawKieBaseModels().put(kBase.getName(), kBase);