You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "tpalfy (via GitHub)" <gi...@apache.org> on 2023/04/06 13:38:45 UTC

[GitHub] [nifi] tpalfy commented on a diff in pull request #7019: NIFI-11224: Refactor and FF attribute support in WHERE in QuerySalesf…

tpalfy commented on code in PR #7019:
URL: https://github.com/apache/nifi/pull/7019#discussion_r1159807215


##########
nifi-nar-bundles/nifi-salesforce-bundle/nifi-salesforce-processors/src/main/java/org/apache/nifi/processors/salesforce/QuerySalesforceObject.java:
##########
@@ -560,6 +566,27 @@ private SalesforceSchemaHolder getConvertedSalesforceSchema(String sObject, Stri
         }
     }
 
+    private void handleError(ProcessSession session, FlowFile originalFlowFile, AtomicBoolean isOriginalTransferred, List<FlowFile> outgoingFlowFiles,
+                             Exception e, String errorMessage) {
+        if (originalFlowFile != null) {
+            session.transfer(originalFlowFile, REL_FAILURE);
+            isOriginalTransferred.set(true);
+        }
+        getLogger().error(errorMessage, e);
+        session.remove(outgoingFlowFiles);
+        outgoingFlowFiles.clear();
+    }
+
+    private StateMap getState(ProcessContext context) {
+        StateMap state;
+        try {
+            state = context.getStateManager().getState(Scope.CLUSTER);

Review Comment:
   I think we should use `session.setState` instead.
   That way if the session is rolled back the state change is rolled back as well.



##########
nifi-nar-bundles/nifi-salesforce-bundle/nifi-salesforce-processors/src/test/java/org/apache/nifi/processors/salesforce/QuerySalesforceObjectIT.java:
##########
@@ -68,10 +68,10 @@ void retrievesAndWritesRecords() throws Exception {
         runner.setProperty(QuerySalesforceObject.SOBJECT_NAME, sObjectName);
         runner.setProperty(QuerySalesforceObject.FIELD_NAMES, fieldNames);
         runner.setProperty(CommonSalesforceProperties.API_VERSION, VERSION);
-        runner.setProperty(CommonSalesforceProperties.API_URL, BASE_URL);
+        runner.setProperty(CommonSalesforceProperties.SALESFORCE_INSTANCE_URL, INSTANCE_URL);
         runner.setProperty(QuerySalesforceObject.RECORD_WRITER, writer.getIdentifier());
-        runner.setProperty(QuerySalesforceObject.AGE_FIELD, "CreatedDate");
-        runner.setProperty(QuerySalesforceObject.INITIAL_AGE_FILTER, "2022-01-06T08:43:24.000+0000");
+        //runner.setProperty(QuerySalesforceObject.AGE_FIELD, "CreatedDate");
+        //runner.setProperty(QuerySalesforceObject.INITIAL_AGE_FILTER, "2022-01-06T08:43:24.000+0000");

Review Comment:
   ?



##########
nifi-nar-bundles/nifi-salesforce-bundle/nifi-salesforce-processors/src/test/java/org/apache/nifi/processors/salesforce/QuerySalesforceObjectIT.java:
##########
@@ -68,10 +68,10 @@ void retrievesAndWritesRecords() throws Exception {
         runner.setProperty(QuerySalesforceObject.SOBJECT_NAME, sObjectName);
         runner.setProperty(QuerySalesforceObject.FIELD_NAMES, fieldNames);
         runner.setProperty(CommonSalesforceProperties.API_VERSION, VERSION);
-        runner.setProperty(CommonSalesforceProperties.API_URL, BASE_URL);
+        runner.setProperty(CommonSalesforceProperties.SALESFORCE_INSTANCE_URL, INSTANCE_URL);

Review Comment:
   This and the other ITs don't compile because `INSTANCE_URL` is not recognised. Maybe forgot to push `SalesforceConfigAware` changes?



-- 
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-unsubscribe@nifi.apache.org

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