0

We are in the process of evaluating SalesForce for use in our enterprise and the one place we are getting a little hung up on is the ability to log and trace transactions. In the past, coming from a home-grown SOA system, I had the ability to inject a header in all calls, set a transaction id at the ESB layer and perform async logging of all child transactions across the enterprise using the original transaction id.

With SalesForce replacing one or more of the SOA systems, would I still have the ability to properly log and trace a call in the following scenario:


1. An external system invokes an update to a lead in Salesforce
   1.1 The call passes through our ESB (which generates a GUID to represent the transaction) to Salesforce – the ESB which interfaces with our enterprise logger to record the service call
      1.1.1 Salesforce fires the appropriate workflow on lead save
        1.1.1.1 Fire platform event containing the GUID and meta data about workflow
        1.1.1.2 The workflow calls an external service to update an external system (through ESB and includes the GUID – also logged)
               1.1.1.2.1 External service returns data
        1.1.1.3 The workflow stores data on lead
        1.1.1.4 The workflow adds tasks to lead

We couldn’t understand how we would pass the GUID from the external service call at step 1.1 to step 1.1.1.1 so the platform event can contain the GUID and we can trace the link between the service call and the workflow execution.

Additionally we couldn’t determine if we need to write custom “wrappers” in apex around each SF service to accept the GUID and pass it downstream or if something like this is native to the platform.

0

Your question is very broad and mostly opinion based. It can be addressed differently in different scenarios, however I am providing some pointers here based on your questions, which may help you to get started in that direction.

As for your question:

With SalesForce replacing one or more of the SOA systems, would I still have the ability to properly log and trace a call

The short answer is Yes. How you want to log is totally dependent on where you want to log, in Salesforce or outside of Salesforce. You may need to design a custom logging framework with all storage considerations, etc.

We couldn’t understand how we would pass the GUID from the external service call at step 1.1 to step 1.1.1.1 so the platform event can contain the GUID and we can trace the link between the service call and the workflow execution.

Now, here again there are multiple ways to do this. But in general, you can just have the GUID as a custom field on the record that is being created.

  1. Let Salesforce call your ESB endpoints, parse the message along with the GUID, store it on a custom field on the record being created (to signify which GUID resulted in this record creation) and then publish the same GUID on a Platform Event. You can always create custom fields on Platform Events, so once you retrieve the message from ESB, you take care of all these in the same transaction.
  2. Similar to above, you can have ESB call the record creation process and along with all other fields, just have GUID passed too. Now within Salesforce, using triggers, you can always capture that field and then generate Platform Events during the transaction

Additionally we couldn’t determine if we need to write custom “wrappers” in apex around each SF service to accept the GUID and pass it downstream or if something like this is native to the platform.

There's no native support to accept GUID. In both the approaches mentioned above, you will need to have a custom way to store the GUID and utilize it to be able to send it to respective endpoints.

I strongly see a use case here where you can create a small framework using apex classes, which consumes the messages from ESB, takes care of generating events, and then publishes the response back to ESB along with whatever information you need.

Hope this helps.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.