participantBuilder.setDialog(dialog);
if(!participantBuilder.buildParticipant(p)) {
logger.info("Participant build was incomplete; see previous log entries for details.");
alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
.getString("campaign.manager.actions.participant.create.error.build_incomplete.text")));
return;
}
}
catch(ObjectBuilderException e) {
logger.error("Exception while trying to build participant: " + e.getLocalizedMessage(), e);
alertService
.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
return;
}
if(campaign != null) {
campaign.addParticipant(p);
}
// save the participant and the campaign
try {
participantManager.registerParticipant(p);
if(campaign != null) {
campaign.save();
}
}
catch(Exception e) {
logger.error("Exception while trying to save participant: " + e.getLocalizedMessage(), e);
alertService
.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
}
// open editor
try {
logger.info("Attempting to open editor for participant: " + p);
EditorUtils.editObject(p);
}
catch(Exception e) {
logger.error("Exception while trying to open participant editor: " + e.getLocalizedMessage(), e);
alertService
.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
}
logger.info("Done executing 'create participant' action.");
}