cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

It there any OOTB event to know whether Consignment created in hybris

Former Member
0 Kudos
369

Hi ALL

Can you please let me know if there is any ootb event to know the consignment is created in hybris. I have found one event called ConsignmentProcessingEvent, but not sure what it is used for. If no event, what process should be followed. Should I go for interceptor?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hello Gopi,

There is no interceptor that gets triggered when the ConsignmentModel is created. ConsignmentProcessingEvent is just the Abstract base class for all OrderProcess events. And events just hold the necessary data to be passed to the EventListener, they're not responsible for detecting when a model instance gets created.

To detect creation of consignment you should implement your own interceptor that implements InitDefaultsInterceptor. Here you can find a simple explanation: https://www.stackextend.com/hybris/use-interceptors-in-sap-hybris/

Hope that helps,

Former Member
0 Kudos

Thanks for the reply

As you suggested InitDefaultsInterceptor would be invoked when an instance of a model is created. i.e;modelService.create(ConsignmentModel.class) My requirement is to get the consignment when it is successfully saved into the database. So, in this case, I can go with PrepareInterecptor which can be invoked when the model is saved.

Regards GopiChand