String jobName = null;
long startTime = UtilDateTime.getNextDayStart(UtilDateTime.nowTimestamp()).getTime();
RecurrenceInfo info;
// run every day when day start
info = RecurrenceInfo.makeInfo(delegator, startTime, 4, 1, -1);
infoId = info.primaryKey();
// set the persisted fields
GenericValue enumeration = delegator.findByPrimaryKey("Enumeration", UtilMisc.toMap("enumId", autoPrefEnumId));
jobName = enumeration.getString("description");
if (jobName == null) {
jobName = Long.toString((new Date().getTime()));