lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
MethodOverride RequestReceive (NamedValueTree nvt_i)
{
  TextBody:
  [*
    sourceKind  := LibInt_MessageAccessor::GetHeaderPropertyAsString( nvt_i, LibDMF_CommunicationChannel::HEADER_SOURCEKIND()  );
    sourceName  := LibInt_MessageAccessor::GetHeaderPropertyAsString( nvt_i, LibDMF_CommunicationChannel::HEADER_SOURCENAME()  );
    messageType := LibInt_MessageAccessor::GetHeaderPropertyAsString( nvt_i, LibDMF_CommunicationChannel::HEADER_MESSAGETYPE() );
    messageID   := LibInt_MessageAccessor::GetHeaderPropertyAsString( nvt_i, LibDMF_CommunicationChannel::HEADER_MESSAGEID()   );
    requestID   := LibInt_MessageAccessor::GetHeaderPropertyAsString( nvt_i, LibDMF_CommunicationChannel::HEADER_REQUESTID()   );
    
    root := this.CommunicationChannelRoot();
    
    // Retrieve IntegrationEvent
    event := root.EventGetLast( sourceKind, sourceName );
    
    // Log this action for tracing and update the IntegrationEvent
    LibDMF_Util::Trace( sourceName, messageID, messageType, "", false, true );
    root.EventUpdateTraceInfo( event, messageID, requestID, messageType, "" );
    
    // Temporary store the RequestID, so it can be added to the header of the response that will be send.
    this.RequestID( requestID );
    
    root.EventLogActivity( event,
                           "Received request '" + messageType + "' for CommunicationChannel = '" + this.Name() + "'; MessageID = " + messageID + ", RequestID = " + requestID );
    
    if( messageType = LibDMF_CommunicationChannel::REQUEST_GETHIERARCHY() )
    {
      this.RequestReceiveGetHierarchy( nvt_i );
    }
    
    else
    {
      // Handle requests that are not specific for a Hierarchy Channel.
      super.RequestReceive( nvt_i );
    }
    
    // Reset the RequestID
    this.RequestID( LibDMF_CommunicationChannel::REQUEST_NO_ID() );
  *]
}