{@inheritdoc}

@param FlowQuery $flowQuery the FlowQuery object
@param array $arguments the filter expression to use (in index 0)
@return void
@throws FizzleException
199370
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        if (!isset($arguments[0]) || empty($arguments[0])) {
            return;
        }
        if (!is_string($arguments[0])) {
            throw new FizzleException('filter operation expects string argument', 1332489625);
        }
        $filter = $arguments[0];

        $parsedFilter = FizzleParser::parseFilterGroup($filter);

        $filteredContext = [];
        $context = $flowQuery->getContext();
        foreach ($context as $element) {
            if ($this->matchesFilterGroup($element, $parsedFilter)) {
                $filteredContext[] = $element;
            }
        }
        $flowQuery->setContext($filteredContext);
    }
864933
public function pass(DataBagInterface $dataBag): DataBagInterface
    {
        if (!($this->callback)($dataBag)) {
            throw new FlowTerminationException(
                sprintf(
                    'Flow was terminated by Filter (%s) for data %s.',
                    $this->getIdentifier(),
                    json_encode($dataBag)
                )
            );
        }

        return $dataBag;
    }
197260
public void setFlowLogs(java.util.Collection<FlowLog> flowLogs) {
        if (flowLogs == null) {
            this.flowLogs = null;
            return;
        }

        this.flowLogs = new com.amazonaws.internal.SdkInternalList<FlowLog>(flowLogs);
    }
660929
public function run($data, string $node, string $port): NetworkInterface
    {
        if (empty($this->graph)) {
            throw new FlowException(
                "Graph is not yet initialized!"
            );
        }

        $this->graph->addInitial($data, $node, $port);

        return $this;
    }
689915
public function RunQuery(\Google\Cloud\Firestore\V1\RunQueryRequest $argument,
      $metadata = [], $options = []) {
        return $this->_serverStreamRequest('/google.firestore.v1.Firestore/RunQuery',
        $argument,
        ['\Google\Cloud\Firestore\V1\RunQueryResponse', 'decode'],
        $metadata, $options);
    }
350254
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        if (count($arguments) == 0) {
            return count($flowQuery->getContext()) > 0;
        } else {
            $flowQuery->pushOperation('is', []);
            $flowQuery->pushOperation('filter', $arguments);
        }
    }
545917
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        if (!isset($arguments[0]) || empty($arguments[0])) {
            throw new FlowQueryException('closest() requires a filter argument', 1332492263);
        }

        $output = [];
        foreach ($flowQuery->getContext() as $contextNode) {
            $contextNodeQuery = new FlowQuery([$contextNode]);
            $contextNodeQuery->pushOperation('first', []);
            $contextNodeQuery->pushOperation('filter', $arguments);

            $parentsQuery = new FlowQuery([$contextNode]);
            $contextNodeQuery->pushOperation('add', [$parentsQuery->parents($arguments[0])->get()]);

            foreach ($contextNodeQuery as $result) {
                /* @var TraversableNodeInterface $result */
                $output[(string)$result->getNodeAggregateIdentifier()] = $result;
            }
        }

        $flowQuery->setContext(array_values($output));
    }
1214782
public function search(string $query, array $arguments = null)
    {
        $args = ['q' => $query];
        if (is_array($arguments)) {
            $args = array_merge($arguments, $args);
        }
        return new SearchIterator($this, 'search/tweets', $args);
    }
729467
protected function applyContextStrategyToQueryBuilder($query, $strategy, array $parameters = [])
    {
        $strategy = $this->resolveContextStrategy($strategy);

        if ( ! $strategy) return;

        $strategy->apply($query, $parameters);
    }
337011
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $term = isset($arguments[0]) ? $arguments[0] : null;
        $filterNodeTypeName = isset($arguments[1]) ? $arguments[1] : null;

        $nodeTypes = strlen($filterNodeTypeName) > 0 ? [$filterNodeTypeName] : array_keys($this->nodeTypeManager->getSubNodeTypes('Neos.Neos:Document', false));

        /** @var NodeInterface $contextNode */
        $contextNode = $flowQuery->getContext()[0];

        $context = $contextNode->getContext();

        if ($term) {
            $matchedNodes = $this->nodeSearchService->findByProperties($term, $nodeTypes, $context, $contextNode);
        } else {
            $matchedNodes = [];
            // Yep, an internal API. But that's what we used in the old UI.
            $nodeDataRecords = $this->nodeDataRepository->findByParentAndNodeTypeRecursively($contextNode->getPath(), implode(',', $nodeTypes), $context->getWorkspace(), $context->getDimensions());
            foreach ($nodeDataRecords as $nodeData) {
                $matchedNode = $this->nodeFactory->createFromNodeData($nodeData, $context);
                if ($matchedNode !== null) {
                    $matchedNodes[$matchedNode->getPath()] = $matchedNode;
                }
            }
        }

        $flowQuery->setContext($matchedNodes);
    }
