@Override public FlatQueryResults unmarshal(NativeQueryResults v) throws Exception { return new FlatQueryResults(((NativeQueryResults)v).getResults()); }
public String getId() { return getName(); }
public FlatQueryResults createFlatQueryResults() { return new FlatQueryResults(); }
public int size() { return this.getResults().size(); }
public Iterator<QueryResultsRow> iterator() { return new QueryResultsIterator( this.getResults().iterator() ); }
public FactHandle getFactHandle(String identifier) { if ( factHandles == null ) { this.factHandles = this.leftTuple.toFactHandles(); } Declaration declr = this.rule.getDeclaration( identifier ); if ( declr == null ) { throw new RuntimeException("The identifier '" + identifier + "' does not exist as a bound varirable for this query" ); } InternalFactHandle factHandle = getFactHandle( declr ); return factHandle; }
public String getNamespace() { return getPackageName(); }
public QueryResultsRow next() { return new NativeQueryResultRow(this.iterator.next()); }
public Iterator<QueryResultsRow> iterator() { return new QueryResultsIterator( identifiers, this.results.iterator(), this.factHandles.iterator() ); }
public QueryResultsRow next() { return new FlatQueryResultRow( identifiers, this.iterator.next(), this.handleIterator.next() ); }
public AgendaGroup getAgendaGroup(String name) { org.drools.spi.AgendaGroup agendaGroup = this.agenda.getAgendaGroup( name ); if ( agendaGroup != null ) { return new AgendaGroupImpl( agendaGroup, this.agenda ); } else { return null; } }
public RuleFlowGroup getRuleFlowGroup(String name) { org.drools.spi.RuleFlowGroup ruleFlowGroup = this.agenda.getRuleFlowGroup( name ); if ( ruleFlowGroup != null ) { return new RuleFlowGroupImpl( ruleFlowGroup, this.agenda ); } else { return null; } }
public QueryResults getQueryResults(String query, Object... arguments) { return new NativeQueryResults( this.session.getQueryResults( query, arguments ) ); }
public ActivationGroup getActivationGroup(String name) { org.drools.spi.ActivationGroup activationGroup = this.agenda.getActivationGroup( name ); if ( activationGroup != null ) { return new ActivationGroupImpl( activationGroup, this.agenda ); } else { return null; } }
public Agenda getAgenda() { return new AgendaImpl( (InternalAgenda) this.session.getAgenda() ); }
public void rowAdded(final Rule rule, final LeftTuple leftTuple, final PropagationContext context, final InternalWorkingMemory workingMemory) { RowAdapter rowAdapter = new RowAdapter(rule, leftTuple); leftTuple.setObject( rowAdapter ); this.viewEventListener.rowAdded( rowAdapter ); }
public Map<String, Declaration> getDeclarations() { return this.getResults().getDeclarations(0); }
public Object get(String identifier) { if ( factHandles == null ) { this.factHandles = this.leftTuple.toFactHandles(); } Declaration declr = this.rule.getDeclaration( identifier ); if ( declr == null ) { throw new RuntimeException("The identifier '" + identifier + "' does not exist as a bound varirable for this query" ); } InternalFactHandle factHandle = getFactHandle( declr ); return declr.getValue( null, factHandle.getObject() ); }
public String[] execute(Context context) { Declaration[] parameters = ((NativeQueryResults)context.getContextManager().getContext( "__TEMP__" ).get( this.localId )).getResults().getParameters(); String[] results = new String[parameters.length]; int i = 0; for(Declaration param : parameters){ results[i]=param.getIdentifier(); i++; } return results; } }
public Object execute(Context context) { Object result = ((NativeQueryResults)context.getContextManager().getContext( "__TEMP__" ).get( this.localId )).getResults().get(0).get(key); return result; }