@Override
public GroupOperationSchedule scheduleGroupOperation(Subject subject, int compatibleGroupId,
int[] executionOrderResourceIds, boolean haltOnFailure, String operationName, Configuration parameters,
Trigger trigger, String notes) throws SchedulerException {
ResourceGroup group = getCompatibleGroupIfAuthorized(subject, compatibleGroupId);
ensureControlPermission(subject, group);
validateOperationNameAndParameters(group.getResourceType(), operationName, parameters);
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put(OperationJob.DATAMAP_STRING_OPERATION_NAME, operationName);
putDisplayName(jobDataMap, group.getResourceType().getId(), operationName);
if (parameters != null) {
if (parameters.getId() == 0) {
entityManager.persist(parameters);
}
jobDataMap.putAsString(OperationJob.DATAMAP_INT_PARAMETERS_ID, parameters.getId());
}
jobDataMap.putAsString(OperationJob.DATAMAP_INT_SUBJECT_ID, subject.getId());
jobDataMap.putAsString(GroupOperationJob.DATAMAP_INT_GROUP_ID, group.getId());
jobDataMap.putAsString(GroupOperationJob.DATAMAP_BOOL_HALT_ON_FAILURE, haltOnFailure);
if ((executionOrderResourceIds != null) && (executionOrderResourceIds.length > 0)) {
StringBuilder orderString = new StringBuilder();
orderString.append(executionOrderResourceIds[0]);