on 2017 Nov 25 4:20 PM
Hello EveryOne,
Could you explain how to configure and work EventService, in details
Thanks M Imam
Event is a simple class, can be triggered using eventService and handled by EventListener.
Steps :
1) Create a java class by extending AbstractEvent
2) Create EventListener by extending AbstractEventListener and override onEvent method. inside this method you can write your business logic. register bean for listener in spring.xml
3)Trigger event from any class by using eventService.publishEvent(new SampleEvent)
Have a look into RegisterEvent in OOTB. Here system will send notification mail to customer after creation of new account.
RegisterEvent will be triggered from register method of CustomerAccountService after successfull creation of new customer, then onEvent method of RegistrationEventListener will be executed, here you have logic to send notification to customer about account creation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.