lordgamez commented on a change in pull request #1222:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1222#discussion_r762044098



##########
File path: extensions/script/python/ExecutePythonProcessor.cpp
##########
@@ -54,35 +54,62 @@ core::Relationship 
ExecutePythonProcessor::Success("success", "Script successes"
 core::Relationship ExecutePythonProcessor::Failure("failure", "Script 
failures");
 
 void ExecutePythonProcessor::initialize() {
-  setSupportedProperties({
-    ScriptFile,
-    ScriptBody,
-    ModuleDirectory
-  });
-  setAcceptAllProperties();
-  setSupportedRelationships({
-    Success,
-    Failure
-  });
-}
+  if (getProperties().empty()) {

Review comment:
       This is needed because in case of native python processors 
initialization is actually called twice. Once normally as for every other 
processor and once before that in the `PythonObjectFactory` when creating the 
native processor. In the first call the `ScriptFile` property is set to be used 
for the native python processor, which can provide description and 
initialization for the processor still in the `onInitialize` phase. 
Unfortunately the operation of declaring the properties is not idempotent, in 
this case it clears the value of the `ScriptFile` on the second `onInitialize` 
run that's why the check was needed.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to