Trigger events when generating.