Introduction
Before we learn how to set up this component, it's important to understand the SightLane concept of "The Current Event." Salesforce processes are often set up in a "Russian dolls" structure, in which one process contains others (sometimes, this is called "the stack"). In the image below, an Apex Trigger calls an Apex class, which then launches two Flows. When the Flows are complete, they hand control back to the Apex class. When it is complete, control is handed back to the Trigger to complete its final duties (including reporting all of its auditing content back to SightLane).
Two SightLane monitors are created during this process: one at the Trigger level and a completely separate one at the Apex Class level. It is often the case that multiple overlapping monitors are in action during a process. SightLane is able to keep track of all executing Events and knows which one is closest to the currently executing element. This idea of the "closest" or "most local" event is called "The Current Event." The Add to Current Event component adds its auditing content to the "Current Event," even if the Flow has no idea which Event that is!
In the example above, Flow 1's auditing content will be added to the "Monitor 2" Event instead of spinning up a brand new Event. This capability lets us combine auditing data from multiple technical elements to create a single, end-to-end story for a business process in Salesforce.
Step 1: Add the Component
Whew! Ok...that was a bit on the advanced side. Fortunately, using the component is really easy. Simply add the "Add to Current Event" component to your Flow and you are almost there.
Step 2: Only One Thing to Do
Once you've added the component, add logging statements to your logging collection variable (see the auditing overview article for details) and list them in the SightLane Log Messages property. That's it! You don't need to specify which monitor they are being added to, and you don't need to Report them to SightLane. That will all be handled for you by the "Current Event" to which the auditing content is attached.
Advanced concept. Simple component. Powerful capability. This component enables developers to contribute Flow auditing content to a larger process, making details available at the business auditing level. Try it yourself and let us know if you have questions at support@sightlane.com.
Comments
Article is closed for comments.