yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Quintiq file version 2.0
#parent: #root
Job JobIncomingServiceLevels
{
  Description: 'Process mapped NVT request from QI'
  OnFailureText:
  [*
    MPSync::JobHandleMessageResponse( this.MDSMPSync().ID(), requestnvt, errormessage );
    MessageIntegrationLog::CreateError( this, MPSyncUtility::ID_ObjectGroup_ServiceLevels(), errormessage );
  *]
  Priority: 'Default'
  Text:
  [*
    //Process mapped NVT request from QI
    feedback    := '';
    objectgroup := MPSyncUtility::ID_ObjectGroup_ServiceLevels();
    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.ProcessIncomingServiceLevels( requestnvt, rootNamedValue, messagelog );
        }
      }
      // otherwise, process the single message
      else
      {
        rootNamedValue := requestnvt.Root();
        this.ProcessIncomingServiceLevels( 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 }
  ]
}