urbanairship-core/src/main/java/com/urbanairship/automation/AutomationEngine.java
@WorkerThread
    private void onScheduleFinishedExecuting(final ScheduleEntry scheduleEntry) {
        if (scheduleEntry == null) {
            return;
        }

        Logger.verbose("AutomationEngine - Schedule finished: " + scheduleEntry.scheduleId);

        // Update the count
        scheduleEntry.setCount(scheduleEntry.getCount() + 1);

        boolean isOverLimit = scheduleEntry.isOverLimit();

        // Expired
        if (scheduleEntry.isExpired()) {
            handleExpiredEntry(scheduleEntry);
            return;
        }

        if (isOverLimit) {
            // At limit
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_FINISHED);

            // Delete the schedule if its finished and no edit grace period is defined
            if (scheduleEntry.getEditGracePeriod() <= 0) {
                dataManager.deleteSchedule(scheduleEntry.scheduleId);
                return;
            }

        } else if (scheduleEntry.getInterval() > 0) {
            // Execution interval
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_PAUSED);
            scheduleIntervalAlarm(scheduleEntry, scheduleEntry.getInterval());
        } else {
            // Back to idle
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_IDLE);
        }

        dataManager.saveSchedule(scheduleEntry);
    }
/**
     * Called when a schedule is finished executing.
     *
     * @param scheduleEntry The schedule entry.
     */
Called when a schedule is finished executing.
@param scheduleEntry The schedule entry.
Called when a schedule is finished executing . @param scheduleEntry The schedule entry .
@WorkerThread
    private void onScheduleFinishedExecuting(final ScheduleEntry scheduleEntry) {
        if (scheduleEntry == null) {
            return;
        }
        Logger.verbose("AutomationEngine - Schedule finished: " + scheduleEntry.scheduleId);
        scheduleEntry.setCount(scheduleEntry.getCount() + 1);
        boolean isOverLimit = scheduleEntry.isOverLimit();
        if (scheduleEntry.isExpired()) {
            handleExpiredEntry(scheduleEntry);
            return;
        }
        if (isOverLimit) {
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_FINISHED);
            if (scheduleEntry.getEditGracePeriod() <= 0) {
                dataManager.deleteSchedule(scheduleEntry.scheduleId);
                return;
            }
        } else if (scheduleEntry.getInterval() > 0) {
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_PAUSED);
            scheduleIntervalAlarm(scheduleEntry, scheduleEntry.getInterval());
        } else {
            scheduleEntry.setExecutionState(ScheduleEntry.STATE_IDLE);
        }
        dataManager.saveSchedule(scheduleEntry);
    }
@ WorkerThread private void onScheduleFinishedExecuting ( final ScheduleEntry scheduleEntry ) { if ( scheduleEntry == null ) { return ; } Logger . verbose ( "AutomationEngine - Schedule finished: " + scheduleEntry . scheduleId ) ; scheduleEntry . setCount ( scheduleEntry . getCount ( ) + 1 ) ; boolean isOverLimit = scheduleEntry . isOverLimit ( ) ; if ( scheduleEntry . isExpired ( ) ) { handleExpiredEntry ( scheduleEntry ) ; return ; } if ( isOverLimit ) { scheduleEntry . setExecutionState ( ScheduleEntry . STATE_FINISHED ) ; if ( scheduleEntry . getEditGracePeriod ( ) <= 0 ) { dataManager . deleteSchedule ( scheduleEntry . scheduleId ) ; return ; } } else if ( scheduleEntry . getInterval ( ) > 0 ) { scheduleEntry . setExecutionState ( ScheduleEntry . STATE_PAUSED ) ; scheduleIntervalAlarm ( scheduleEntry , scheduleEntry . getInterval ( ) ) ; } else { scheduleEntry . setExecutionState ( ScheduleEntry . STATE_IDLE ) ; } dataManager . saveSchedule ( scheduleEntry ) ; }
Called when a schedule is finished executing.
Called when a schedule is finished executing .
// Update the count // Expired // At limit // Delete the schedule if its finished and no edit grace period is defined // Execution interval // Back to idle