* Returns the first activity graph it can find with the given name and stereotype, if the stereotype is not
* specified (it is null) it will be ignored and the returned activity graph may have any arbitrary stereotype.
*/
static ActivityGraph findFirstActivityGraphWithNameAndStereotype(String name, String stereotypeName)
{
ActivityGraph graphWithNameAndStereotype = null;
Collection graphs = getModel().getActivityGraphs().getActivityGraph().refAllOfType();
for (final Iterator graphIterator = graphs.iterator();
graphIterator.hasNext() && graphWithNameAndStereotype == null;)
{
ActivityGraph graph = (ActivityGraph)graphIterator.next();
if (name.equals(graph.getName()))
{
if (stereotypeName == null || isStereotypePresent(graph, stereotypeName))
{
graphWithNameAndStereotype = graph;
}