BitSet sourceTraits = null;
BitSet targetTraits = null;
if ( source instanceof Thing ) {
sourceTraits = ((TraitableBean) ((Thing) source).getCore()).getCurrentTypeCode();
if ( sourceTraits == null && source instanceof TraitType ) {
CodedHierarchy x = ((ReteooRuleBase) workingMemory.getRuleBase()).getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
sourceTraits = x.getCode( ((TraitType)source).getTraitName() );
}
} else if ( source instanceof TraitableBean ) {
sourceTraits = ((TraitableBean) source).getCurrentTypeCode();
} else if ( source instanceof String ) {
CodedHierarchy x = ((ReteooRuleBase) workingMemory.getRuleBase()).getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
sourceTraits = x.getCode( source );
} else {
TraitableBean tbean = lookForWrapper( source, workingMemory);
if ( tbean != null ) {
sourceTraits = tbean.getCurrentTypeCode();
}
}
if ( target instanceof Class ) {
CodedHierarchy x = ((ReteooRuleBase) workingMemory.getRuleBase()).getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
targetTraits = x.getCode( ((Class) target).getName() );
} else if ( target instanceof String ) {
CodedHierarchy x = ((ReteooRuleBase) workingMemory.getRuleBase()).getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
targetTraits = x.getCode( target );
} else if ( target instanceof Thing ) {
targetTraits = ((TraitableBean) ((Thing) target).getCore()).getCurrentTypeCode();
if ( targetTraits == null && target instanceof TraitType ) {
CodedHierarchy x = ((ReteooRuleBase) workingMemory.getRuleBase()).getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
targetTraits = x.getCode( ((TraitType)target).getTraitName() );
}
} else if ( target instanceof TraitableBean ) {
targetTraits = ((TraitableBean) target).getCurrentTypeCode();
} else {
TraitableBean tbean = lookForWrapper( target, workingMemory );