szaszm commented on a change in pull request #718: MINIFICPP-1132 - CWEL should
stop committing further flowfiles in cas…
URL: https://github.com/apache/nifi-minifi-cpp/pull/718#discussion_r372353045
##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -965,6 +965,18 @@ std::shared_ptr<core::FlowFile> ProcessSession::get() {
return NULL;
}
+bool ProcessSession::outgoingConnectionsFull(const std::string& relationship) {
+ std::set<std::shared_ptr<Connectable>> connections =
process_context_->getProcessorNode()->getOutGoingConnections(relationship);
+ Connection * connection = nullptr;
+ for (const auto& conn : connections) {
+ connection = dynamic_cast<Connection*>(conn.get());
+ if (connection && connection->isFull()) {
+ return true;
+ }
+ }
+ return false;
Review comment:
I prefer to use STL algorithms when possible.
```
return std::find_if(std::cbegin(connections), std::cend(connections),
[](const auto& conn) {
auto* connection = dynamic_cast<Connection*>(conn.get());
return connection && connection->isFull();
}) != std::cend(connections);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services