static void Job_ScheduleBatch2(Args _args)
{
BatchHeader batHeader;
BatchInfo batInfo;
RunBaseBatch rbbTask;
str ParmCaption = "My Demonstration";
;
rbbTask = new Batch4DemoClass();
batInfo = rbbTask .batchInfo();
batInfo .parmCaption(ParmCaption);
batInfo .parmGroupId(""); // The "Empty batch group".
batHeader = BatchHeader ::construct();
batHeader .addTask(rbbTask);
batHeader .save();
info(strFmt("'%1' batch has been scheduled.", ParmCaption));
}
class Batch4DemoClass extends RunBaseBatch
{
public void run()
{
// The purpose of your job.
info(strFmt("Hello from Batch4DemoClass .run at %1"
,DateTimeUtil ::toStr(
DateTimeUtil ::utcNow())
));
}
public container pack()
{
return conNull();
}
public boolean unpack(container packedClass)
{
return true;
}
}