Designing Agent-Oriented Systems by Analysing Agent Interactions