Step 1. import psdi.app.system.CrontaskParamInfo;
Step 2. import java.rmi.RemoteException;
Step 3:
public class CustomCronTask extends SimpleCronTask{
CrontaskParamInfo parameters[] = new CrontaskParamInfo[2];
parameters[0] = new CrontaskParamInfo();
}
}
Step 4: ***** This is very important *****
i) If it is a new crontask, after creating an instance, parameters will display on the screen.
ii) If you are adding parameters to the existing crontask, then you have to create a new crontaskinstance and save the record. Then parameters will display on the screen.
Step 2. import java.rmi.RemoteException;
Step 3:
public class CustomCronTask extends SimpleCronTask{
public CrontaskParamInfo[] getParameters() throws MXException,RemoteException
{CrontaskParamInfo parameters[] = new CrontaskParamInfo[2];
parameters[0] = new CrontaskParamInfo();
parameters[0].setName("Parameter 1");
parameters[1] = new CrontaskParamInfo();
parameters[1].setName("Parameter 2");
return parameters;
}
Step 4: ***** This is very important *****
i) If it is a new crontask, after creating an instance, parameters will display on the screen.
ii) If you are adding parameters to the existing crontask, then you have to create a new crontaskinstance and save the record. Then parameters will display on the screen.
1 comment:
I have added the cron task parameter class and then placed at the location. I am getting the error that attribute does not exists when trying to create a new instance of the crron task
Post a Comment