Auto Comment Code of Workflow on DocType

Where is the code to create auto comment while saving doctype which has workflow attached?