Batch Process Automation: Theory and practice