This is an automated email from the ASF dual-hosted git repository.

claudio4j pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new d2a560ff Fix salesforce-update-sink.kamelet (#2076)
d2a560ff is described below

commit d2a560ff60c517343929668cda23210603178e98
Author: Claudio Miranda <clau...@claudius.com.br>
AuthorDate: Fri Jun 14 14:22:15 2024 -0300

    Fix salesforce-update-sink.kamelet (#2076)
    
    Fix https://github.com/apache/camel-kamelets/issues/1590
    
    At runtime the bean is renamed which seems to cause the
    NoSuchEndpointException: No endpoint could be found for: local-salesforce-1
---
 kamelets/salesforce-update-sink.kamelet.yaml | 31 +++++++++++++++++-----------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/kamelets/salesforce-update-sink.kamelet.yaml 
b/kamelets/salesforce-update-sink.kamelet.yaml
index 5e987a73..f3eac11d 100644
--- a/kamelets/salesforce-update-sink.kamelet.yaml
+++ b/kamelets/salesforce-update-sink.kamelet.yaml
@@ -31,16 +31,16 @@ spec:
   definition:
     title: "Salesforce Update Sink"
     description: |-
-      Update an object in Salesforce. 
-      
-      The body received must contain a JSON key-value pair for each property 
to update inside the payload attribute, for example: 
-      
+      Update an object in Salesforce.
+
+      The body received must contain a JSON key-value pair for each property 
to update inside the payload attribute, for example:
+
       `{ "payload": { "Phone": "1234567890", "Name": "Antonia" } }`
-      
+
       The body received must include the `sObjectName` and `sObjectId` 
properties, for example:
 
       `{ "payload": { "Phone": "1234567890", "Name": "Antonia" }, "sObjectId": 
"sObjectId", "sObjectName": "sObjectName" }`
-     
+
     required:
       - clientId
       - clientSecret
@@ -101,14 +101,21 @@ spec:
     from:
       uri: kamelet:source
       steps:
-        - setProperty:
+        - setHeader:
             name: sObjectId
-            jsonpath: "$['sObjectId']"
-        - setProperty:
+            jsonpath: "$.sObjectId"
+        - setHeader:
             name: sObjectName
-            jsonpath: "$['sObjectName']"
+            jsonpath: "$.sObjectName"
         - transform:
-            jsonpath: "$['payload']"
+            jsonpath: "$.payload"
         - marshal:
             json: {}
-        - toD: 
"{{local-salesforce}}:updateSObject?sObjectId=${exchangeProperty.sObjectId}&sObjectName=${exchangeProperty.sObjectName}&rawPayload=true"
+        - to:
+            uri: "{{local-salesforce}}:updateSObject"
+            parameters:
+              rawPayload: "true"
+        - removeHeader:
+            name: sObjectId
+        - removeHeader:
+            name: sObjectName

Reply via email to