use of org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter in project ovirt-engine by oVirt.
the class AddRoleWithActionGroupsCommand method executeCommand.
@Override
protected void executeCommand() {
prepareRoleForCommand();
TransactionSupport.executeInNewTransaction(() -> {
roleDao.save(getRole());
getCompensationContext().snapshotNewEntity(getRole());
getCompensationContext().stateChanged();
return null;
});
ActionReturnValue attachAction = runInternalAction(ActionType.AttachActionGroupsToRole, new ActionGroupsToRoleParameter(getRole().getId(), getParameters().getActionGroups()));
if (!attachAction.isValid() || !attachAction.getSucceeded()) {
List<String> failedMsgs = getReturnValue().getExecuteFailedMessages();
for (String msg : attachAction.getValidationMessages()) {
failedMsgs.add(msg);
}
setSucceeded(false);
return;
}
setSucceeded(true);
getReturnValue().setActionReturnValue(getRole().getId());
}
Aggregations