AD0-E716 · Question #13
An Adobe Commerce developer has installed a module from a third-party vendor. This module fires a custom event named third_party_event_after and also defines an observer named…
The correct answer is B. Set the sort order of the new observer to be less than that of the third-party vendor's observer. To ensure that the developer's observer runs after the observer defined by the third-party module, they need to set the sort order of the new observer to be less than that of the third-party vendor's The sort order is a number that is assigned to each observer. The lower the…
Question
An Adobe Commerce developer has installed a module from a third-party vendor. This module fires a custom event named third_party_event_after and also defines an observer named third_party_event_after_observer that listens to that event. The developer wants to listen to this custom event in their own module but wants to execute their observer's logic after the third_party_event_after_observer observer has finished executing. What would the developer do to ensure their observer runs after the observer defined by the third- party module?
Options
- AEnsure the third-party module is listed in the <sequence> node of the developer's module.xmi file.
- BSet the sort order of the new observer to be less than that of the third-party vendor's observer.
- CThis is not possible as observers listening to the same event may be invoked in any order.
How the community answered
(27 responses)- A7% (2)
- B70% (19)
- C22% (6)
Explanation
To ensure that the developer's observer runs after the observer defined by the third-party module, they need to set the sort order of the new observer to be less than that of the third-party vendor's The sort order is a number that is assigned to each observer. The lower the number, the earlier the observer will be executed. For example, if the third-party vendor's observer has a sort order of 10, the developer's observer would need to have a sort order of 9 or lower.
Topics
Community Discussion
No community discussion yet for this question.