public void insertParticipant() {
graphController.setUpdateInProgress(true);
Participant toInsert = null;
//CUSTOM
Participants pars = null;
if (JaWE.BASIC_MODE) {
pars = this.getJaWEController().getSelectionManager().getWorkingPKG().getParticipants();
} else {
pars = getGraph().getWorkflowProcess().getParticipants();
}
//END CUSTOM
String idForVO = null;
boolean insertIntoCollection = false;
if (GraphEAConstants.PARTICIPANT_TYPE_FREE_TEXT_EXPRESSION.equals(subType)) {
if (!getGraphManager().isFreeTextExpressionParticipantShown()) {
toInsert = FreeTextExpressionParticipant.getInstance();
idForVO = toInsert.getId();
setSelectionMode();
} else {
return;
}
} else if (GraphEAConstants.PARTICIPANT_TYPE_COMMON_EXPRESSION.equals(subType)) {
toInsert = CommonExpressionParticipants.getInstance().generateCommonExpressionParticipant(getGraph().getXPDLObject());
idForVO = CommonExpressionParticipants.getInstance().getIdForVisualOrderEA(toInsert.getId());
} else {
toInsert = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(
pars, subType, false);
idForVO = toInsert.getId();
insertIntoCollection = true;
}
JaWEManager.getInstance().getJaWEController().startUndouableChange();
if (insertIntoCollection) {
pars.add(toInsert);
}
List vo = GraphUtilities.getParticipantVisualOrder(getGraph().getXPDLObject());
vo.add(idForVO);
GraphUtilities.setParticipantVisualOrder(getGraph().getXPDLObject(), vo);
getGraphManager().insertParticipantAndArrangeParticipants(toInsert);