Beispiel #1
0
        private static void ExecuteActionConversion(bool addNewActivity, bool isDefaultTargetApp, string strTargetApp,
                                                    bool convertToPOMAction = false, Guid selectedPOM = default(Guid))
        {
            ActionConversionUtils utils = new ActionConversionUtils();
            ObservableList <ConvertableActionDetails> lst = utils.GetConvertableActivityActions(mBF.Activities.ToList());
            ObservableList <Guid> poms = new ObservableList <Guid>()
            {
                selectedPOM
            };

            foreach (var item in lst)
            {
                item.Selected = true;
            }


            ObservableList <ConvertableTargetApplicationDetails> convertableTargetApplications = new ObservableList <ConvertableTargetApplicationDetails>();

            foreach (var act in mBF.Activities)
            {
                ConvertableTargetApplicationDetails tas = new ConvertableTargetApplicationDetails();
                tas.SourceTargetApplicationName = act.TargetApplication;
                tas.TargetTargetApplicationName = act.TargetApplication;
                convertableTargetApplications.Add(tas);
            }

            BusinessFlowToConvert statusLst = new BusinessFlowToConvert()
            {
                ConversionStatus            = eConversionStatus.Pending,
                BusinessFlow                = mBF,
                TotalProcessingActionsCount = mBF.Activities[0].Acts.Count
            };

            utils.ConvertToActions(statusLst, addNewActivity, lst, convertableTargetApplications, convertToPOMAction, poms);
        }
        private void SetGridsView()
        {
            GridViewDef defView = new GridViewDef(GridViewDef.DefaultViewName);

            defView.GridColsView = new ObservableList <GridColView>();
            defView.GridColsView.Add(new GridColView()
            {
                Field = nameof(Activity.SelectedForConversion), WidthWeight = 2.5, MaxWidth = 50, StyleType = GridColView.eGridColStyleType.CheckBox, Header = "Select", BindingMode = System.Windows.Data.BindingMode.TwoWay
            });
            defView.GridColsView.Add(new GridColView()
            {
                Field = nameof(Activity.ActivityName), WidthWeight = 15, Header = "Name of " + GingerDicser.GetTermResValue(eTermResKey.Activity)
            });
            xGrdGroups.SetAllColumnsDefaultView(defView);
            xGrdGroups.InitViewItems();
            xGrdGroups.SetTitleLightStyle    = true;
            xGrdGroups.btnMarkAll.Visibility = System.Windows.Visibility.Visible;
            xGrdGroups.btnMarkAll.ToolTip    = "Mark All As Active";
            xGrdGroups.SetBtnImage(xGrdGroups.btnMarkAll, "@CheckAllColumn_16x16.png");
            ActionConversionUtils     utils = new ActionConversionUtils();
            ObservableList <Activity> lst   = utils.GetConvertableActivitiesFromBusinessFlow(mWizard.Context.BusinessFlow);

            xGrdGroups.DataSourceList       = lst;
            xGrdGroups.RowChangedEvent     += grdGroups_RowChangedEvent;
            xGrdGroups.Title                = "Convert " + GingerDicser.GetTermResValue(eTermResKey.Activities);
            xGrdGroups.MarkUnMarkAllActive += MarkUnMarkAllActivities;
            xGrdGroups.ValidationRules      = new List <ucGrid.eUcGridValidationRules>()
            {
                ucGrid.eUcGridValidationRules.CheckedRowCount
            };
            xGrdGroups.ActiveStatus = true;
        }
        private void ConverToActions()
        {
            if (!DoExistingPlatformCheck(ActionToBeConverted))
            {
                //missing target application so stop the conversion
                return;
            }
            else
            {
                try
                {
                    Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
                    Reporter.ToStatus(eStatusMsgKey.BusinessFlowConversion, null, Context.BusinessFlow.Name);

                    // create a new converted activity
                    ActionConversionUtils utils = new ActionConversionUtils();
                    utils.ActUIElementElementLocateByField    = nameof(ActUIElement.ElementLocateBy);
                    utils.ActUIElementLocateValueField        = nameof(ActUIElement.LocateValue);
                    utils.ActUIElementElementLocateValueField = nameof(ActUIElement.ElementLocateValue);
                    utils.ActUIElementElementTypeField        = nameof(ActUIElement.ElementType);
                    utils.ActUIElementClassName = nameof(ActUIElement);
                    utils.ConvertToActions(NewActivityChecked, Context.BusinessFlow, ActionToBeConverted, DefaultTargetAppChecked, SelectedTargetApp, ConvertToPOMAction, SelectedPOMObjectName);
                }
                catch (Exception ex)
                {
                    Reporter.ToLog(eLogLevel.ERROR, "Error occurred while trying to convert " + GingerDicser.GetTermResValue(eTermResKey.Activities) + " - ", ex);
                    Reporter.ToUser(eUserMsgKey.ActivitiesConversionFailed);
                }
                finally
                {
                    Reporter.HideStatusMessage();
                    Mouse.OverrideCursor = null;
                }
            }
        }
