Exemple #1
0
        public Proxy.IRelationship CreateRelationship(TransactionFramework.ISoapTransactionLink transactionLink, Guid domainId, Guid rootMapId, Dictionary <Proxy.ConnectionType, Proxy.INode> nodes, Proxy.RelationshipType relationshipType, string originalId)
        {
            FacadeRelationship facadeRelationship = new FacadeRelationship();

            InProcess.InProcessRelationship relationship = new InProcess.InProcessRelationship(MapManager);
            relationship.OriginLink       = transactionLink;
            relationship.Facade           = facadeRelationship;
            relationship.Id               = Guid.NewGuid();
            relationship.DomainId         = domainId;
            relationship.RootMapId        = rootMapId;
            relationship.RelationshipType = relationshipType;
            relationship.OriginalId       = originalId;
            relationship.Status           = Proxy.LoadState.Full;

            facadeRelationship.BaseRelationship = relationship;

            foreach (KeyValuePair <Proxy.ConnectionType, Proxy.INode> relationshipContext in nodes)
            {
                Proxy.ConnectionSet connection = Proxy.ConnectionSetFactory.Instance.GetConnection(relationshipContext.Value, facadeRelationship, relationshipContext.Key);

                Proxy.INodeManager newRelationshipNodes = relationship.Nodes;
                newRelationshipNodes.Load(connection);

                Proxy.IRelationshipManager nodeRelationships = relationshipContext.Value.Relationships;
                nodeRelationships.Load(connection);
            }

            InProcessRelationships.Add(transactionLink, facadeRelationship);

            return(facadeRelationship);
        }
Exemple #2
0
        public virtual void ConnectNode(ConnectionType connectionType, INode node, ref Soap.TransactionFramework.TransactionChain chain)
        {
            InProcess.InProcessRelationship inProcessRelationship = this as InProcess.InProcessRelationship;
            Proxy.ConnectionSet             connectionSet;

            if (inProcessRelationship != null)
            {
                connectionSet = Proxy.ConnectionSetFactory.Instance.GetConnection(node, inProcessRelationship.Facade, connectionType);
            }
            else
            {
                connectionSet = Proxy.ConnectionSetFactory.Instance.GetConnection(node, this, connectionType);
            }

            Proxy.INodeManager nodes = Nodes;
            nodes.Load(connectionSet);

            Proxy.IRelationshipManager relationships = node.Relationships;
            relationships.Load(connectionSet);
        }