support callback in generate rule