Search in sources :

Example 1 with TCleanup

use of org.apache.ode.bpel.dd.TCleanup in project carbon-business-process by wso2.

the class ProcessConfigurationImpl method getCronJobs.

public List<CronJob> getCronJobs() {
    List<CronJob> jobs = new ArrayList<CronJob>();
    for (TSchedule schedule : processInfo.getScheduleList()) {
        CronJob job = new CronJob();
        try {
            job.setCronExpression(new CronExpression(schedule.getWhen()));
            for (final TCleanup aCleanup : schedule.getCleanupList()) {
                CleanupInfo cleanupInfo = new CleanupInfo();
                assert !aCleanup.getFilterList().isEmpty();
                cleanupInfo.setFilters(aCleanup.getFilterList());
                ProcessCleanupConfImpl.processACleanup(cleanupInfo.getCategories(), aCleanup.getCategoryList());
                Scheduler.JobDetails runnableDetails = new Scheduler.JobDetails();
                runnableDetails.getDetailsExt().put(BPELConstants.ODE_DETAILS_EXT_CLEAN_UP_INFO, cleanupInfo);
                runnableDetails.setProcessId(processId);
                runnableDetails.getDetailsExt().put(BPELConstants.ODE_DETAILS_EXT_TRANSACTION_SIZE, 10);
                job.getRunnableDetailList().add(runnableDetails);
            }
            jobs.add(job);
        } catch (ParseException pe) {
            log.error("Exception during parsing the schedule cron expression: " + schedule.getWhen() + ", skipped the scheduled job.", pe);
        }
    }
    return jobs;
}
Also used : Scheduler(org.apache.ode.bpel.iapi.Scheduler) ArrayList(java.util.ArrayList) CronExpression(org.apache.ode.utils.CronExpression) ParseException(java.text.ParseException) TCleanup(org.apache.ode.bpel.dd.TCleanup) TSchedule(org.apache.ode.bpel.dd.TSchedule)

Aggregations

ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 TCleanup (org.apache.ode.bpel.dd.TCleanup)1 TSchedule (org.apache.ode.bpel.dd.TSchedule)1 Scheduler (org.apache.ode.bpel.iapi.Scheduler)1 CronExpression (org.apache.ode.utils.CronExpression)1