There are 4 main AIF classes, I will be talking about the inbound only, and focusing on the included file system adapter and flat XML files. I hope this makes things a little less hazy.
AIFGatewayReceiveService
- Uses adapters/channels to read messages in from different sources, and dumps them in the AifGatewayQueue tableAIFInboundProcessingService
- This processes the AifGatewayQueue table data and sends to the Ax[Document] classesAIFOutboundProcessingService
- This is the inverse of #2. It creates XMLs with relevent metadataAIFGatewaySendService
- This is the inverse of #1, where it uses adapters/channels to send messages out to different locations from the AifGatewayQueue
For #1
So #1 basically fills the AifGatewayQueue
, which is just a queue of work. It loops through all of your channels and then finds the relevant adapter by ClassId. The adapters are classes that implement AifIntegrationAdapter
and AifReceiveAdapter
if you wanted to make your own custom one. When it loops over the different channels, it then loops over each "message" and tries to receive it into the queue.
If it can't process the file for some reason, it catches exceptions and throws them in the SysExceptionTable
[Basic>Periodic>Application Integration Framework>Exceptions]. These messages are scraped from the infolog, and the messages are generated mostly from the receive adaptor, which would be AifFileSystemReceiveAdapter
for my example.
For #2
So #2 is processing the inbound messages sitting in the queue (ready/inprocess). The AifRequestProcessor\processServiceRequest
does the work.
From this method, it will call:
- Various calls to
Classes\AifMessageManager
, which puts records in theAifMessageLog
and theAifDocumentLog
. - This key line:
responseMessage = AifRequestProcessor::executeServiceOperation(message, endpointActionPolicy);
which actually does the operation against the Ax[Document] classes by eventually getting toAifDispatcher::callServiceMethod(...)
- It gets the return XML and packages that into an AifMessage called
responseMessage
and returns that where it may be logged. It also takes that return value, and if there is a response channel, it submits that back into the AifGatewayQueue
AifQueueManager
is actually cleared and populated on the fly by calling AifQueueManager::createQueueManagerData();
.