Hello Martin,
Please find the class logic
public class TestClass extends RunBaseBatch implements BatchRetryable
{
FromDate fromDate;
ToDate toDate;
#define.CurrentVersion(1)
#localmacro.CurrentList
fromDate,
toDate
#endmacro
/// <summary>
///
/// </summary>
/// <returns></returns>
public container pack()
{
return [#CurrentVersion, #CurrentList];
}
/// <summary>
///
/// </summary>
/// <param name = "packedClass"></param>
/// <returns></returns>
public boolean unpack(container packedClass)
{
Version version = RunBase::getVersion(packedClass);
switch (version)
{
case #CurrentVersion:
[version, #CurrentList] = packedClass;
break;
default:
return false;
}
return true;
}
/// <summary>
///
/// </summary>
/// <param name = "_args"></param>
protected void initFromArgs(Args _args)
{
if (_args && _args.caller())
{
FormRun formRun = _args.caller();
callerDS = formRun.dataSource();
if (formHasMethod(formRun, identifierStr(xxxFromDate)))
{
fromDate = formRun.xxxFromDate();
}
if (formHasMethod(formRun, identifierStr(xxxToDate)))
{
toDate = formRun.xxxToDate();
}
}
}
/// <summary>
///
/// </summary>
protected void process()
{
//I have run the class a first time where fromDate=01/01/2024 and toDate=31/01/2024
//I have rerun the class where the fromDate is being initialized in the initFromArgs to new value 02/01/2024 and toDate=05/02/2024
//However, they are still fromDate=01/01/2024 and toDate=31/01/2024 when reaching in the process method
}
/// <summary>
///
/// </summary>
public void run()
{
this.process();
}
/// <summary>
///
/// </summary>
/// <param name = "_args"></param>
public static void main(Args _args)
{
TestClass manager = new TestClass();
manager.initFromArgs(_args);
if (manager.prompt())
{
manager.runOperation();
}
}
[Hookable(false)]
public boolean isRetryable()
{
return true;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
protected boolean canRunInNewSession()
{
return false;
}
public boolean canGoBatch()
{
return true;
}
}