public MapParameter UpdateBulkRelationship(IGlymaSession glymaSession, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary<DescriptorType, MapParameter> nodes, RelationshipType relationshipType)
{
MapSession session = glymaSession.Session;
MapParameters parameters = glymaSession.Parameters;
parameters.AddParameter(domainId);
parameters.AddParameter(relationshipId);
MapParameter response = null;
if (relationshipType != null)
{
MapTransactionWrapper updateRelationshipOpWrapper = new MapTransactionWrapper(glymaSession);
IMapTransaction updateRelationshipOpCore = (IMapTransaction)updateRelationshipOpWrapper;
updateRelationshipOpCore.OperationId = TransactionType.UpdateRelationship;
updateRelationshipOpWrapper.DomainParameter = domainId;
updateRelationshipOpWrapper.RelationshipParameter = relationshipId;
updateRelationshipOpCore.RelationshipTypeUid = relationshipType.Id;
session.Enqueue(updateRelationshipOpWrapper);
if (responseParameter == Guid.Empty)
{
response = updateRelationshipOpWrapper.ResponseParameter;
}
else
{
response = updateRelationshipOpWrapper.BuildResponseParameterFromGuid(responseParameter);
}
}
if (nodes != null)
{
foreach (KeyValuePair<DescriptorType, MapParameter> descriptorToUpdate in nodes)
{
parameters.AddParameter(descriptorToUpdate.Value);
MapTransactionWrapper updateDescriptorOpWrapper = new MapTransactionWrapper(glymaSession);
IMapTransaction updateDescriptorOpCore = (IMapTransaction)updateDescriptorOpWrapper;
updateDescriptorOpCore.OperationId = TransactionType.UpdateDescriptor;
updateDescriptorOpWrapper.DomainParameter = domainId;
updateDescriptorOpWrapper.RelationshipParameter = relationshipId;
updateDescriptorOpWrapper.NodeParameter = descriptorToUpdate.Value;
updateDescriptorOpCore.DescriptorTypeUid = descriptorToUpdate.Key.Id;
session.Enqueue(updateDescriptorOpWrapper);
}
}
glymaSession.PersistSessionObject();
return response;
}