Beispiel #4
0
        private void Init()
        {
            // clearing the list of actions to be converted before clicking on Convertible Actions buttons again to reflect the fresh list of convertible actions
            mWizard.ActionToBeConverted.Clear();

            // fetching list of selected convertible activities from the first grid
            List <Activity> lstSelectedActivities = mWizard.Context.BusinessFlow.Activities.Where(x => x.SelectedForConversion).ToList();

            if (lstSelectedActivities.Count != 0)
            {
                ActionConversionUtils utils = new ActionConversionUtils();
                mWizard.ActionToBeConverted = utils.GetConvertableActivityActions(lstSelectedActivities);
                if (mWizard.ActionToBeConverted.Count != 0)
                {
                    xGridConvertibleActions.DataSourceList = mWizard.ActionToBeConverted;
                    SetGridView();
                    return;
                }
                else
                {
                    Reporter.ToUser(eUserMsgKey.NoConvertibleActionsFound);
                    return;
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.NoActivitySelectedForConversion);
            }
        }
Beispiel #5
0
        private static void ExecuteActionConversion(bool addNewActivity, bool isDefaultTargetApp, string strTargetApp,
                                                    bool convertToPOMAction = false, string selectedPOMObjectName = "")
        {
            ActionConversionUtils utils = new ActionConversionUtils();
            ObservableList <ConvertableActionDetails> lst = utils.GetConvertableActivityActions(mBF.Activities.ToList());

            foreach (var item in lst)
            {
                item.Selected = true;
            }
            utils.ConvertToActions(addNewActivity, mBF, lst, isDefaultTargetApp, strTargetApp, convertToPOMAction, selectedPOMObjectName);
        }
Beispiel #6
0
        private static void ExecuteActionConversionForMultipleBF(bool addNewActivity, bool convertoSameTA = true,
                                                                 bool convertToPOMAction = false, Guid selectedPOM = default(Guid))
        {
            ObservableList <BusinessFlowToConvert> ListOfBusinessFlowToConvert = new ObservableList <BusinessFlowToConvert>();
            ActionConversionUtils utils = new ActionConversionUtils();
            ObservableList <ConvertableActionDetails> lstCad = new ObservableList <ConvertableActionDetails>();

            foreach (var bf in mListBF)
            {
                ObservableList <ConvertableActionDetails> lst = utils.GetConvertableActivityActions(bf.Activities.ToList());

                foreach (ConvertableActionDetails cad in lst)
                {
                    cad.Selected = true;
                    lstCad.Add(cad);
                }

                BusinessFlowToConvert flowConversion = new BusinessFlowToConvert();
                flowConversion.BusinessFlow                = bf;
                flowConversion.ConversionStatus            = eConversionStatus.Pending;
                flowConversion.TotalProcessingActionsCount = lst.Count;
                ListOfBusinessFlowToConvert.Add(flowConversion);
            }
            ObservableList <Guid> poms = new ObservableList <Guid>()
            {
                selectedPOM
            };

            ObservableList <ConvertableTargetApplicationDetails> convertableTargetApplications = new ObservableList <ConvertableTargetApplicationDetails>();

            foreach (var bf in mListBF)
            {
                foreach (var act in bf.Activities)
                {
                    ConvertableTargetApplicationDetails tas = new ConvertableTargetApplicationDetails();
                    tas.SourceTargetApplicationName = act.TargetApplication;
                    if (convertoSameTA)
                    {
                        tas.TargetTargetApplicationName = act.TargetApplication;
                    }
                    else
                    {
                        tas.TargetTargetApplicationName = MAPPED_TA_FOR_CONVERSION;
                    }
                    convertableTargetApplications.Add(tas);
                }
            }

            utils.ListOfBusinessFlowsToConvert = ListOfBusinessFlowToConvert;
            utils.ConvertActionsOfMultipleBusinessFlows(lstCad, addNewActivity, convertableTargetApplications, convertToPOMAction, poms);
        }
