/* (non-Javadoc)
@see org.kie.spi.Accumulator#getResult(java.lang.Object, org.kie.spi.Tuple, org.kie.rule.Declaration[], org.kie.WorkingMemory)
502206
public Object getResult(Object workingMemoryContext,
                            Object context,
                            Tuple tuple,
                            Declaration[] declarations,
                            WorkingMemory workingMemory) throws Exception {
        Object[]  localVars = ((MVELAccumulatorContext) context).getVariables();
        
        MVELAccumulatorFactoryContext factoryContext = (MVELAccumulatorFactoryContext)workingMemoryContext;
        VariableResolverFactory factory = factoryContext.getResultFactory();
        resultUnit.updateFactory( null, tuple, localVars, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver(), factory );

        return MVELSafeHelper.getEvaluator().executeExpression( this.result, null, factory );
    }
99497
static <R> BiPredicate<R, Throwable> resultPredicateFor(R result) {
    return (t, u) -> Objects.equals(result, t);
  }
895397
public function getResult () : Result
    {
        // Cache
        if ( $this->_Result === null ) :
            $this->calcPossibleRanking();
            $this->calcRankingScore();
            $this->makeRanking();
            $this->conflictInfos();
        endif;

        // Return
        return $this->_Result;
    }
918653
Result getResult(Session session) {

        Table           table              = baseTable;
        Result          resultOut          = null;
        RowSetNavigator generatedNavigator = null;
        PersistentStore store = session.sessionData.getRowStore(baseTable);

        if (generatedIndexes != null) {
            resultOut = Result.newUpdateCountResult(generatedResultMetaData,
                    0);
            generatedNavigator = resultOut.getChainedResult().getNavigator();
        }

        RowSetNavigator newDataNavigator = queryExpression == null
                                           ? getInsertValuesNavigator(session)
                                           : getInsertSelectNavigator(session);
        Expression        checkCondition = null;
        RangeIteratorBase checkIterator  = null;

        if (targetTable != baseTable) {
            QuerySpecification select =
                ((TableDerived) targetTable).getQueryExpression()
                    .getMainSelect();

            checkCondition = select.checkQueryCondition;

            if (checkCondition != null) {
                checkIterator = select.rangeVariables[0].getIterator(session);
            }
        }

        while (newDataNavigator.hasNext()) {
            Object[] data = newDataNavigator.getNext();

            if (checkCondition != null) {
                checkIterator.currentData = data;

                boolean check = checkCondition.testCondition(session);

                if (!check) {
                    throw Error.error(ErrorCode.X_44000);
                }
            }

            table.insertRow(session, store, data);

            if (generatedNavigator != null) {
                Object[] generatedValues = getGeneratedColumns(data);

                generatedNavigator.add(generatedValues);
            }
        }

        newDataNavigator.beforeFirst();
        table.fireAfterTriggers(session, Trigger.INSERT_AFTER,
                                newDataNavigator);

        if (resultOut == null) {
            resultOut =
                Result.getUpdateCountResult(newDataNavigator.getSize());
        } else {
            resultOut.setUpdateCount(newDataNavigator.getSize());
        }

        return resultOut;
    }
955449
func (cf *countFunction) GetResult(evalCtx *AggEvaluateContext) (d types.Datum) {
	d.SetInt64(evalCtx.Count)
	return d
}
109638
@Override
	public void cacheResult(
		List<CPRuleAssetCategoryRel> cpRuleAssetCategoryRels) {
		for (CPRuleAssetCategoryRel cpRuleAssetCategoryRel : cpRuleAssetCategoryRels) {
			if (entityCache.getResult(
						CPRuleAssetCategoryRelModelImpl.ENTITY_CACHE_ENABLED,
						CPRuleAssetCategoryRelImpl.class,
						cpRuleAssetCategoryRel.getPrimaryKey()) == null) {
				cacheResult(cpRuleAssetCategoryRel);
			}
			else {
				cpRuleAssetCategoryRel.resetOriginalValues();
			}
		}
	}
766163
@Override
	public WebArchive getResultingArchive() {
		log.trace("Resulting Archive:" + archive.toString(Formatters.VERBOSE));

		return archive;
	}
1071206
List<Result> getResult() {
    return ImmutableList.copyOf(Iterables.filter(results.values(), USED_RESULTS));
  }
163456
def result(self):
        """"""
        msg = "Use get_result() which forces correct exception handling"
        warnings.warn(DeprecationWarning(msg), stacklevel=2)
        return self._result
589943
public boolean isSingleResult() {
		if (result == null) {
			return false;
		} else {
			if (singleResult == null) {
				if (result.size() == 1 && result.values().iterator().next().size() == 1) {
					singleResult = true;
				} else {
					singleResult = false;
				}
			}
			return singleResult;
		}
	}
408501
public final V invoke() {
        int s;
        if ((s = doInvoke() & DONE_MASK) != NORMAL)
            reportException(s);
        return getRawResult();
    }
131490
public Object get(final Declaration declaration) {
        return declaration.getValue( (InternalWorkingMemory) workingMemory, getObject( getFactHandle( declaration ) ) );
    }
1143716
static <R> BiPredicate<R, Throwable> resultPredicateFor(Predicate<R> resultPredicate) {
    return (t, u) -> {
      if (u == null) {
        return resultPredicate.test(t);
      } else {
        // resultPredicate is only defined over the success type.
        // It doesn't know how to handle a failure of type Throwable,
        // so we return false here.
        return false;
      }
    };
  }
1044069
@Override
    protected FileEntry[] getResults () {
        FileEntry[] results = this.response.getResults();
        if ( results == null ) {
            return new FileEntry[0];
        }
        return results;
    }
618578
public byte[] getJobHistoryRawFromResult(Result value)
      throws MissingColumnInResultException {
    if (value == null) {
      throw new IllegalArgumentException("Cannot create InputStream from null");
    }

    Cell cell = value.getColumnLatestCell(Constants.RAW_FAM_BYTES,
        Constants.JOBHISTORY_COL_BYTES);

    // Could be that there is no conf file (only a history file).
    if (cell == null) {
      throw new MissingColumnInResultException(Constants.RAW_FAM_BYTES,
          Constants.JOBHISTORY_COL_BYTES);
    }

    byte[] jobHistoryRaw = CellUtil.cloneValue(cell);
    return jobHistoryRaw;
  }
414331
public boolean result(final Object iRecord) {
    final ORecordAbstract<?> record = (ORecordAbstract<?>) iRecord;

    if (record.getIdentity().isValid()) {
      // RESET VERSION TO DISABLE MVCC AVOIDING THE CONCURRENT EXCEPTION IF LOCAL CACHE IS NOT UPDATED
      record.setVersion(-1);
      record.delete();
      recordCount++;
      return true;
    }
    return false;
  }
1293984
@Override
	public OUT get() {
		ACC accumulator = getInternal();
		return accumulator != null ? aggregateTransformation.aggFunction.getResult(accumulator) : null;
	}