public void Reset() { _onCompletedBound = false; _domainParameter = null; _rootMapParameter = null; _nodeParameter = null; _relationshipParameter = null; if (MetadataSet != null) { Proxy.FacadeMetadataSet metadataSet = MetadataSet as Proxy.FacadeMetadataSet; if (metadataSet != null) { metadataSet.ResetToFacade(); } } ResponseParameter = null; TransactionStatus = ServerStatus.ProcessingClient; if (_firstLink != null) { ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; executor.TransactionFailed -= OnTransactionFailed; executor.TransactionCompleted -= OnTransactionCompleted; } if (ServiceProxy != null) { ServiceProxy.BOCCompleted -= OnSubmitBulkOperationCompleted; ServiceProxy.MACompleted -= OnAddMetadataCompleted; } }
public void Reset() { _onCompletedBound = false; _domainParameter = null; _rootMapParameter = null; if (_inProcessResponse != null) { FacadeRelationship facadeRelationship = _inProcessResponse as FacadeRelationship; if (facadeRelationship != null) { facadeRelationship.ResetToFacade(); } } ResponseParameter = null; TransactionStatus = ServerStatus.ProcessingClient; if (_firstLink != null) { ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; executor.TransactionFailed -= OnTransactionFailed; executor.TransactionCompleted -= OnTransactionCompleted; } if (ServiceProxy != null) { ServiceProxy.BOCCompleted -= OnSubmitBulkOperationCompleted; ServiceProxy.RACompleted -= OnAddRelationshipCompleted; } }
DependencyCollection ISoapTransactionLinkExecutor.UpdateDependencies() { ISoapTransactionLinkExecutor executor = (ISoapTransactionLinkExecutor)this; foreach (KeyValuePair <Proxy.ConnectionType, Proxy.INode> nodePairs in ProxyNodeConnections) { Proxy.IFacade iFacadeNode = nodePairs.Value as Proxy.IFacade; if (iFacadeNode != null) { if (!iFacadeNode.IsConcrete) { FacadeNode facadeNode = iFacadeNode as FacadeNode; InProcess.InProcessNode inProcessNode = facadeNode.BaseNode as InProcess.InProcessNode; if (inProcessNode != null && inProcessNode.OriginLink != null && inProcessNode.OriginLink.OriginChain != OriginChain) { executor.Dependencies.AddFacade(iFacadeNode); } } } } return(executor.Dependencies); }
public void ExecuteTransaction(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy) { if (TransactionExecuting != null) { System.EventArgs emptyEventArgs = new System.EventArgs(); TransactionExecuting(this, emptyEventArgs); } ISoapTransactionLinkExecutor executor = Start; if (!_onCompletedBound) { LastLink.AddNextLink(End); executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } if (IsBulkChain) { Service.OPS bulkOperations = new Service.OPS(); executor.ExecuteBulkTransactions(sessionId, serviceProxy, ref bulkOperations); } else { executor.ExecuteTransaction(sessionId, serviceProxy); } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { IsBulkExecution = true; ISoapTransactionLinkExecutor executor = this; executor.ExecuteTransaction(sessionId, serviceProxy); }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { TransactionStatus = ServerStatus.SendingTransaction; SessionId = sessionId; ServiceProxy = serviceProxy; ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BNA nodeBulkOperation = new Service.BNA(); nodeBulkOperation.I = TransactionLinkId; nodeBulkOperation.D = DomainParameter.GetParameterValue(sessionId); nodeBulkOperation.RM = RootMapParameter.GetParameterValue(sessionId); nodeBulkOperation.T = MapManager.NodeTypes.ConvertProxyToService(NodeType); nodeBulkOperation.O = OriginalId; nodeBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(nodeBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { TransactionStatus = ServerStatus.TransactionReceived; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } TransactionStatus = ServerStatus.TransactionExecuting; DebugLogger.Instance.LogMsg("Executing add node transaction. ClientId - '{0}';", _inProcessResponse.ClientId); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += new EventHandler <BOCCompletedEventArgs>(OnSubmitBulkOperationCompleted); ServiceProxy.SubmitBulkOperationsAsync(CallingUrl.Url, SessionId, bulkOperations, this); } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, Service.TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { SessionId = sessionId; ServiceProxy = serviceProxy; ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BMA metadataBulkOperation = new Service.BMA(); metadataBulkOperation.I = TransactionLinkId; metadataBulkOperation.D = DomainParameter.GetParameterValue(sessionId); metadataBulkOperation.RM = RootMapParameter.GetParameterValue(sessionId); metadataBulkOperation.N = NodeParameter.GetParameterValue(sessionId); metadataBulkOperation.R = RelationshipParameter.GetParameterValue(sessionId); metadataBulkOperation.DT = MapManager.ConnectionTypes.ConvertProxyToService(ConnectionType); metadataBulkOperation.T = MapManager.MetadataTypes.ConvertProxyToService(MetadataType); metadataBulkOperation.MN = Name; metadataBulkOperation.MV = Value; metadataBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(metadataBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } DebugLogger.Instance.LogMsg("Executing add metadata transaction. Name - '{0}'; Value - '{1}';", Name, Value); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += new EventHandler <Service.BOCCompletedEventArgs>(OnSubmitBulkOperationCompleted); ServiceProxy.SubmitBulkOperationsAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString(), SessionId, bulkOperations, this); } }
public void Reset() { foreach (ISoapTransactionLink link in Transactions.Values) { ISoapTransactionLinkExecutor executor = link as ISoapTransactionLinkExecutor; if (executor != null) { executor.Reset(); } } }
private void OnBeginTransactionCompleted(object sender, Service.BeginTransactionCompletedEventArgs e) { if (e.UserState != this) { // This event is for a different object so don't execute. return; } // The following lines must be done so that the transaction isn't executed again. ServiceProxy.BeginTransactionCompleted -= OnBeginTransactionCompleted; if (e.Error != null) { Service.CompleteTransactionCompletedEventArgs completedEventArgs = new Service.CompleteTransactionCompletedEventArgs(null, e.Error, false, null); if (InternalTransactionCompleted != null) { InternalTransactionCompleted(this, completedEventArgs); } return; } ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } Guid sessionId = e.Result; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } if (IsBulkExecution) { Service.OPS bulkOperations = new Service.OPS(); bulkOperations.O = new System.Collections.ObjectModel.ObservableCollection <object>(); executor.ExecuteBulkTransactions(sessionId, ServiceProxy, ref bulkOperations); } else { executor.ExecuteTransaction(sessionId, ServiceProxy); } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { SessionId = sessionId; ServiceProxy = serviceProxy; /// TODO: This may need to be changed so that this update transaction link is called if the NodeType on the INode object is assigned. Need to consider what is the best method. Node.NodeType = NodeType; ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BNU nodeBulkOperation = new Service.BNU(); nodeBulkOperation.I = TransactionLinkId; nodeBulkOperation.D = DomainParameter.GetParameterValue(sessionId); nodeBulkOperation.N = NodeParameter.GetParameterValue(SessionId); nodeBulkOperation.T = MapManager.NodeTypes.ConvertProxyToService(NodeType); nodeBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(nodeBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } DebugLogger.Instance.LogMsg("Executing update node transaction. NodeId - '{0}'; NodeTypeName - '{1}'", Node.Id, NodeType.Name); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += OnSubmitBulkOperationCompleted; ServiceProxy.SubmitBulkOperationsAsync(CallingUrl.Url, SessionId, bulkOperations, this); } }
private void OnAddRelationshipCompleted(object sender, Service.RACompletedEventArgs e) { if (e.UserState != this) { // This event is for a different object so don't execute. return; } TransactionStatus = ServerStatus.TransactionReceived; // The following line must be done so that the transaction isn't executed again. ServiceProxy.RACompleted -= OnAddRelationshipCompleted; if (e.Error != null) { TransactionStatus = ServerStatus.TransactionCompleted; Service.CompleteTransactionCompletedEventArgs completedEventArgs = new Service.CompleteTransactionCompletedEventArgs(null, e.Error, false, null); if (InternalTransactionCompleted != null) { InternalTransactionCompleted(this, completedEventArgs); } return; } ResponseParameter = e.Result; ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("The next link in the chain is not a supported type of link or the next link is null. This link does not implement ISoapTransactionLinkExecutor."); } TransactionStatus = ServerStatus.TransactionExecuting; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } DebugLogger.Instance.LogMsg("Executing add relationship transaction. ResponseParameter Id - '{0}'; ClientId - '{1}';", ResponseParameter.I, CreateInProcessObjects().ClientId); executor.ExecuteTransaction(SessionId, ServiceProxy); }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { SessionId = sessionId; ServiceProxy = serviceProxy; ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BMU metadataBulkOperation = new Service.BMU(); metadataBulkOperation.I = TransactionLinkId; metadataBulkOperation.D = DomainParameter.GetParameterValue(sessionId); metadataBulkOperation.M = MetadataParameter.GetParameterValue(sessionId); metadataBulkOperation.MN = Name; metadataBulkOperation.MV = Value; metadataBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(metadataBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } DebugLogger.Instance.LogMsg("Executing update metadata transaction. Name - '{0}'; Value - '{1}'; MetadataId - '{2}'", Name, Value, Metadata.Id); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += new EventHandler <BOCCompletedEventArgs>(OnSubmitBulkOperationCompleted); ServiceProxy.SubmitBulkOperationsAsync(CallingUrl.Url, SessionId, bulkOperations, this); } }
public DependencyCollection UpdateDependencies() { foreach (ISoapTransactionLink transaction in Transactions.Values) { ISoapTransactionLinkExecutor executor = transaction as ISoapTransactionLinkExecutor; if (executor != null) { DependencyCollection dependencies = executor.UpdateDependencies(); Dependencies.UnionWith(dependencies); } } return(Dependencies); }
void OnSubmitBulkOperationCompleted(object sender, Service.BOCCompletedEventArgs e) { if (e.UserState != this) { // This event is for a different object so don't execute. return; } TransactionStatus = ServerStatus.TransactionReceived; // The following lines must be done so that the transaction isn't executed again. ServiceProxy.BOCCompleted -= OnSubmitBulkOperationCompleted; if (e.Error != null) { TransactionStatus = ServerStatus.TransactionFailed; if (InternalTransactionFailed != null) { InternalTransactionFailed(this, e); } return; } OriginChain.FillBulkOperations(e.DecompressedResult); Service.OPS newBulkOperationsSet = new Service.OPS(); newBulkOperationsSet.O = new System.Collections.ObjectModel.ObservableCollection <object>(); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } TransactionStatus = ServerStatus.TransactionExecuting; DebugLogger.Instance.LogMsg("Executing add relationship transaction. ResponseParameter Id - '{0}'; ClientId - '{1}';", ResponseParameter.I, CreateInProcessObjects().ClientId); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref newBulkOperationsSet); }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { SessionId = sessionId; ServiceProxy = serviceProxy; if (bulkOperations.O.Count > 0) { TransactionStatus = ServerStatus.SendingTransaction; ServiceProxy.BOCCompleted += OnSubmitBulkOperationCompleted; ServiceProxy.SubmitBulkOperationsAsync(CallingUrl.Url, SessionId, bulkOperations, this); } else { ISoapTransactionLinkExecutor executor = this; executor.ExecuteTransaction(sessionId, serviceProxy); } }
public void Reset() { _onCompletedBound = false; TransactionStatus = ServerStatus.ProcessingClient; if (_firstLink != null) { ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; executor.TransactionFailed -= OnTransactionFailed; executor.TransactionCompleted -= OnTransactionCompleted; } if (ServiceProxy != null) { ServiceProxy.BeginTransactionCompleted -= OnBeginTransactionCompleted; } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, Service.TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { SessionId = sessionId; ServiceProxy = serviceProxy; if (bulkOperations.O.Count > 0) { TransactionStatus = ServerStatus.SendingTransaction; ServiceProxy.BOCCompleted += OnSubmitBulkOperationCompleted; ServiceProxy.SubmitBulkOperationsAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString(), SessionId, bulkOperations, this); } else { ISoapTransactionLinkExecutor executor = this; executor.ExecuteTransaction(sessionId, serviceProxy); } }
private void OnAddMetadataCompleted(object sender, Service.MACompletedEventArgs e) { if (e.UserState != this) { // This event is for a different object so don't execute. return; } // The following lines must be done so that the transaction isn't executed again. ServiceProxy.MACompleted -= OnAddMetadataCompleted; if (e.Error != null) { Service.CompleteTransactionCompletedEventArgs completedEventArgs = new Service.CompleteTransactionCompletedEventArgs(null, e.Error, false, null); if (InternalTransactionCompleted != null) { InternalTransactionCompleted(this, completedEventArgs); } return; } ResponseParameter = e.Result; ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } DebugLogger.Instance.LogMsg("Executing add metadata transaction. ResponseParameter Id - '{0}'; Name - '{1}'; Value - '{2}';", ResponseParameter.I, Name, Value); executor.ExecuteTransaction(SessionId, ServiceProxy); }
public void FillBulkOperations(ObservableCollection <Service.BOR> bulkOperationResponses) { foreach (Service.BOR bulkOperationResponse in bulkOperationResponses) { if (Transactions.ContainsKey(bulkOperationResponse.I)) { ISoapTransactionLink link = Transactions[bulkOperationResponse.I]; if (link is ISoapTransactionLinkExecutor) { ISoapTransactionLinkExecutor transactionLinkExecutor = link as ISoapTransactionLinkExecutor; transactionLinkExecutor.ConsumeBulkOperationResponse(bulkOperationResponse); } } else { DebugLogger.Instance.LogMsg("A bulk operation response was returned that has no caller in this transaction chain."); } } }
DependencyCollection ISoapTransactionLinkExecutor.UpdateDependencies() { ISoapTransactionLinkExecutor executor = (ISoapTransactionLinkExecutor)this; Proxy.IFacade iFacadeMetadata = Metadata as Proxy.IFacade; if (iFacadeMetadata != null) { if (!iFacadeMetadata.IsConcrete) { Proxy.FacadeMetadataSet facadeMetadata = iFacadeMetadata as Proxy.FacadeMetadataSet; InProcess.InProcessMetadata inProcessMetadata = facadeMetadata.BaseMetadata as InProcess.InProcessMetadata; if (inProcessMetadata != null && inProcessMetadata.OriginLink != null && inProcessMetadata.OriginLink.OriginChain != OriginChain) { executor.Dependencies.AddFacade(iFacadeMetadata); } } } return(executor.Dependencies); }
void OnSubmitBulkOperationCompleted(object sender, BOCCompletedEventArgs e) { ServiceProxy.BOCCompleted -= OnSubmitBulkOperationCompleted; if (e.Error != null) { TransactionStatus = ServerStatus.TransactionFailed; if (InternalTransactionFailed != null) { InternalTransactionFailed(this, e); } return; } OriginChain.FillBulkOperations(e.DecompressedResult); ISoapTransactionLinkExecutor executor = this; executor.ExecuteTransaction(SessionId, ServiceProxy); }
DependencyCollection ISoapTransactionLinkExecutor.UpdateDependencies() { ISoapTransactionLinkExecutor executor = (ISoapTransactionLinkExecutor)this; IFacade iFacadeNode = Node as IFacade; if (iFacadeNode != null) { if (!iFacadeNode.IsConcrete) { FacadeNode facadeNode = iFacadeNode as FacadeNode; InProcess.InProcessNode inProcessNode = facadeNode.BaseNode as InProcess.InProcessNode; if (inProcessNode != null && inProcessNode.OriginLink != null && inProcessNode.OriginLink.OriginChain != OriginChain) { executor.Dependencies.AddFacade(iFacadeNode); } } } return(executor.Dependencies); }
DependencyCollection ISoapTransactionLinkExecutor.UpdateDependencies() { ISoapTransactionLinkExecutor executor = (ISoapTransactionLinkExecutor)this; IFacade iFacadeRelationship = Relationship as IFacade; if (iFacadeRelationship != null) { if (!iFacadeRelationship.IsConcrete) { FacadeRelationship facadeRelationship = iFacadeRelationship as FacadeRelationship; InProcess.InProcessRelationship inProcessRelationship = facadeRelationship.BaseRelationship as InProcess.InProcessRelationship; if (inProcessRelationship != null && inProcessRelationship.OriginLink != null && inProcessRelationship.OriginLink.OriginChain != OriginChain) { executor.Dependencies.AddFacade(iFacadeRelationship); } } } return(executor.Dependencies); }
public void Reset() { _onCompletedBound = false; _domainParameter = null; _nodeParameter = null; ResponseParameter = null; TransactionStatus = ServerStatus.ProcessingClient; if (_firstLink != null) { ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; executor.TransactionFailed -= OnTransactionFailed; executor.TransactionCompleted -= OnTransactionCompleted; } if (ServiceProxy != null) { ServiceProxy.BOCCompleted -= OnSubmitBulkOperationCompleted; ServiceProxy.NUCompleted -= OnUpdateNodeCompleted; } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { TransactionStatus = ServerStatus.SendingTransaction; SessionId = sessionId; ServiceProxy = serviceProxy; Dictionary <Service.DT, Service.MP> nodeConnections = new Dictionary <Service.DT, Service.MP>(); foreach (KeyValuePair <Service.DT, SoapTransactionLinkParameter> keyValuePair in TransactionLinkConnections) { Service.DT descriptorType = keyValuePair.Key; Service.MP parameter = keyValuePair.Value.GetParameterValue(sessionId); nodeConnections[descriptorType] = parameter; } /// TODO: This may need to be changed so that this update transaction link is called if the NodeType on the INode object is assigned. Need to consider what is the best method. Relationship.RelationshipType = RelationshipType; foreach (KeyValuePair <ConnectionType, INode> connectionPairs in ProxyNodeConnections) { Relationship.Nodes.UpdateConnection(connectionPairs.Key, connectionPairs.Value); } ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BRU relationshipBulkOperation = new Service.BRU(); relationshipBulkOperation.I = TransactionLinkId; relationshipBulkOperation.D = DomainParameter.GetParameterValue(sessionId); relationshipBulkOperation.R = RelationshipParameter.GetParameterValue(SessionId); relationshipBulkOperation.N = nodeConnections; relationshipBulkOperation.T = MapManager.RelationshipTypes.ConvertProxyToService(RelationshipType); relationshipBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(relationshipBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { TransactionStatus = ServerStatus.TransactionReceived; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } TransactionStatus = ServerStatus.TransactionExecuting; DebugLogger.Instance.LogMsg("Executing update relationship transaction. ClientId - '{0}';", Relationship.ClientId); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += new EventHandler <BOCCompletedEventArgs>(OnSubmitBulkOperationCompleted); ServiceProxy.SubmitBulkOperationsAsync(CallingUrl.Url, SessionId, bulkOperations, this); } }
void ISoapTransactionLinkExecutor.ExecuteBulkTransactions(Guid sessionId, Service.TransactionalMappingToolServiceClient serviceProxy, ref Service.OPS bulkOperations) { TransactionStatus = ServerStatus.SendingTransaction; SessionId = sessionId; ServiceProxy = serviceProxy; Dictionary <Service.DT, Service.MP> nodeConnections = new Dictionary <Service.DT, Service.MP>(); foreach (KeyValuePair <Service.DT, SoapTransactionLinkParameter> keyValuePair in TransactionLinkConnections) { Service.DT descriptorType = keyValuePair.Key; Service.MP parameter = keyValuePair.Value.GetParameterValue(sessionId); nodeConnections[descriptorType] = parameter; } ResponseParameter = new Service.MP(); ResponseParameter.I = Guid.NewGuid(); ResponseParameter.S = sessionId; ResponseParameter.V = Guid.Empty; ResponseParameter.D = true; ResponseParameter.T = Service.MapParameterType.Node; Service.BRA relationshipBulkOperation = new Service.BRA(); relationshipBulkOperation.I = TransactionLinkId; relationshipBulkOperation.D = DomainParameter.GetParameterValue(sessionId); relationshipBulkOperation.RM = RootMapParameter.GetParameterValue(sessionId); relationshipBulkOperation.N = nodeConnections; relationshipBulkOperation.T = MapManager.RelationshipTypes.ConvertProxyToService(RelationshipType); relationshipBulkOperation.O = OriginalId; relationshipBulkOperation.RI = ResponseParameter.I; bulkOperations.O.Add(relationshipBulkOperation); ISoapTransactionLinkExecutor executor = _firstLink as ISoapTransactionLinkExecutor; if (executor == null) { DebugLogger.Instance.LogMsg("Exception: This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); throw new NotSupportedException("This is not a supported type of link. This link does not implement ISoapTransactionLinkExecutor."); } if (bulkOperations.O.Count < 200) { TransactionStatus = ServerStatus.TransactionReceived; if (!_onCompletedBound) { executor.TransactionFailed += OnTransactionFailed; executor.TransactionCompleted += OnTransactionCompleted; _onCompletedBound = true; } TransactionStatus = ServerStatus.TransactionExecuting; DebugLogger.Instance.LogMsg("Executing add relationship transaction. ClientId - '{0}';", CreateInProcessObjects().ClientId); executor.ExecuteBulkTransactions(SessionId, ServiceProxy, ref bulkOperations); } else { ServiceProxy.BOCCompleted += new EventHandler <Service.BOCCompletedEventArgs>(OnSubmitBulkOperationCompleted); ServiceProxy.SubmitBulkOperationsAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString(), SessionId, bulkOperations, this); } }