Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Job JobIncomingProduct 
 | 
{ 
 | 
  Description: 'Process mapped product NVT request from QI' 
 | 
  OnFailureText: 
 | 
  [* 
 | 
    MPSync::JobHandleMessageResponse( this.MDSMPSync().ID(), requestnvt, errormessage ); 
 | 
    MessageIntegrationLog::CreateError( this, MPSyncUtility::ID_ObjectGroup_Products(), errormessage ); 
 | 
  *] 
 | 
  Priority: 'Default' 
 | 
  Text: 
 | 
  [* 
 | 
    //Process mapped product NVT request from QI 
 | 
    feedback    := ''; 
 | 
    objectgroup := MPSyncUtility::ID_ObjectGroup_Products(); 
 | 
    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.ProcessIncomingProducts( requestnvt, rootNamedValue, messagelog ); 
 | 
        } 
 | 
      } 
 | 
      // otherwise, process single message 
 | 
      else 
 | 
      { 
 | 
        rootNamedValue := requestnvt.Root(); 
 | 
        this.ProcessIncomingProducts( 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 } 
 | 
  ] 
 | 
} 
 |