private IList <UddiTModel> GetUddiTModels(IList <UddiId> uddiIds) { get_tModelDetail getTModelDetail = new get_tModelDetail(); getTModelDetail.tModelKey = new string[uddiIds.Count]; for (int i = 0; i < uddiIds.Count; i++) { getTModelDetail.tModelKey[i] = uddiIds[i].ID; } tModelDetail tmodelDetails = this.uddiProxy.get_tModelDetail(getTModelDetail); if (tmodelDetails.tModel == null) { return(new List <UddiTModel>()); } IList <UddiTModel> uddiTmodels = new List <UddiTModel>(); foreach (tModel tmodel in tmodelDetails.tModel) { UddiTModel uddiTmodel = new UddiTModel(tmodel); uddiTmodels.Add(uddiTmodel); } return(uddiTmodels); }
public List <ProcessDefinition> GetProcessDefinitions(List <UddiId> processDefinitionIds) { IList <UddiId> missingIds = new List <UddiId>(); List <UddiTModel> foundTModels = new List <UddiTModel>(); //Check the cache for any existing tmodels. foreach (UddiId processDefinitionId in processDefinitionIds) { UddiTModel tmodel = null; if (uddiTModelCache.TryGetValue(processDefinitionId, out tmodel)) { foundTModels.Add(tmodel); continue; } missingIds.Add(processDefinitionId); } //Get the tmodels not in the cache IList <UddiTModel> tmodels = this.GetUddiTModels(missingIds); //Adds the tmodels to the cache foreach (UddiTModel tmodel in tmodels) { uddiTModelCache.Set(tmodel.UddiId, tmodel); } List <ProcessDefinition> processDefinitions = new List <ProcessDefinition>(); foundTModels.AddRange(tmodels); foreach (UddiTModel tmodel in foundTModels) { UddiId uddiId = tmodel.UddiId; string name = tmodel.Name; string description = tmodel.Description; string profileId = tmodel.GetProfileId(); string profileTypeId = tmodel.GetProfileTypeId(); string registrationConformanceClaim = tmodel.GetRegistrationConformanceClaim(); ProcessDefinition processDefinition = new ProcessDefinition(uddiId, name, description, profileId, profileTypeId, registrationConformanceClaim); processDefinitions.Add(processDefinition); } return(processDefinitions); }