Beispiel #1
0
    @Override
    public Iterator getResults(
        Tuple leftTuple, InternalWorkingMemory wm, PropagationContext ctx, Object providerContext) {
      InternalFactHandle fh = leftTuple.getFactHandle();
      Object obj = fh.getObject();

      if (obj instanceof DroolsQuery) {
        obj = ((DroolsQuery) obj).getElements()[declaration.getPattern().getOffset()];
      }

      return xpathEvaluator.evaluate(wm, leftTuple, obj).iterator();
    }
 public Object getDeclarationValue(String variableName) {
   Declaration decl = ((RuleImpl) this.rule).getDeclaration(variableName);
   return decl.getValue(
       null, ((InternalFactHandle) factHandles.get(decl.getPattern().getOffset())).getObject());
 }