if ("createKieSession".equalsIgnoreCase(metadata.getFactoryMethod())){
BeanArgument beanArgument = metadata.getArguments().get(0);
String ksessionName = ((MutableValueMetadata)beanArgument.getValue()).getStringValue();
BeanArgument kbOptionsArg = metadata.getArguments().get(5);
PassThroughMetadata passThroughMetadata = (PassThroughMetadata) kbOptionsArg.getValue();
KSessionOptions kSessionOptions = (KSessionOptions) passThroughMetadata.getObject();
String type = kSessionOptions.getType();
String kbaseRef = kSessionOptions.getkBaseRef();
if( kbaseRef.equalsIgnoreCase(kieBaseModel.getName())) {
KieSessionModelImpl kSession = new KieSessionModelImpl(kieBaseModel, ksessionName);