Trackign process stages in database. Now process state is read and write from database