AX2012 batch process using sysOperation framework

Example : https://stoneridgesoftware.com/batch-processing-in-dynamics-ax-2012-using-sysoperation-framework/

first , define a controller

class ACT_ProcessMessageLogController extends SysOperationServiceController
{
    #define.ToDate('toDate')
}
public static ACT_ProcessMessageLogController construct(SysOperationExecutionMode _mode = SysOperationExecutionMode::Synchronous)
{
    ACT_ProcessMessageLogController    controller;
    ACT_ProcessMessageLogContract      contract;
    ;

    controller = new ACT_ProcessMessageLogController(classStr(ACT_ProcessMessageLogService),
                                                     methodStr(ACT_ProcessMessageLogService, processMessages),
                                                     _mode);

    controller.parmDialogCaption(literalStr("QC Scheduler Job"));
    contract = controller.getDataContractObject();
    contract.parmToDate(systemDateGet()+1);

    return controller;
}
public static void main(Args args)
{
    ACT_ProcessMessageLogController controller = ACT_ProcessMessageLogController::construct();
    ;

    controller.startOperation();
}

second, defind a contract:

[
    DataContractAttribute
]
class ACT_ProcessMessageLogContract
{
    TransDate   toDate;
}
[DataMemberAttribute,
 SysOperationLabelAttribute("@SYS35904")]
public TransDate parmToDate(TransDate _toDate = toDate)
{
    toDate = _toDate;

    return toDate;
}

third ,denfie service and entry point


AX2012 batch process using sysOperation framework_第1张图片
image.png

你可能感兴趣的:(AX2012 batch process using sysOperation framework)