Maximo Wire - The IBM Maximo Help & Discussion Forum
May 23, 2012, 12:16:57 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: [1]   Go Down
  Print  
Author Topic: CRON TASK in MAXIMO 5.2  (Read 913 times)
0 Members and 2 Guests are viewing this topic.
hapurohi
Newbie
*

Karma: 0
Posts: 5


View Profile Email
« on: April 14, 2011, 01:28:56 pm »

Hi all,
        Can anybody explain me all the steps for configuring and creating Crontask in MAXIMO 5.2. I just want to know flow of execution about Crontask.

Thanks
Logged
maurogrz
Global Moderator
Full Member
*****

Karma: 14
Posts: 111



View Profile Email
« Reply #1 on: April 15, 2011, 12:19:14 pm »

you have to define your own class that extends the SimpleCronTask
here you have to code the init() and the cronAction() methods.
At last you have to put a few lines in the maximo.properties to activate the crontask (and then rebuild/redeploy)

Logged
hapurohi
Newbie
*

Karma: 0
Posts: 5


View Profile Email
« Reply #2 on: April 21, 2011, 05:54:30 am »

thanks for such a useful response.
could u plz show me the code, which i have to write in MXSERVER.PROPERTIES file to activate crontask?




regards,
Harry
Logged
maurogrz
Global Moderator
Full Member
*****

Karma: 14
Posts: 111



View Profile Email
« Reply #3 on: April 21, 2011, 04:36:31 pm »

this is an example for the class:

package psdi.cust.app.workorder;

import java.io.FileOutputStream;
import java.io.PrintStream;
import java.rmi.RemoteException;
import java.util.Properties;
import java.util.*;
import psdi.mbo.*;
import psdi.security.SecurityServiceRemote;
import psdi.security.UserInfo;
import psdi.server.*;
import psdi.util.*;

public class MyNewCronTask extends SimpleCronTask
{

   public CreateWorkOrderFromExternalCronTask()
   {
      initialized = false;
      userInfo = null;
      configData = null;
      isSystem = true;
   }

   public void init()
   {
      //PUT HERE YOUR INITIALIZATION ACTIVITIES (if you have some)
      initialized = true;
   }

   public String getName()
   {
      return "CreateWorkOrderFromExternalCronTask";
   }

   public void cronAction()
   {
      if(!initialized)
         return;
      //PUT HERE WHAT THE CRON TASK SHOULD DO
   }

   private MXServer mxserver;
   private boolean initialized;
   private UserInfo userInfo;
   private Properties configData;
   private String logFilePath;
   private static final String varNames[] = {"NO", "YES"};
   PrintStream logWriter;
   boolean isSystem;

}


in the mxserver.properties you have to insert your new cron task setting his timing.

mxe.cronTask.psdi.app.report.MyNewCronTask =5m


have a try !
Mauro


Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!