lordgamez commented on code in PR #1414:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1414#discussion_r1011973043


##########
PROCESSORS.md:
##########
@@ -550,18 +550,18 @@ In the list below, the names of required properties 
appear in bold. Any other pr
 
 ### Description
 
-Runs an operating system command specified by the user and writes the output 
of that command to a FlowFile. If the command is expected to be 
long-running,the Processor can output the partial data on a specified interval. 
When this option is used, the output is expected to be in textual format,as it 
typically does not make sense to split binary data on arbitrary time-based 
intervals.
+Runs an operating system command specified by the user and writes the output 
of that command to a FlowFile. If the command is expected to be 
long-running,the Processor can output the partial data on a specified interval. 
When this option is used, the output is expected to be in textual format,as it 
typically does not make sense to split binary data on arbitrary time-based 
intervals. This processor is not available on Windows systems.

Review Comment:
   Updated in b8a9a3297a4c6e56c02a1b5767f13596ddf7b853



##########
extensions/standard-processors/processors/ExecuteProcess.cpp:
##########
@@ -74,172 +68,226 @@ void ExecuteProcess::initialize() {
   setSupportedRelationships(relationships());
 }
 
-void ExecuteProcess::onTrigger(core::ProcessContext *context, 
core::ProcessSession *session) {
+void ExecuteProcess::onSchedule(core::ProcessContext* context, 
core::ProcessSessionFactory* /*session_factory*/) {
+  gsl_Expects(context);
   std::string value;
-  std::shared_ptr<core::FlowFile> flow_file;
-  if (context->getProperty(Command, value, flow_file)) {
-    this->_command = value;
+  if (context->getProperty(Command.getName(), value)) {
+    command_ = value;
   }
-  if (context->getProperty(CommandArguments, value, flow_file)) {
-    this->_commandArgument = value;
+  if (context->getProperty(CommandArguments.getName(), value)) {
+    command_argument_ = value;
   }
-  if (context->getProperty(WorkingDir, value, flow_file)) {
-    this->_workingDir = value;
+  if (context->getProperty(WorkingDir.getName(), value)) {
+    working_dir_ = value;
   }
   if (auto batch_duration = 
context->getProperty<core::TimePeriodValue>(BatchDuration)) {
-    _batchDuration = batch_duration->getMilliseconds();
-    logger_->log_debug("Setting _batchDuration");
+    batch_duration_ = batch_duration->getMilliseconds();
+    logger_->log_debug("Setting batch duration to %d milliseconds", 
batch_duration_.count());
   }
   if (context->getProperty(RedirectErrorStream.getName(), value)) {
-    _redirectErrorStream =  
org::apache::nifi::minifi::utils::StringUtils::toBool(value).value_or(false);
+    redirect_error_stream_ = 
org::apache::nifi::minifi::utils::StringUtils::toBool(value).value_or(false);
   }
-  this->_fullCommand = _command + " " + _commandArgument;
-  if (_fullCommand.length() == 0) {
-    yield();
+  full_command_ = command_ + " " + command_argument_;
+}
+
+bool ExecuteProcess::changeWorkdir() const {
+  if (working_dir_.length() > 0 && working_dir_ != ".") {
+    if (chdir(working_dir_.c_str()) != 0) {

Review Comment:
   Good point, updated in b8a9a3297a4c6e56c02a1b5767f13596ddf7b853



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to