Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method ReceiveRequestSyncNotification ( 
 | 
  String origin_node_id, 
 | 
  String notification_info 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    slave_node := this.GetSlaveNode( origin_node_id ); 
 | 
    connector := this.DistributedServiceProviderBase().Connector(); 
 | 
    dsp := this.DistributedServiceProviderBase(); 
 | 
     
 | 
    dsp.Log( "Received sync request for slave " + origin_node_id + " for state " + notification_info, false ) 
 | 
    assert( not isnull( slave_node ), "Received request sync notification from unknown slave node" ); 
 | 
     
 | 
    requested_state := [Number] notification_info; 
 | 
    state_message := select( this, OutboundMasterQueue.Message, msg, msg.StateSeqNr() = requested_state ); 
 | 
     
 | 
    // Currently we always do full sync since sending notification (in the else) won't work 
 | 
    // while processing this incoming notifification. Might have to do with sync soap calls? 
 | 
    if ( true or isnull( state_message ) or state_message.istype( DSP_FullSyncMessage ) ) 
 | 
    { 
 | 
      // Full sync needed since requested state is not found   
 | 
      slave_node.LastSentOperationMessage( relset, this.OutboundMasterQueue().LastMessage() ); 
 | 
      connector_node := select( connector, Node, node, node.NodeId() = origin_node_id ); 
 | 
      this.DistributedServiceProviderBase().OnMasterNeedSentFullSync( connector_node ); 
 | 
      dsp.Log( "Requested full sync or sync state not available -> Requesting full sync", false ); 
 | 
    } 
 | 
    else 
 | 
    { 
 | 
      // Full sync not needed, can just reset the message to be sent 
 | 
      connector.SentNotification( origin_node_id 
 | 
                                , DSP_DistributedServiceProviderBase::NotificationType_RequestSyncAck() 
 | 
                                , "" 
 | 
                                ); 
 | 
                                 
 | 
      dsp.Log( "Requested sync state found -> Notified slave.", false);                             
 | 
    } 
 | 
  *] 
 | 
} 
 |