Managing business workflows using a database approach: a formal model, a case study and a prototype