" $fieldA : FactA( $fieldB : fieldB )\n" +
" FactB( this == $fieldB, fieldA == $fieldA )\n" +
"then\n" +
"end";
KieBase kbase = new KieHelper().addContent(rule, ResourceType.DRL).build();
KieSession ksession = kbase.newKieSession();
FactType aType = kbase.getFactType( "org.drools.compiler.test", "FactA" );
Object a = aType.newInstance();
FactType bType = kbase.getFactType( "org.drools.compiler.test", "FactB" );
Object b = bType.newInstance();
aType.set( a, "fieldB", b );
bType.set( b, "fieldA", a );
ksession.insert( a );
ksession.insert( b );