Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leogomes/7056975 to your computer and use it in GitHub Desktop.
Save leogomes/7056975 to your computer and use it in GitHub Desktop.
Generated CompiledNetwork
package org.drools.core.reteoo.compiled;
import java.util.Map;
import org.drools.core.common.InternalFactHandle;
import org.drools.core.common.InternalWorkingMemory;
import org.drools.core.reteoo.ModifyPreviousTuples;
import org.drools.core.spi.PropagationContext;
import org.drools.core.spi.RuleComponent;
import org.kie.api.definition.rule.Rule;
public class Compiledorg_drools_compiler_PersonNetwork extends
org.drools.core.reteoo.compiled.CompiledNetwork {
private org.drools.core.rule.constraint.MvelConstraint mvelConstraint3; // [AlphaNode(3)
// constraint=name
// ==
// "Leo"]
private org.drools.core.rule.ContextEntry contextEntry3;
private org.drools.core.rule.constraint.MvelConstraint mvelConstraint4; // [AlphaNode(4)
// constraint=age
// ==
// 32]
private org.drools.core.rule.ContextEntry contextEntry4;
private org.drools.core.reteoo.LeftInputAdapterNode leftInputAdapterNode5; // [LeftInputAdapterNode(5)]
private org.drools.core.rule.constraint.MvelConstraint mvelConstraint6; // [AlphaNode(6)
// constraint=happy
// ==
// true]
private org.drools.core.rule.ContextEntry contextEntry6;
private org.drools.core.reteoo.JoinNode joinNode7; // [JoinNode(7) -
// [ClassObjectType
// class=org.drools.compiler.Person]]
public Compiledorg_drools_compiler_PersonNetwork() {
}
protected void setNetworkNodeReference(
org.drools.core.common.NetworkNode node) {
switch (node.getId()) {
case 3:
mvelConstraint3 = (org.drools.core.rule.constraint.MvelConstraint) ((org.drools.core.reteoo.AlphaNode) node)
.getConstraint();
contextEntry3 = mvelConstraint3.createContextEntry();
break;
case 4:
mvelConstraint4 = (org.drools.core.rule.constraint.MvelConstraint) ((org.drools.core.reteoo.AlphaNode) node)
.getConstraint();
contextEntry4 = mvelConstraint4.createContextEntry();
break;
case 5:
leftInputAdapterNode5 = (org.drools.core.reteoo.LeftInputAdapterNode) node;
break;
case 6:
mvelConstraint6 = (org.drools.core.rule.constraint.MvelConstraint) ((org.drools.core.reteoo.AlphaNode) node)
.getConstraint();
contextEntry6 = mvelConstraint6.createContextEntry();
break;
case 7:
joinNode7 = (org.drools.core.reteoo.JoinNode) node;
break;
}
}
public final void assertObject(
org.drools.core.common.InternalFactHandle handle,
org.drools.core.spi.PropagationContext context,
org.drools.core.common.InternalWorkingMemory wm) {
if (mvelConstraint3.isAllowed(handle, wm, contextEntry3)) {
if (mvelConstraint4.isAllowed(handle, wm, contextEntry4)) {
leftInputAdapterNode5.assertObject(handle, context, wm);
}
if (mvelConstraint6.isAllowed(handle, wm, contextEntry6)) {
joinNode7.assertObject(handle, context, wm);
}
}
}
public Map<Rule, RuleComponent> getAssociations() {
return null;
}
// // Missing methods
//
// public short getType() {
// return -1;
// }
//
// public void modifyObject(InternalFactHandle factHandle,
// ModifyPreviousTuples modifyPreviousTuples,
// PropagationContext context, InternalWorkingMemory workingMemory) {
//
// }
//
// public void byPassModifyToBetaNode(final InternalFactHandle factHandle,
// final ModifyPreviousTuples modifyPreviousTuples,
// final PropagationContext context,
// final InternalWorkingMemory workingMemory) {
//
// }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment