Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creating custom jobs

A custom generic job jobs should implement in both Java and .Net the IJob Blueriq interface. The execute(IExecutionContext context) method defined in the IJob interface is going to be executed when the job is executed. The job's scheduler and the job's parameters can be accessed from the execution context: context.getParameters() and context.getScheduler().

Example

 

UI Expand
titleJava

The Blueriq scheduler when executes the job looks for an object with the scheduled job's type in the application context. As a consequence at execution a bean of the scheduled job type should be available in the application context.

 

Code Block
@Component
public class MyJob implements IJob {

 @Override
 public void execute(IExecutionContext context) {
	IJobParamters paramters = context.getParameters();
	IScheduler scheduler = context.getScheduler();     
 }
}
 
UI Expand
title.NET

//TODO update where the .NET job shoulbe be available

Code Block
public class TestJob : BQ.IJob
{
    public void execute(BQ.IExecutionContext context)
    {
        BQ.IJobParamters parameters = context.getParameters();
        BQ.IScheduler scheduler = context.getScheduler();     
    }
}

Scheduling, unscheduling and rescheduling custom jobs

Scheduling custom jobs

Unscheduling custom jobs

Rescheduling custom jobs