*/
public boolean execute() throws ActionException {
boolean executed = false;
if (getSession() == null && getTransaction() == null) {
String error = "Action must be within a session or within a transaction";
throw new ActionException(error, this);
}
try {
if (getName().equals("add")) {
executed = getEntities().add(updateEntity);
} else if (getName().equals("remove")) {
executed = getEntities().remove(entity);
} else if (getName().equals("update")) {
executed = getEntities().update(entity, updateEntity);
}
} catch (ActionException e) {
log.error("Error in EntitiesAction.execute: " + e.getMessage());
throw new ActionException(e.getMessage(), this);
}
if (executed) {
setStatus("executed");
if (getTransaction() == null) {
DomainModel domainModel = (DomainModel) getSession()