
Hi
I am new to AIF , i have deployed a outbound port and using file system adapter.
Requirement is:
Whenever a new product A001 is created , i trigger a message(XML) to send to an External system using outbound port . XML message has a node status with value NEW for newly created product. example
Like : <status> NEW </status> , once the product is created it is added to the Queue.
Next time when a released product is modified , say you update a inventory unit, on released product form , a new message is triggered with the status updated.
Issue: When user creates a new product, 1 messages is moved to queue and it remains there unless user has not run the JOB to move the message outside AX , after that when user updates/modifies a field on the same released product , the new message overrides the 1st message, and QueueManager allows only one record at any point of time, for that product. how do i make sure that Queue Allows multiple records or process the 1st message before second message is put into the queue?
I have written send electronically method on Inventtable table and calling it from insert and update method.
server void sendElectronically(XMLDocPurpose _xmlDocPurpose, AifSendMode _aifSendMode = AifSendMode::Async)
{
AxdSendContext axdSendContext = AxdSendContext::construct();
AifEntityKey aifEntityKey = AifEntityKey::construct();
Map keyData;
AifConstraint aifConstraint = new AifConstraint() ;
AifConstraintList aifConstraintList = new AifConstraintList();
;
keyData = SysDictTable::getKeyData(this);
aifEntityKey.parmTableId(this.TableId);
aifEntityKey.parmRecId(this.RecId);
aifEntityKey.parmKeyDataMap(keyData);
axdSendContext.parmXMLDocPurpose(_xmlDocPurpose);
axdSendContext.parmSecurity(false);
// aifConstraint.parmType(AifConstraintType:);
aifConstraint.parmId(this.ItemId);
aifConstraintList.addConstraint(aifConstraint);
AifSendService::submitDefault(
classNum(InventItemService),
aifEntityKey,
aifConstraintList,
_aifSendMode,
axdSendContext.pack());
}
running below job for testing purpose to process the messages outside AX.
static void DAXProcessAIF(Args _args)
{
//Outbound
new AifOutboundProcessingService().run(); // process messages in queue
new AifGateWaySendService().run(); // send messages*/
info('Done');
}
is it a good idea to put below lines.
new AifOutboundProcessingService().run(); // process messages in queue
new AifGateWaySendService().run();
in send electronically method?
AxdSendContext axdSendContext = AxdSendContext::construct();
AifEntityKey aifEntityKey = AifEntityKey::construct();
Map keyData;
AifConstraint aifConstraint = new AifConstraint() ;
AifConstraintList aifConstraintList = new AifConstraintList();
;
keyData = SysDictTable::getKeyData(this);
aifEntityKey.parmTableId(this.TableId);
aifEntityKey.parmRecId(this.RecId);
aifEntityKey.parmKeyDataMap(keyData);
axdSendContext.parmXMLDocPurpose(_xmlDocPurpose);
axdSendContext.parmSecurity(false);
// aifConstraint.parmType(AifConstraintType:);
aifConstraint.parmId(this.ItemId);
aifConstraintList.addConstraint(aifConstraint);
AifSendService::submitDefault(
classNum(InventItemService),
aifEntityKey,
aifConstraintList,
_aifSendMode,
axdSendContext.pack());
*This post is locked for comments
I have the same question (0)