93401
public function triggerFlow(array $flow, ...$args)
    {
        foreach ($flow as $i => $step) {
            //subflows will trigger separately
            if (is_array($step)) {
                continue;
            }

            //rule the subtasks first
            $j = 1;

            while (isset($flow[$i + $j]) && is_array($flow[$i + $j])) {
                //subflows should have
                //an event and a handler
                if (count($flow[$i + $j]) > 1) {
                    //the subflow is valid
                    //extract the event out
                    $event = array_shift($flow[$i + $j]);
                    self::$flows[$event] = $flow[$i + $j];
                }

                $j++;
            }

            //now trigger the event
            $this->trigger($step, ...$args);

            self::$flows = [];

            //analyze the meta
            $meta = $this->getEventHandler()->getMeta();

            //if status is incomplete
            if ($meta === EventHandler::STATUS_INCOMPLETE) {
                //we should also stop the flow
                break;
            }
        }

        return $this;
    }
823735
public function invokeWith($arguments = [])
    {
        $this->closeRule();

        if (empty($this->rules)) {
            $defaultAnswerCallback = $this->defaultAnswerCallback;
            $defaultAnswerCallback($this);
            $this->closeRule();
        }

        if ($arguments instanceof Arguments) {
            $argumentsArray = $arguments->all();
        } else {
            $argumentsArray = $arguments;
            $arguments = new Arguments($arguments);
        }

        foreach ($this->rules as $rule) {
            if (
                $this->matcherVerifier
                    ->matches($rule->criteria(), $argumentsArray)
            ) {
                break;
            }
        }

        $answer = $rule->next();

        foreach ($answer->secondaryRequests() as $request) {
            $this->invoker->callWith(
                $request->callback(),
                $request->finalArguments($this->self, $arguments)
            );
        }

        $request = $answer->primaryRequest();

        return $this->invoker->callWith(
            $request->callback(),
            $request->finalArguments($this->self, $arguments)
        );
    }
738998
public function subflow(string $event, ...$args)
    {
        if (isset(self::$flows[$event])) {
            $this->triggerFlow(self::$flows[$event], ...$args);
        }

        return $this;
    }
179272
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $context = $flowQuery->getContext();
        if (isset($arguments[0])) {
            $index = $arguments[0];
            if (isset($context[$index])) {
                return $context[$index];
            } else {
                return null;
            }
        } else {
            return $context;
        }
    }
1317379
public void setFlowLogIds(java.util.Collection<String> flowLogIds) {
        if (flowLogIds == null) {
            this.flowLogIds = null;
            return;
        }

        this.flowLogIds = new com.amazonaws.internal.SdkInternalList<String>(flowLogIds);
    }
1210620
public function evaluate(FlowQuery $flowQuery, array $arguments) {
        if (!isset($arguments[0]) || empty($arguments[0])) {
            throw new FlowQueryException('sort() needs property name by which nodes should be sorted', 1332492263);
        } else {
            $nodes = $flowQuery->getContext();
            $sortByPropertyPath = $arguments[0];
            $sortOrder = 'DESC';
            if (isset($arguments[1]) && !empty($arguments[1]) && in_array($arguments[1], array('ASC', 'DESC'))) {
                $sortOrder = $arguments[1];
            }

            $sortedNodes = array();
            $sortSequence = array();
            $nodesByIdentifier = array();
            /** @var Node $node */
            foreach ($nodes as $node) {
                $propertyValue = $node->getProperty($sortByPropertyPath);
                if ($propertyValue instanceof \DateTime) {
                    $propertyValue = $propertyValue->getTimestamp();
                }
                $sortSequence[$node->getIdentifier()] = $propertyValue;
                $nodesByIdentifier[$node->getIdentifier()] = $node;
            }
            if ($sortOrder === 'DESC') {
                arsort($sortSequence);
            } else {
                asort($sortSequence);
            }
            foreach ($sortSequence as $nodeIdentifier => $value) {
                $sortedNodes[] = $nodesByIdentifier[$nodeIdentifier];
            }
            $flowQuery->setContext($sortedNodes);
        }
    }
1306341
private void getFlowsHelper(final ArrayList<ExecutableFlow> flows,
      final Collection<Pair<ExecutionReference, ExecutableFlow>> collection) {
    collection.stream().forEach(ref -> flows.add(ref.getSecond()));
  }