如何在 Batch class 的任何情况下强制执行 Batch 模式?

How to force Batch mode executing in any case for Batch class?

在任何情况下,我都需要强制 my custom class 的批处理模式通过代码扩展 RunBaseBatch。用户无法更改执行模式。

调度模式只能是批处理.

我尝试在 main 方法中使用,在 promt 命令之前 这些代码行:

className.mustGoBatch();
className.parmInBatch(true);
className.doBatch();

但是工作,我看到标志批处理关闭。

谢谢

使用className.batchInfo().parmBatchExecute(NoYes::Yes);

参见 Tutorial_RunbaseBatch class 例如:

static void main(Args args)
{
    Tutorial_RunbaseBatch    tutorial_RunBase;
;
    tutorial_RunBase = Tutorial_RunbaseBatch::construct();

    // add this parm to switch on a batch processing
    tutorial_RunBase.batchInfo().parmBatchExecute(NoYes::Yes);

    if (tutorial_RunBase.prompt())
        tutorial_RunBase.run();
}