Batch processing

When you use an asynchronous adapter such as the filesystem adapter or the MSMQ adapter, you will have to schedule batch tasks to process the messages that are exchanged.

To enable batch processing for asynchronous communication, perform the following steps:

  1. Navigate to System Administration | Inquiries | Batch jobs | Batch jobs.
  2. Press Ctrl + N to create a new batch job and enter a description; for example, AIF asynchronous processing.
  3. Select the new batch job and click on View tasks.
  4. Press Ctrl + N and enter AifGateWayReceiveService in the Class name field. Also, select the appropriate company account and save the record.
  5. Repeat the previous step for the AifInboundProcessingService, AifOutboundProcessingService, and AifGatewaySendService classes. Be sure to add them in that sequence.
  6. On all but the first task, add a record in the Has conditions grid. The Task ID field should point to the task that comes before it and the Expected status field should be set to Ended. This will help you make sure that the tasks are executed in the correct order.
  7. Exit the screen and click on Recurrence. Enter a recurrence pattern that fits your scenario and click on OK.
  8. Finally, navigate to Functions | Change status and set the status to Waiting.

When developing, waiting for a batch to start is not very efficient. The following job processes the asynchronous messages just as the batches do but saves you time because it can be run manually:

static void CVRRunAsycManually(Args _args)
{
   // read the messages
   new AifGateWayReceiveService().run();

   // process inbound messages in queue
   new AifInboundProcessingService().run();

   // process outbound messages in queue
   new AifOutboundProcessingService().run();

   // send messages
   new AifGateWaySendService().run();

   info('done'),
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.139.224