Beispiel #7
0
        /// <summary>
        /// This method helps to execute the funcationality of removeing the legacy actions from the businessflow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void LegacyActionsRemoveHandler(object sender, System.Windows.RoutedEventArgs e)
        {
            ObservableList <BusinessFlowToConvert> lstBFToConvert = new ObservableList <BusinessFlowToConvert>();

            if (((ITreeViewItem)this).NodeObject().GetType().Equals(typeof(GingerCore.BusinessFlow)))
            {
                BusinessFlowToConvert flowToConvert = new BusinessFlowToConvert();
                flowToConvert.BusinessFlow = (GingerCore.BusinessFlow)((ITreeViewItem)this).NodeObject();
                lstBFToConvert.Add(flowToConvert);
            }

            ActionConversionUtils utils = new ActionConversionUtils();
            await Task.Run(() => utils.RemoveLegacyActionsHandler(lstBFToConvert));
        }
        /// <summary>
        /// This method helps to execute the funcationality of removeing the legacy actions from the businessflow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void LegacyActionsRemoveHandler(object sender, System.Windows.RoutedEventArgs e)
        {
            ObservableList <BusinessFlowToConvert> lstBFToConvert = new ObservableList <BusinessFlowToConvert>();
            var items = ((Amdocs.Ginger.Repository.RepositoryFolder <GingerCore.BusinessFlow>)((ITreeViewItem)this).NodeObject()).GetFolderItemsRecursive();

            foreach (var bf in items)
            {
                BusinessFlowToConvert flowToConvert = new BusinessFlowToConvert();
                flowToConvert.BusinessFlow = (GingerCore.BusinessFlow)bf;
                lstBFToConvert.Add(flowToConvert);
            }
            ActionConversionUtils utils = new ActionConversionUtils();

            await Task.Run(() => utils.RemoveLegacyActionsHandler(lstBFToConvert));
        }
Beispiel #9
0
        private void Init()
        {
            ((WizardWindow)mWizard.mWizardWindow).xFinishButton.IsEnabled = false;
            if (mWizard.LstSelectedActivities == null || mWizard.LstSelectedActivities.Count <= 0)
            {
                // fetching list of selected convertible activities from the first grid
                if (mWizard.ConversionType == ActionsConversionWizard.eActionConversionType.SingleBusinessFlow)
                {
                    mWizard.LstSelectedActivities = mWizard.Context.BusinessFlow.Activities.Where(x => x.SelectedForConversion).ToList();
                }
                else
                {
                    mWizard.LstSelectedActivities = mWizard.ListOfBusinessFlow.Where(x => x.IsSelected).SelectMany(y => y.BusinessFlow.Activities).Where(z => z.Active).ToList();
                }
            }

            if (mWizard.LstSelectedActivities.Count != 0)
            {
                xGridConvertibleActions.ValidationRules = new List <ucGrid.eUcGridValidationRules>()
                {
                    ucGrid.eUcGridValidationRules.CheckedRowCount
                };

                if (mWizard.ActionToBeConverted == null || mWizard.ActionToBeConverted.Count <= 0)
                {
                    ActionConversionUtils utils = new ActionConversionUtils();
                    mWizard.ActionToBeConverted = utils.GetConvertableActivityActions(mWizard.LstSelectedActivities);
                }
                if (mWizard.ActionToBeConverted.Count != 0)
                {
                    xGridConvertibleActions.DataSourceList = GetDistinctList(mWizard.ActionToBeConverted);
                    SetGridView();
                    return;
                }
                else
                {
                    Reporter.ToLog(eLogLevel.DEBUG, "No Convertible Actions Found");
                    return;
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.NoActivitySelectedForConversion);
            }
        }