Class AchievementChangeProcessor
- Namespace
- InSite.Application.Records.Read
- Assembly
- Shift.Sdk.dll
Implements the process manager for Achievement changes.
public class AchievementChangeProcessor
- Inheritance
-
AchievementChangeProcessor
- Inherited Members
- Extension Methods
Remarks
A process manager (sometimes called a saga in CQRS) is an independent component that reacts to domain changes in a cross-aggregate, eventually consistent manner. Time can be a trigger. Process managers are sometimes purely reactive, and sometimes represent workflows. From an implementation perspective, a process manager is a state machine that is driven forward by incoming changes (which may come from many aggregates). Some states will have side effects, such as sending commands, talking to external web services, or sending emails.
Constructors
AchievementChangeProcessor(ICommander, IChangeQueue, IAlertMailer, IAchievementSearch, ICourseObjectSearch, IAttemptSearch, IJournalSearch, IProgramSearch, IProgramStore, IProgramService, IMessageSearch, IContentSearch, IContactSearch, bool)
public AchievementChangeProcessor(ICommander commander, IChangeQueue publisher, IAlertMailer mailer, IAchievementSearch achievements, ICourseObjectSearch courses, IAttemptSearch attempts, IJournalSearch journals, IProgramSearch program, IProgramStore programStore, IProgramService programService, IMessageSearch messages, IContentSearch contents, IContactSearch contacts, bool restartCourseWhenCredentialExpired)
Parameters
commanderICommanderpublisherIChangeQueuemailerIAlertMailerachievementsIAchievementSearchcoursesICourseObjectSearchattemptsIAttemptSearchjournalsIJournalSearchprogramIProgramSearchprogramStoreIProgramStoreprogramServiceIProgramServicemessagesIMessageSearchcontentsIContentSearchcontactsIContactSearchrestartCourseWhenCredentialExpiredbool
Methods
Handle(AchievementDeleted)
public void Handle(AchievementDeleted c)
Parameters
Handle(CredentialCreated)
public void Handle(CredentialCreated e)
Parameters
Handle(CredentialExpired2)
After a credential is expired, find any e-learning modules that are used to grant it, and restart those modules (i.e. remove course progression records and void assessment attempts).
public void Handle(CredentialExpired2 e)
Parameters
Handle(CredentialGranted3)
If the achievement has a valid webhook, then build and send an HTTP POST Request to the endpoint for this learner/achievement completion.
public void Handle(CredentialGranted3 x)