Quintiq file version 2.0
|
#parent: #root
|
Job JobIncomingForecasts
|
{
|
Description: 'Process mapped NVT request from QI'
|
OnFailureText:
|
[*
|
MPSync::JobHandleMessageResponse( this.MDSMPSync().ID(), requestnvt, errormessage );
|
MessageIntegrationLog::CreateError( this, MPSyncUtility::ID_ObjectGroup_SalesDemand(), errormessage );
|
*]
|
Priority: 'Default'
|
Text:
|
[*
|
//Process mapped NVT request from QI
|
feedback := '';
|
objectgroup := MPSyncUtility::ID_ObjectGroup_Forecast();
|
if( this.IsImportObjectGroupExpectingMessage( objectgroup, feedback ) )
|
{
|
messagelog := MessageIntegrationLog::Create( this, objectgroup );
|
|
// Check if the incoming message is batched
|
size := LibInt_BatchAccessor::GetSize( requestnvt );
|
if( size > 1 )
|
{
|
for( i := 0; i < size; i++ )
|
{
|
rootNamedValue := LibInt_BatchAccessor::GetChildRoot( requestnvt, i );
|
this.ProcessIncomingForecasts( requestnvt, rootNamedValue, messagelog );
|
}
|
}
|
// otherwise, process single message
|
else
|
{
|
rootNamedValue := requestnvt.Root();
|
this.ProcessIncomingForecasts( requestnvt, rootNamedValue, messagelog );
|
}
|
|
messagelog.CompleteProcess();
|
MPSync::JobHandleMessageResponse( this.MDSMPSync().ID(), requestnvt, messagelog.Error() );
|
}
|
// Add error to message log
|
else
|
{
|
MPSync::JobHandleMessageResponse( this.MDSMPSync().ID(), requestnvt, feedback );
|
MessageIntegrationLog::CreateError( this, objectgroup, feedback );
|
}
|
*]
|
Arguments:
|
[
|
Argument requestnvt { Type: NamedValueTree }
|
]
|
}
|