{
EditorVC editorVC = (EditorVC) editor;
if ((editor instanceof SubprocessEditorVC) && !editorVC.isTokenGameEnabled())
{
IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
String inputID = ((SubprocessEditorVC)editor).getSubprocessInput().getId();
String outputID = ((SubprocessEditorVC)editor).getId();
// Try to get the first source place of the model as well as the
// first sink place
// Note that there is a chance neither a source nor a sink actually exist
// so we need to check whether the iterator is valid!!
String ainputID = null;
String aoutputID = null;
Iterator<AbstractPetriNetElementModel> i = qualanService.getSinkPlaces().iterator();
if (i.hasNext())
ainputID = ((AbstractPetriNetElementModel) i.next()).getId();
i = qualanService.getSourcePlaces().iterator();
if (i.hasNext())
aoutputID = ((AbstractPetriNetElementModel) i.next()).getId();
if (qualanService.getNotStronglyConnectedNodes().size() > 0
|| qualanService.getSinkPlaces().size() > 1
|| qualanService.getSourcePlaces().size() > 1
|| inputID.equals(ainputID)
|| outputID.equals(aoutputID))
{
String errorMessage = Messages
.getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Start");
if (qualanService.getNotStronglyConnectedNodes().size() > 0)
{
errorMessage += Messages
.getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.StronglyConnected");
}
if (qualanService.getSourcePlaces().size() > 1)
{
errorMessage += Messages
.getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Source");
} else
{
if (inputID.equals(ainputID))
{
errorMessage += Messages
.getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Input");
}
}
if (qualanService.getSinkPlaces().size() > 1)
{
errorMessage += Messages
.getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Sink");
} else
{