Statecharts composition to model topologically distributed applications