Exemple #1
0
        private void SetSamePartToAll(object sender, RoutedEventArgs e)
        {
            if (xRepoItemPublisIngoGrid.CurrentItem != null)
            {
                try
                {
                    StartProcessingIcon();
                    RepositoryItemUsage repositoryItemUsage = (RepositoryItemUsage)xRepoItemPublisIngoGrid.CurrentItem;
                    foreach (RepositoryItemUsage usage in mRepoItemUsages)
                    {
                        usage.InsertRepositoryInsatncePosition = repositoryItemUsage.InsertRepositoryInsatncePosition;

                        if (usage.InsertRepositoryInsatncePosition == RepositoryItemUsage.eInsertRepositoryInsatncePosition.AfterSpecificActivity)
                        {
                            usage.ActivityNameList.ClearAll();
                            SetActivityList(usage);
                        }
                    }
                }
                finally
                {
                    StopProcessingIcon();
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectItem);
            }
        }
 private void AddUsage(ObservableList <RepositoryItemUsage> usagesList, RepositoryItemUsage usage)
 {
     lock (mAddUsageLock)
     {
         usagesList.Add(usage);
     }
 }
Exemple #3
0
        private static void SetActivityList(RepositoryItemUsage currentItem)
        {
            var activityIndex = 0;

            foreach (var item in currentItem.HostBusinessFlow.Activities)
            {
                currentItem.ActivityNameList.Add(activityIndex + "-" + item.ActivityName);
                activityIndex++;
            }
        }
 private void SetSamePartToAll(object sender, RoutedEventArgs e)
 {
     if (usageGrid.CurrentItem != null)
     {
         RepositoryItemUsage a = (RepositoryItemUsage)usageGrid.CurrentItem;
         foreach (RepositoryItemUsage usage in RepoItemUsages)
         {
             usage.SelectedItemPart = a.SelectedItemPart;
         }
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.AskToSelectItem);
     }
 }
        private void FindUsages()
        {
            try
            {
                //TODO: check that retrieve also sub folder business flows
                ObservableList <BusinessFlow> BizFlows = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <BusinessFlow>();

                foreach (BusinessFlow BF in BizFlows)
                {
                    string businessFlowName = Amdocs.Ginger.Common.GeneralLib.General.RemoveInvalidFileNameChars(BF.Name);
                    if (mRepoItem is Activity)
                    {
                        foreach (Activity a in BF.Activities)
                        {
                            if (a.ParentGuid == mRepoItem.Guid || a.Guid == mRepoItem.Guid ||
                                (mRepoItem.ExternalID != null && mRepoItem.ExternalID != string.Empty && mRepoItem.ExternalID != "0" && a.ExternalID == mRepoItem.ExternalID))
                            {
                                //skip original if not needed
                                if (!mIncludeOriginal)
                                {
                                    if (a.Guid == mOriginalItem.Guid)
                                    {
                                        continue;
                                    }
                                }

                                Ginger.Repository.RepositoryItemUsage.eUsageTypes type;
                                if (a.Guid == mRepoItem.Guid)
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Original;
                                }
                                else
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Instance;
                                }

                                RepositoryItemUsage itemUsage = new RepositoryItemUsage()
                                {
                                    HostBusinessFlow = BF, HostBizFlowPath = Path.Combine(BF.ContainingFolder, businessFlowName), UsageItem = a, UsageItemName = a.ActivityName, UsageExtraDetails = "Number of Actions: " + a.Acts.Count().ToString(), UsageItemType = type, Selected = true, Status = RepositoryItemUsage.eStatus.NotUpdated
                                };
                                itemUsage.SetItemPartesFromEnum(typeof(eItemParts));
                                RepoItemUsages.Add(itemUsage);
                            }
                        }
                    }
                    else if (mRepoItem is ActivitiesGroup)
                    {
                        foreach (ActivitiesGroup a in BF.ActivitiesGroups)
                        {
                            if (a.ParentGuid == mRepoItem.Guid || a.Guid == mRepoItem.Guid ||
                                (mRepoItem.ExternalID != null && mRepoItem.ExternalID != string.Empty && mRepoItem.ExternalID != "0" && a.ExternalID == mRepoItem.ExternalID))
                            {
                                //skip original if not needed
                                if (!mIncludeOriginal)
                                {
                                    if (a.Guid == mOriginalItem.Guid)
                                    {
                                        continue;
                                    }
                                }

                                Ginger.Repository.RepositoryItemUsage.eUsageTypes type;
                                if (a.Guid == mRepoItem.Guid)
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Original;
                                }
                                else
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Instance;
                                }

                                RepositoryItemUsage itemUsage = new RepositoryItemUsage()
                                {
                                    HostBusinessFlow = BF, HostBizFlowPath = Path.Combine(BF.ContainingFolder, businessFlowName), UsageItem = a, UsageItemName = a.Name, UsageExtraDetails = "Number of " + GingerDicser.GetTermResValue(eTermResKey.Activities) + ": " + a.ActivitiesIdentifiers.Count().ToString(), UsageItemType = type, Selected = true, Status = RepositoryItemUsage.eStatus.NotUpdated
                                };
                                itemUsage.SetItemPartesFromEnum(typeof(ActivitiesGroup.eItemParts));
                                RepoItemUsages.Add(itemUsage);
                            }
                        }
                    }
                    else if (mRepoItem is Act)
                    {
                        foreach (Activity activity in BF.Activities)
                        {
                            foreach (Act a in activity.Acts)
                            {
                                if (a.ParentGuid == mRepoItem.Guid || a.Guid == mRepoItem.Guid ||
                                    (mRepoItem.ExternalID != null && mRepoItem.ExternalID != string.Empty && mRepoItem.ExternalID != "0" && a.ExternalID == mRepoItem.ExternalID))
                                {
                                    //skip original if not needed
                                    if (!mIncludeOriginal)
                                    {
                                        if (a.Guid == mOriginalItem.Guid)
                                        {
                                            continue;
                                        }
                                    }

                                    Ginger.Repository.RepositoryItemUsage.eUsageTypes type;
                                    if (a.Guid == mRepoItem.Guid)
                                    {
                                        type = RepositoryItemUsage.eUsageTypes.Original;
                                    }
                                    else
                                    {
                                        type = RepositoryItemUsage.eUsageTypes.Instance;
                                    }

                                    RepositoryItemUsage itemUsage = new RepositoryItemUsage()
                                    {
                                        HostBusinessFlow = BF, HostBizFlowPath = Path.Combine(BF.ContainingFolder, businessFlowName), HostActivity = activity, HostActivityName = activity.ActivityName, UsageItem = a, UsageItemName = a.Description, UsageExtraDetails = "", UsageItemType = type, Selected = true, Status = RepositoryItemUsage.eStatus.NotUpdated
                                    };
                                    itemUsage.SetItemPartesFromEnum(typeof(Act.eItemParts));
                                    RepoItemUsages.Add(itemUsage);
                                }
                            }
                        }
                    }
                    else if (mRepoItem is VariableBase)
                    {
                        //search on Bus Flow level
                        foreach (VariableBase a in BF.Variables)
                        {
                            if (a.ParentGuid == mRepoItem.Guid || a.Guid == mRepoItem.Guid ||
                                (mRepoItem.ExternalID != null && mRepoItem.ExternalID != string.Empty && mRepoItem.ExternalID != "0" && a.ExternalID == mRepoItem.ExternalID))
                            {
                                //skip original if not needed
                                if (!mIncludeOriginal)
                                {
                                    if (a.Guid == mOriginalItem.Guid)
                                    {
                                        continue;
                                    }
                                }

                                Ginger.Repository.RepositoryItemUsage.eUsageTypes type;
                                if (a.Guid == mRepoItem.Guid)
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Original;
                                }
                                else
                                {
                                    type = RepositoryItemUsage.eUsageTypes.Instance;
                                }

                                RepositoryItemUsage itemUsage = new RepositoryItemUsage()
                                {
                                    HostBusinessFlow = BF, HostBizFlowPath = Path.Combine(BF.ContainingFolder, businessFlowName), UsageItem = a, UsageItemName = a.Name, UsageExtraDetails = "Current Value: " + a.Value, UsageItemType = type, Selected = true, Status = RepositoryItemUsage.eStatus.NotUpdated
                                };
                                itemUsage.SetItemPartesFromEnum(typeof(VariableBase.eItemParts));
                                RepoItemUsages.Add(itemUsage);
                            }
                        }
                        //search on Activities level
                        foreach (Activity activity in BF.Activities)
                        {
                            foreach (VariableBase a in activity.Variables)
                            {
                                if (a.ParentGuid == mRepoItem.Guid || a.Guid == mRepoItem.Guid ||
                                    (mRepoItem.ExternalID != null && mRepoItem.ExternalID != string.Empty && mRepoItem.ExternalID != "0" && a.ExternalID == mRepoItem.ExternalID))
                                {
                                    //skip original if not needed
                                    if (!mIncludeOriginal)
                                    {
                                        if (a.Guid == mOriginalItem.Guid)
                                        {
                                            continue;
                                        }
                                    }

                                    Ginger.Repository.RepositoryItemUsage.eUsageTypes type;
                                    if (a.Guid == mRepoItem.Guid)
                                    {
                                        type = RepositoryItemUsage.eUsageTypes.Original;
                                    }
                                    else
                                    {
                                        type = RepositoryItemUsage.eUsageTypes.Instance;
                                    }

                                    RepositoryItemUsage itemUsage = new RepositoryItemUsage()
                                    {
                                        HostBusinessFlow = BF, HostBizFlowPath = Path.Combine(BF.ContainingFolder, businessFlowName), HostActivity = activity, HostActivityName = activity.ActivityName, UsageItem = a, UsageItemName = a.Name, UsageExtraDetails = "Current Value: " + a.Value, UsageItemType = type, Selected = true, Status = RepositoryItemUsage.eStatus.NotUpdated
                                    };
                                    itemUsage.SetItemPartesFromEnum(typeof(VariableBase.eItemParts));
                                    RepoItemUsages.Add(itemUsage);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Reporter.ToUser(eUserMsgKey.GetRepositoryItemUsagesFailed, mRepoItem.GetNameForFileName(), ex.Message);
            }
        }