Orchestrate Messages Between Packages in Salesforce

public class ClosingEventOrchestrator {
public static void orchestrate(List<Opportunity> opps){
for (ClosingEventConsumerSubscription__mdt flow : [SELECT ApexClass__c FROM ClosingEventConsumerSubscription__mdt ORDER BY Order__c]){
IClosingEventConsumer consumer = (IClosingEventConsumer)Type.forName(flow.ApexClass__c).newInstance();
consumer.consume(opps);
}
}
}
public interface IClosingEventConsumer {
void consume(List<Opportunity> opps);
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CodeChef: June Challenge | Minimum Subtree Cover | Python, Java, C++ Solution

Codechef

Azure Firewall and Standard Load balancer

Monolithic vs Microservices Architecture — Which One Is Right for You?

Azure — Azure Private Link Overview

Bitwise N-Queens in a Tweet

The Importance of Mental Models for Incident Response

Are Single-Page Applications Bounded Contexts — and what the heck is inside a Bounded Context?

Send SMS Using AWS Pinpoint With C#

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ben Butler

Ben Butler

More from Medium

Always ask ‘What If?’

C.O.R.P.S Questions

Split Video Layouts on Microsoft Teams Rooms

Introduction to Some Ingredients for Architectural Transformation Projects