how to schedule batch JOB for my AOT job

hie team,
i need 2 do the batch scheduling process for the following code ,so that i can change my status from open to Processed after giving a specific time in
Recurrence.The code is as follows.
static void RtlGroup(Args _args)
{
RetailTransactionTable retailTransTable;
RetailTransactionSalesTrans retailSalesTable;
RetailTransactionPaymentTrans retailTransPaymTrans;
RetailPosBatchTable retailPosbatch;
Alars_table2 alarsTable;
RetailStoreCashDeclarationTable retailCashDeclTable;

ttsBegin;

while select forUpdate alarsTable where
(alarsTable.Status == RtlStatus::Open)
{

//inserting into retailtransactiontable logon

retailTransTable.store = alarsTable.StoreId;
retailTransTable.terminal = alarsTable.TerminalId;
retailTransTable.transDate = alarsTable.ShiftDate;
retailTransTable.transactionId = “630”;
retailTransTable.statementCode = “SEATTLE-1”;
retailTransTable.BatchID = alarsTable.BatchId;
retailTransTable.BatchTerminalId = “SEATTLE-1”;
retailTransTable.createdOnPosTerminal=“SEATTLE-1”;
retailTransTable.exchRate = alarsTable.ExchRate;
retailTransTable.replicationCounterFromOrigin = 198;
retailTransTable.staff = alarsTable.StaffId;
retailTransTable.timeWhenTotalPressed = timeNow();
retailTransTable.timeWhenTransClosed=timeNow();
retailTransTable.toAccount= NoYes::No;
retailTransTable.transTime = timeNow();
retailTransTable.type = RetailTransactionType::Logon;
retailTransTable.wrongShift = NoYes::No;
if(retailTransTable.validateWrite())
retailTransTable.insert();
info(“inserted into transaction login table”);

//inserting into RetailTransactiontable sales

retailTransTable.amountToAccount = alarsTable.GrossAmount;
retailTransTable.receiptId = alarsTable.ReceiptId;
retailTransTable.BatchID = alarsTable.BatchId;
retailTransTable.BatchTerminalId = “SEATTLE-1”;
retailTransTable.createdOnPosTerminal = “SEATTLE-1”;
retailTransTable.currency = alarsTable.Currency;
retailTransTable.custAccount = alarsTable.CustAccount;
retailTransTable.exchRate = alarsTable.ExchRate;
retailTransTable.grossAmount = -alarsTable.GrossAmount;
retailTransTable.paymentAmount = alarsTable.GrossAmount;
retailTransTable.netAmount = alarsTable.NetAmount;
retailTransTable.replicationCounterFromOrigin = 199;
retailTransTable.staff = alarsTable.StaffId;
retailTransTable.statementCode = “SEATTLE-1”;
retailTransTable.store = alarsTable.StoreId;
retailTransTable.terminal = alarsTable.TerminalId;
retailTransTable.timeWhenTotalPressed = timeNow();
retailTransTable.timeWhenTransClosed = timeNow();
retailTransTable.toAccount= NoYes::Yes;
retailTransTable.transactionId = “631”;
retailTransTable.transDate = systemDateGet();
retailTransTable.transTime = timeNow();
retailTransTable.type = RetailTransactionType::Sales;
retailTransTable.wrongShift = NoYes::No;
if(retailTransTable.validateWrite())
retailTransTable.insert();
info(“inserted into transaction sales table”);

//inserting into RetailTransactiontable logout details
retailTransTable.BatchID = alarsTable.BatchId;
retailTransTable.BatchTerminalId = “SEATTLE-1”;
retailTransTable.createdOnPosTerminal = “SEATTLE-1”;
retailTransTable.exchRate = alarsTable.ExchRate;
retailTransTable.replicationCounterFromOrigin = 200;
retailTransTable.staff = alarsTable.StaffId;
retailTransTable.statementCode = “SEATTLE-1”;
retailTransTable.store = alarsTable.StoreId;
retailTransTable.terminal = alarsTable.TerminalId;
retailTransTable.timeWhenTotalPressed=timeNow();
retailTransTable.timeWhenTransClosed=timeNow();
retailTransTable.toAccount= NoYes::No;
retailTransTable.transactionId = “632”;
retailTransTable.transDate=systemDateGet();
retailTransTable.transTime=timeNow();
retailTransTable.type= RetailTransactionType::CloseShift;
retailTransTable.wrongShift=NoYes::No;
if(retailTransTable.validateWrite())
retailTransTable.insert();
info(“inserted into transaction logout table”);

//inserting into transaction table startup amount

retailTransTable.BatchID = alarsTable.BatchId;
retailTransTable.BatchTerminalId = “SEATTLE-1”;
retailTransTable.currency=“USD”;
retailTransTable.numberOfPaymentLines = 2;
retailTransTable.exchRate = alarsTable.ExchRate;
retailTransTable.replicationCounterFromOrigin = 301;
retailTransTable.staff = alarsTable.StaffId;
retailTransTable.statementCode = “SEATTLE-1”;
retailTransTable.store = alarsTable.StoreId;
retailTransTable.terminal = alarsTable.TerminalId;
retailTransTable.timeWhenTotalPressed=timeNow();
retailTransTable.timeWhenTransClosed=timeNow();
retailTransTable.transactionId = “633”;
retailTransTable.transDate=systemDateGet();
retailTransTable.transTime=timeNow();
retailTransTable.type= RetailTransactionType::StartingAmount;

if(retailTransTable.validateWrite())
retailTransTable.insert();
info(“inserted into transaction startup amount table”);

//insertion into payment table sales

retailTransPaymTrans.receiptId = alarsTable.ReceiptId;
retailTransPaymTrans.lineNum = 1;
retailTransPaymTrans.amountCur = alarsTable.GrossAmount;
retailTransPaymTrans.currency = alarsTable.Currency;
retailTransPaymTrans.store = alarsTable.StoreId;
retailTransPaymTrans.terminal = alarsTable.TerminalId;
retailTransPaymTrans.transDate = alarsTable.ShiftDate;
retailTransPaymTrans.transactionId = “631”;
retailTransPaymTrans.staff = alarsTable.StaffId;
retailTransPaymTrans.amountMST = alarsTable.GrossAmount;
retailTransPaymTrans.amountTendered = alarsTable.GrossAmount;
retailTransPaymTrans.counter=1;
retailTransPaymTrans.exchRate = alarsTable.ExchRate;
retailTransPaymTrans.exchRateMST = 100;
retailTransPaymTrans.managerKeyLive = NoYes::No;
retailTransPaymTrans.qty =1;
retailTransPaymTrans.replicationCounterFromOrigin = 61;
retailTransPaymTrans.transTime=timeNow();
retailTransPaymTrans.tenderType=“1”;
if(retailTransPaymTrans.validateWrite())
retailTransPaymTrans.insert();
info(“inserted into transaction payment table”);

//insertion into payment table startup amount+

retailTransPaymTrans.lineNum = 1;
retailTransPaymTrans.amountCur = alarsTable.CashDeclAmount;
retailTransPaymTrans.amountMST = 0;
retailTransPaymTrans.currency = alarsTable.Currency;
retailTransPaymTrans.store = alarsTable.StoreId;
retailTransPaymTrans.terminal = alarsTable.TerminalId;
retailTransPaymTrans.transDate = alarsTable.ShiftDate;
retailTransPaymTrans.transactionId = “633”;
retailTransPaymTrans.staff = alarsTable.StaffId;
retailTransPaymTrans.amountTendered = alarsTable.CashDeclAmount;
retailTransPaymTrans.counter=1;
retailTransPaymTrans.exchRate = alarsTable.ExchRate;
retailTransPaymTrans.tenderType = “1”;
retailTransPaymTrans.qty =1;
retailTransPaymTrans.replicationCounterFromOrigin = 43;
retailTransPaymTrans.transTime=timeNow();
if(retailTransPaymTrans.validateWrite())
retailTransPaymTrans.insert();
info(“inserted into transaction payment amount+ table”);

//inserting into payment table startup amount-
retailTransPaymTrans.lineNum = 2;
retailTransPaymTrans.amountCur = -alarsTable.CashDeclAmount;
retailTransPaymTrans.amountMST = 0;
retailTransPaymTrans.currency = alarsTable.Currency;
retailTransPaymTrans.store = alarsTable.StoreId;
retailTransPaymTrans.terminal = alarsTable.TerminalId;
retailTransPaymTrans.transDate = alarsTable.ShiftDate;
retailTransPaymTrans.transactionId = “633”;
retailTransPaymTrans.staff = alarsTable.StaffId;
retailTransPaymTrans.amountTendered = -alarsTable.CashDeclAmount;
retailTransPaymTrans.counter=2;
retailTransPaymTrans.exchRate = alarsTable.ExchRate;
retailTransPaymTrans.tenderType = “9”;
retailTransPaymTrans.qty = 1;
retailTransPaymTrans.replicationCounterFromOrigin = 44;
retailTransPaymTrans.transTime = timeNow();
if(retailTransPaymTrans.validateWrite())
retailTransPaymTrans.insert();
//info(“inserted into transaction payment amount- table”);
//}

//inserting into RetailTransactionSalesTrans Table
retailSalesTable.receiptId = alarsTable.ReceiptId;
retailSalesTable.lineNum = 1;
retailSalesTable.store = alarsTable.StoreId;
retailSalesTable.terminalId = alarsTable.TerminalId;
retailSalesTable.transDate = alarsTable.ShiftDate;
retailSalesTable.transactionId = “631”;
retailSalesTable.custAccount = alarsTable.CustAccount;
retailSalesTable.staffId = alarsTable.StaffId;
retailSalesTable.counter=1;
retailSalesTable.giftcard = NoYes::No;
retailSalesTable.itemId=“0113”;
retailSalesTable.itemIdScanned = NoYes::No;
retailSalesTable.keyboardItemEntry= NoYes::Yes;
retailSalesTable.netAmount = -alarsTable.NetAmount;
retailSalesTable.netAmountInclTax = -alarsTable.NetAmount;
retailSalesTable.OriginalTaxGroup=“WA”;
retailSalesTable.OriginalTaxItemGroup=“RP”;
retailSalesTable.price = alarsTable.NetAmount;
retailSalesTable.qty = 1;
retailSalesTable.replicationCounterFromOrigin = 41;
retailSalesTable.salesType= RetailItemSalesType::Item;
retailSalesTable.taxAmount = -6.5;
retailSalesTable.transactionCode = RetailItemTransactionCode::ItemOnFile;
retailSalesTable.unitQty = -1;
retailSalesTable.unit = “ea”;
retailSalesTable.taxGroup = “WA”;
retailSalesTable.TaxItemGroup = “RP”;
if(retailSalesTable.validateWrite())
retailSalesTable.insert();
info(“inserted into sales table”);

//inserting data into retailposbatch table
retailPosbatch.BatchID = alarsTable.BatchId;
retailPosbatch.CloseDate=systemDateGet();
retailPosbatch.CloseTime=timeNow();
retailPosbatch.LogonsCount = 1;
retailPosbatch.Posted = NoYes::No;
retailPosbatch.ReplicationCounter = 13;
retailPosbatch.SalesCount = 1;
retailPosbatch.SalesTotal = alarsTable.NetAmount;
retailPosbatch.StaffId = alarsTable.StaffId;
retailPosbatch.StartDate = systemDateGet();
retailPosbatch.Status= RetailPosBatchStatus::Closed;
retailPosbatch.StoreId = alarsTable.StoreId;
retailPosbatch.TerminalId = alarsTable.TerminalId;
retailPosbatch.TaxTotal = 6.5;
retailPosbatch.TransactionsCount = alarsTable.TransactionCountinPosTable;

retailPosbatch.StartTime = timeNow();
if(retailPosbatch.validateWrite())
retailPosbatch.insert();
info(“inserted into posbatch table”);

//inserting into retailstore cash declaration table
retailCashDeclTable.amount = alarsTable.CashDeclAmount;
retailCashDeclTable.currency = alarsTable.Currency;
retailCashDeclTable.storeId = alarsTable.StoreId;
retailCashDeclTable.type = RetailCoinNote::Note;
if(retailCashDeclTable.validateWrite())
retailCashDeclTable.insert();
info(“inserted into cash declaration table”);

//To update the status in the table
ttsBegin;
alarsTable.Status = RtlStatus::Processed;
alarsTable.Remarks = ‘’;
alarsTable.update();
ttsCommit;

}

ttsCommit;

}

i have been followed this link : msdn.microsoft.com/…/cc636647.aspx

In run method i have written my above code and tried to schedule the batch job, after setting the recurrence,it is not working .am i missing anything?

thanks
ankush jain