| Quintiq file version 2.0 | 
| #parent: #root | 
| Method RequestReceive (NamedValueTree nvt_i) | 
| { | 
|   Description: | 
|   [* | 
|     Receive a Request from a System. | 
|     (1) This method is overridden for the HierarchyChannel in order to deal with Hierarchy-related requests. | 
|   *] | 
|   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, "" ); | 
|      | 
|     // In case of a HierarchyChannel some actions have already been done at Hierarchy-level before this method was called. | 
|     // These actions should not be done again. | 
|     if( not this.IsHierarchyChannel() ) | 
|     { | 
|       // 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_GETSET() ) | 
|     { | 
|       this.RequestReceiveGetSet( nvt_i ); | 
|     } | 
|     else if( messageType = LibDMF_CommunicationChannel::REQUEST_GETSETSFORTYPE() ) | 
|     { | 
|       this.RequestReceiveGetSetsForType( nvt_i ); | 
|     } | 
|     else | 
|     { | 
|       root.EventLogActivityError( event, | 
|                                   "Received unknown request '" + messageType + "' for CommunicationChannel = '" + this.Name() + "'", | 
|                                   "Received unknown request '" + messageType + "' for CommunicationChannel = '" + this.Name() + "'; MessageID = " + messageID  + ", RequestID = " + requestID ); | 
|     } | 
|      | 
|     // Reset the RequestID | 
|     this.RequestID( LibDMF_CommunicationChannel::REQUEST_NO_ID() ); | 
|   *] | 
| } |