コースとトレーニングの大手プロバイダーである会社は、サードパーティのトレーナーを使用してコースを提供しています。会社のトレーナーは、会社にトレーニングを提供する前に、10 の異なるトレーニング認定検証機関から検証を受ける必要があります。各トレーニング認定機関には独自の応答時間があり、トレーナーの確認に数日かかる場合があります。
同社は、代理店の Web サービスに統合することで、トレーナー認定の検証プロセスを自動化することを決定しました。
このプロセスを自動化するために推奨されるアプローチは何ですか?
正解:D
Explanation
Answer D is valid because using middleware to handle the call out to the 10 different verification services is a scalable and reliable solution that can handle the complexity and variability of the integration. The middleware can orchestrate the calls to the different web services, consolidate the verification results, and handle any errors or retries. The middleware can then make a call-in to Salesforce and update the verification status to "verified" using an API or a platform event12 Answer A is not valid because using Salesforce external service to make the call out to the 10 different verification services is not a feasible or efficient solution. Salesforce external service is a feature that allows invoking an external service from a flow and mapping its inputs and outputs to flow variables.
However, this feature requires configuring an Apex action, a named credential, and an external service definition for each web service, which is not a low code solution. Moreover, this feature does not support checking the verification agencies until the result is verified, as it only invokes the external service once per flow interview3 Answer B is not valid because creating a trigger on the trainer record to make a callout to each verification agency is not a recommended or robust solution. Triggers are Apex code that execute before or after database events, such as insert, update, or delete. However, triggers cannot make callouts directly, as they are part of a database transaction and must complete quickly. To make a callout from a trigger, an asynchronous process such as a future method or a queueable job must be used, which adds complexity and overhead to the integration. Moreover, triggers have limits on the number of callouts and asynchronous calls they can make per transaction, which may affect the scalability and reliability of the integration.
Answer C is not valid because making an Apex callout using @future annotation to make the call out to all different agencies is not a suitable or reliable solution. The @future annotation allows marking a method for execution at a later time when system resources become available. However, this annotation has several limitations and drawbacks, such as:
Future methods cannot return values, so they cannot update the trainer status to "verified" directly.
Future methods have limits on the number of callouts and future calls they can make per execution, which may affect the scalability and reliability of the integration.
Future methods run in their own thread and do not share any static variables or state with other methods, which makes it difficult to consolidate the verification results from different agencies.
Future methods are not guaranteed to execute at a specific time or order, which may affect the timeliness and accuracy of the integration.
1: Orchestration Pattern 2: Remote Process Invocation-Request and Reply 3: External Services : Apex Developer Guide: Triggers : Apex Developer Guide: Using Future Methods