Submitting a job to calculate a global aggregate

After you define a global entity aggregate or global event aggregate in a .agg file, you can submit a job in a Java™ agent to start the calculation of the aggregate.

About this task

In a Java agent, you must prefix defvar to the variable name.

To use the JobService and JobException interfaces, you must import the com.ibm.ia.global.jobs package.

Procedure

Call the submitJob method of the JobService interface.
The following example code fragment submits a global entity aggregate job by using the service.submitJob method. The method references the MaxSessionSize global aggregate, which is defined in a .agg file:
// to submit a job.  an import statement from JobService and JobException was added

try
{
       JobService service = getJobService();
       service.submitJob("defvarMaxSessionSize");
}
catch (JobException jexc)
{
       jexc.printStackTrace();
}

The job is submitted asynchronously and is started in the background. Submitted jobs are queued and if the agent is processing an event, the job starts after the agent processing finishes.