Best practice for creating process programmatically

What have you done already to achieve this? You can programmatically model diagrams using the modeling API only.