NEW RELEASE! The 2024x Refresh3 was released on July 11, 2025. For more information, see 2024x Refresh3 Version News.

Idle job service

The com.nomagic.magicdraw.job.IdleJobService allows to add com.nomagic.magicdraw.job.Job(s) which can be executed when a program is idle. The program decides when it is the most appropriate to execute the Job without getting the program into an inconsistent state. The example of usage:

Job job = new Job()
{  
    public boolean needsExecute()
    {
        return true;
    }
   
    public void execute(ProgressStatus progressStatus) throws Exception
    {
        // Do necessary work in the session.
    }
  
    public void finished()
    {
        // Cleanup after job is finished.
    }
   
    public String getName()
    {
        return "My Job";
    }
};
  
IdleJobService.getInstance().addJob(job);
  
// Remove the job when it is no longer necessary.
IdleJobService.getInstance().removeJob(job);

For more information please refer to <programinstallation directory>\openapi\examples\JobExample.

Related pages

Activity

All
Personal filters
All
No activities found