Documentation for a newer release is available. View Latest

Scheduling Your First Job (via HTTP Client Library)

There are a few things to set up to start scheduling your first IPF Scheduler job. We’ll do them in the most sensible order possible.

You will create a command and a ScheduleJobSpecification that uses that command to define the job to run, then send the ScheduleJobSpecification to the external Persistent Scheduler application by using the SchedulerConnectorInterface scheduleJob method.

Step 1: Create a command

This is a command that will be sent to your SchedulingHelper, which has to extend com.iconsolutions.ipf.core.platform.api.models.ExternalTriggerCommand.

Here’s an example of one:

    public static class MyCommand implements ExternalTriggerCommand {

        public MyCommand() {
            super();
        }

        public MyCommand(String triggerType, String source, String unitOfWorkId) {
            super(triggerType, source, unitOfWorkId);
        }

        public MyCommand(String triggerType, String source, String unitOfWorkId, Map<String, String> additionalProperties) {
            super(triggerType, source, unitOfWorkId, additionalProperties);
        }
    }
Your Persistent Scheduler application must have a SchedulingHelper Spring Bean that supports your SchedulingCommand implementation. See Register a SchedulingHelper.

Step 2: Schedule the job

Now we tell the SchedulerConnectorInterface to schedule our job with our command at a specific time.

In the below example we are running our job every 5 seconds.

    public void scheduleJob() {
        schedulerConnectorInterface.scheduleJob(new ScheduleJobSpecification()
                .jobSpecificationKey(new JobSpecificationKey("my-special-job-wow"))
                .schedulingSpecification("*/5 * * ? * *")
                .jobRequestor("test-requestor")
                .triggerIdentifier("trigger-identifier")
                .triggerCommand(new MyCommand(
                        "INSTRUCTION_PAYMENT_RELEASE",
                        "source-system-identifier",
                        "5147d836-7701-48f3-bcb1-ff40dcc1291d"));
    }

Note that if you want a non-repeating job, you can use singleSchedule and pass in a Calendar instance representing the desired trigger time, instead of supplying a cron-style schedulingSpecification.

That’s it! You can now check your external Persistent Scheduler application to ensure the scheduled jobs are executed!