Exemple #1
0
        private void AnalyzerItemsGrid_RowDoubleClick(object sender, EventArgs e)
        {
            //show the item edit page
            if (AnalyzerItemsGrid.CurrentItem is AnalyzeAction)
            {
                AnalyzeAction currentAnalyzeAction = (AnalyzeAction)AnalyzerItemsGrid.CurrentItem;
                Act           actionIssue          = currentAnalyzeAction.mAction;
                actionIssue.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper();
                ActionEditPage actedit = new ActionEditPage(actionIssue, General.eRIPageViewMode.ChildWithSave, currentAnalyzeAction.mBusinessFlow, currentAnalyzeAction.mActivity);
                //setting the BusinessFlow on the Action in Order to save
                //actedit.mActParentBusinessFlow = ((AnalyzeAction)AnalyzerItemsGrid.CurrentItem).mBusinessFlow;
                //actedit.ap = null;
                actedit.ShowAsWindow(eWindowShowStyle.Dialog);
            }

            if (AnalyzerItemsGrid.CurrentItem is AnalyzeActivity)
            {
                AnalyzeActivity currentAnalyzeActivity = (AnalyzeActivity)AnalyzerItemsGrid.CurrentItem;
                Activity        ActivityIssue          = currentAnalyzeActivity.mActivity;
                //ActivityIssue.SolutionFolder =  WorkSpace.Instance.Solution.Folder.ToUpper();
                GingerWPF.BusinessFlowsLib.ActivityPage ActivityEdit = new GingerWPF.BusinessFlowsLib.ActivityPage(ActivityIssue, new Context()
                {
                    BusinessFlow = currentAnalyzeActivity.mBusinessFlow
                }, General.eRIPageViewMode.ChildWithSave);
                //setting the BusinessFlow on the Activity in Order to save
                //ActivityEdit.mBusinessFlow = ((AnalyzeActivity)AnalyzerItemsGrid.CurrentItem).mBusinessFlow;
                //ActivityEdit.ap = null;
                ActivityEdit.ShowAsWindow(eWindowShowStyle.Dialog);
            }
        }
Exemple #2
0
        private void AnalyzerItemsGrid_RowDoubleClick(object sender, EventArgs e)
        {
            //show the item edit page
            if (AnalyzerItemsGrid.CurrentItem is AnalyzeAction)
            {
                AnalyzeAction currentAnalyzeAction = (AnalyzeAction)AnalyzerItemsGrid.CurrentItem;
                Act           actionIssue          = currentAnalyzeAction.mAction;
                actionIssue.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();
                ActionEditPage actedit = new ActionEditPage(actionIssue, General.RepositoryItemPageViewMode.Child, currentAnalyzeAction.mBusinessFlow, currentAnalyzeAction.mActivity);
                //setting the BusinessFlow on the Action in Order to save
                //actedit.mActParentBusinessFlow = ((AnalyzeAction)AnalyzerItemsGrid.CurrentItem).mBusinessFlow;
                //actedit.ap = null;
                actedit.ShowAsWindow(eWindowShowStyle.Dialog);
            }

            if (AnalyzerItemsGrid.CurrentItem is AnalyzeActivity)
            {
                AnalyzeActivity currentAnalyzeActivity = (AnalyzeActivity)AnalyzerItemsGrid.CurrentItem;
                Activity        ActivityIssue          = currentAnalyzeActivity.mActivity;
                //ActivityIssue.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();
                ActivityEditPage ActivityEdit = new ActivityEditPage(ActivityIssue, General.RepositoryItemPageViewMode.Child, currentAnalyzeActivity.mBusinessFlow);
                //setting the BusinessFlow on the Activity in Order to save
                //ActivityEdit.mBusinessFlow = ((AnalyzeActivity)AnalyzerItemsGrid.CurrentItem).mBusinessFlow;
                //ActivityEdit.ap = null;
                ActivityEdit.ShowAsWindow(eWindowShowStyle.Dialog);
            }
        }
Exemple #3
0
        public void ViewAction(FoundItem actionToView)
        {
            Act act = (Act)actionToView.OriginObject;
            RepositoryItemBase Parent = actionToView.ParentItemToSave;
            ActionEditPage     w;

            if (mContext == eContext.RunsetPage)
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.View);
            }
            else if (Parent is BusinessFlow)
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.Child, Parent as BusinessFlow);
            }
            else if (Parent is Activity)
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.Child, actParentActivity: Parent as Activity);// add save handeling to save activity if not null
            }
            else
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.SharedReposiotry);
            }

            if (w.ShowAsWindow(eWindowShowStyle.Dialog) == true)
            {
                RefreshFoundItemField(actionToView);
            }
        }
        private void AddActionButton_Click(object sender, RoutedEventArgs e)
        {
            if (mActions.CurrentItem == null)
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectAction);
                return;
            }

            Act act = (Act)((Act)(mActions.CurrentItem)).CreateCopy();

            SetActionDetails(act);
            mContext.BusinessFlow.AddAct(act);

            int selectedActIndex           = -1;
            ObservableList <IAct> actsList = mContext.BusinessFlow.CurrentActivity.Acts;

            if (actsList.CurrentItem != null)
            {
                selectedActIndex = actsList.IndexOf((Act)actsList.CurrentItem);
            }
            if (selectedActIndex >= 0)
            {
                actsList.Move(actsList.Count - 1, selectedActIndex + 1);
            }
            ActionEditPage AEP = new ActionEditPage(act);

            AEP.ShowAsWindow();
        }
 Page ITreeViewItem.EditPage(Amdocs.Ginger.Common.Context mContext)
 {
     if (mActionEditPage == null)
     {
         mActionEditPage = new ActionEditPage(mAct, General.eRIPageViewMode.SharedReposiotry);
     }
     return(mActionEditPage);
 }
 Page ITreeViewItem.EditPage()
 {
     if (mActionEditPage == null)
     {
         mActionEditPage = new ActionEditPage(Act, General.RepositoryItemPageViewMode.SharedReposiotry, new GingerCore.BusinessFlow(), new GingerCore.Activity());
     }
     return(mActionEditPage);
 }
Exemple #7
0
        private void EditAction(object sender, RoutedEventArgs e)
        {
            Act a = ((CommonFunctionMapping)CommonFunctionMappingUCGrid.CurrentItem).TargetAction;

            ActionEditPage actedit = new ActionEditPage(a);

            actedit.ShowAsWindow();
        }
Exemple #8
0
 Page ITreeViewItem.EditPage()
 {
     if (mActionEditPage == null)
     {
         mActionEditPage = new ActionEditPage(mAct, General.RepositoryItemPageViewMode.SharedReposiotry);
     }
     return(mActionEditPage);
 }
Exemple #9
0
        private void AddAction()
        {
            if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
            {
                if (((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage != null)
                {
                    _pageGenericWin.Close();
                    string classname = ((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage;
                    Type   t         = Assembly.GetExecutingAssembly().GetType(classname);
                    if (t == null)
                    {
                        throw new Exception("Action edit page not found - " + classname);
                    }

                    WizardBase wizard = (GingerWPF.WizardLib.WizardBase)Activator.CreateInstance(t);
                    WizardWindow.ShowWizard(wizard);
                }
                else
                {
                    Act aNew = null;

                    if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
                    {
                        aNew = (Act)(((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).CreateCopy());
                    }
                    else
                    {
                        Reporter.ToUser(eUserMsgKeys.NoItemWasSelected);
                        return;
                    }
                    aNew.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();

                    //adding the new act after the selected action in the grid
                    //TODO: Add should be after the last, Insert should be in the middle...



                    int selectedActIndex = -1;
                    if (mActionsList.CurrentItem != null)
                    {
                        selectedActIndex = mActionsList.IndexOf((Act)mActionsList.CurrentItem);
                    }
                    mActionsList.Add(aNew);
                    if (selectedActIndex >= 0)
                    {
                        mActionsList.Move(mActionsList.Count - 1, selectedActIndex + 1);
                    }

                    _pageGenericWin.Close();

                    //allowing to edit the action
                    ActionEditPage actedit = new ActionEditPage(aNew);
                    actedit.ShowAsWindow();
                }
            }
        }
Exemple #10
0
        private void AddActionButton_Click(object sender, RoutedEventArgs e)
        {
            Act act = (Act)((Act)(mActions.CurrentItem)).CreateCopy();

            act.Active = true;
            App.BusinessFlow.AddAct(act);
            ActionEditPage AEP = new ActionEditPage(act);

            AEP.ShowAsWindow();
        }
        private void grdActions_grdMain_MouseDoubleClick(object sender, EventArgs e)
        {
            Act a = (Act)grdActions.CurrentItem;

            a.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();
            ActionEditPage actedit = new ActionEditPage(a, EditMode);

            actedit.ap = this;
            actedit.ShowAsWindow();
        }
Exemple #12
0
        private void AddActionButton_Click(object sender, RoutedEventArgs e)
        {
            if (mActions.CurrentItem == null)
            {
                Reporter.ToUser(eUserMsgKeys.AskToSelectAction);
                return;
            }

            Act act = (Act)((Act)(mActions.CurrentItem)).CreateCopy();

            act.Active             = true;
            act.AddNewReturnParams = true;
            ElementLocator EL = (ElementLocator)mLocators.CurrentItem;

            if ((mActions.CurrentItem).GetType() == typeof(ActUIElement))
            {
                ActUIElement aaa   = (ActUIElement)mActions.CurrentItem;
                ActUIElement actUI = (ActUIElement)act;
                actUI.ElementLocateBy    = EL.LocateBy;
                actUI.ElementLocateValue = EL.LocateValue;
                actUI.Value = ValueTextBox.Text;
                actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlActionValue, ValueTextBox.Text);
                actUI.GetOrCreateInputParam(ActUIElement.Fields.ElementType, aaa.GetInputParamValue(ActUIElement.Fields.ElementType));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.ControlAction, aaa.GetInputParamValue(ActUIElement.Fields.ControlAction));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.ElementAction, aaa.GetInputParamValue(ActUIElement.Fields.ElementAction));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColSelector, aaa.GetInputParamValue(ActUIElement.Fields.WhereColSelector));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnTitle, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnTitle));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereColumnValue, aaa.GetInputParamValue(ActUIElement.Fields.WhereColumnValue));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereOperator, aaa.GetInputParamValue(ActUIElement.Fields.WhereOperator));
                actUI.GetOrCreateInputParam(ActUIElement.Fields.WhereProperty, aaa.GetInputParamValue(ActUIElement.Fields.WhereProperty));
                act = actUI;
            }
            else
            {
                act.LocateBy    = EL.LocateBy;
                act.LocateValue = EL.LocateValue;
                act.Value       = ValueTextBox.Text;
            }
            App.BusinessFlow.AddAct(act);

            int selectedActIndex          = -1;
            ObservableList <Act> actsList = App.BusinessFlow.CurrentActivity.Acts;

            if (actsList.CurrentItem != null)
            {
                selectedActIndex = actsList.IndexOf((Act)actsList.CurrentItem);
            }
            if (selectedActIndex >= 0)
            {
                actsList.Move(actsList.Count - 1, selectedActIndex + 1);
            }
            ActionEditPage AEP = new ActionEditPage(act);

            AEP.ShowAsWindow();
        }
Exemple #13
0
 private void EditAction(object sender, RoutedEventArgs e)
 {
     if (xActionsGrid.CurrentItem != null)
     {
         Act            a       = (Act)xActionsGrid.CurrentItem;
         ActionEditPage actedit = new ActionEditPage(a, General.RepositoryItemPageViewMode.SharedReposiotry, new GingerCore.BusinessFlow(), new GingerCore.Activity());
         actedit.ShowAsWindow(eWindowShowStyle.Dialog);
     }
     else
     {
         Reporter.ToUser(eUserMsgKeys.AskToSelectItem);
     }
 }
Exemple #14
0
 private void EditAct(object sender, RoutedEventArgs e)
 {
     if (mListView.List.SelectedItems != null && mListView.List.SelectedItems.Count > 0)
     {
         Act            a       = (Act)mListView.CurrentItem;
         ActionEditPage actedit = new ActionEditPage(a, General.eRIPageViewMode.SharedReposiotry, new GingerCore.BusinessFlow(), new GingerCore.Activity());
         actedit.ShowAsWindow(eWindowShowStyle.Dialog);
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.AskToSelectItem);
     }
 }
 private void EditAction(object sender, RoutedEventArgs e)
 {
     if (grdActions.CurrentItem != null)
     {
         Act            a       = (Act)grdActions.CurrentItem;
         ActionEditPage actedit = new ActionEditPage(a, EditMode);
         actedit.ap = this;
         actedit.ShowAsWindow();
     }
     else
     {
         Reporter.ToUser(eUserMsgKeys.AskToSelectItem);
     }
 }
Exemple #16
0
        private void grdActions_grdMain_MouseDoubleClick(object sender, EventArgs e)
        {
            Act a = (Act)grdActions.CurrentItem;

            a.SolutionFolder = WorkSpace.UserProfile.Solution.Folder.ToUpper();
            a.Context        = new Context()
            {
                BusinessFlow = mBusinessFlow
            };
            ActionEditPage actedit = new ActionEditPage(a, EditMode);

            actedit.ap = this;
            actedit.ShowAsWindow();
        }
Exemple #17
0
        private void ShowHideEditPage(Act actionToEdit)
        {
            if (actionToEdit != null)
            {
                xBackToListGrid.Visibility = Visibility.Visible;
                mActionBeenEdit            = actionToEdit;
                mActionBeenEdit.Context    = mContext;
                BindingHandler.ObjFieldBinding(xSelectedItemTitleText, TextBlock.TextProperty, mActionBeenEdit, nameof(Act.Description));
                BindingHandler.ObjFieldBinding(xSelectedItemTitleText, TextBlock.ToolTipProperty, mActionBeenEdit, nameof(Act.Description));
                if (mPageViewMode == Ginger.General.eRIPageViewMode.View)
                {
                    xEditAndRunOperationsPnl.Visibility = Visibility.Collapsed;
                }
                else
                {
                    xEditAndRunOperationsPnl.Visibility = Visibility.Visible;
                    mActionBeenEdit.SaveBackup();
                    BindingHandler.ObjFieldBinding(xActiveBtn, ucButton.ButtonImageTypeProperty, mActionBeenEdit, nameof(Act.Active), bindingConvertor: new ActiveImageTypeConverter(), BindingMode.OneWay);
                    BindingHandler.ObjFieldBinding(xBreakPointMenuItemIcon, ImageMaker.ContentProperty, mActionBeenEdit, nameof(Act.BreakPoint), bindingConvertor: new ActiveImageTypeConverter(), BindingMode.OneWay);
                }

                mActionEditPage = new ActionEditPage(mActionBeenEdit, mPageViewMode);
                xMainFrame.SetContent(mActionEditPage);
                if (ShiftToActionEditEvent != null)
                {
                    ShiftToActionEditEvent.Invoke(this, null);
                }
            }
            else
            {
                xBackToListGrid.Visibility = Visibility.Collapsed;
                mActionBeenEdit            = null;
                if (mActionEditPage != null)
                {
                    mActionEditPage.ClearPageBindings();
                    mActionEditPage.KeepAlive = false;
                    mActionEditPage           = null;
                    //GC.Collect();
                }
                xMainFrame.SetContent(mActionsListView);
                mActionsListView.ScrollToViewCurrentItem();

                if (ShiftToActionsListEvent != null)
                {
                    ShiftToActionsListEvent.Invoke(this, null);
                }
            }
        }
Exemple #18
0
 private void EditSelectedAction()
 {
     if (grdActions.CurrentItem != null)
     {
         Act a = (Act)grdActions.CurrentItem;
         a.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper();
         a.Context        = mContext;
         ActionEditPage actedit = new ActionEditPage(a, EditMode);
         actedit.ap = this;
         actedit.ShowAsWindow();
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.AskToSelectItem);
     }
 }
Exemple #19
0
        private void AddActionButton_Click(object sender, RoutedEventArgs e)
        {
            if (mActions.CurrentItem == null)
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectAction);
                return;
            }

            Act act = (Act)((Act)(mActions.CurrentItem)).CreateCopy();

            SetActionDetails(act);
            act.Context = mContext;
            mContext.BusinessFlow.AddAct(act, true);

            ActionEditPage AEP = new ActionEditPage(act);

            AEP.ShowAsWindow();
        }
Exemple #20
0
        public void viewAction(FoundItem actionToView)
        {
            Act act = (Act)actionToView.OriginObject;
            RepositoryItemBase Parent = actionToView.ParentItemToSave;
            ActionEditPage     w;

            if (Parent is BusinessFlow)
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.Child, Parent as BusinessFlow);
            }
            else
            {
                w = new ActionEditPage(act, General.RepositoryItemPageViewMode.SharedReposiotry);
            }

            if (w.ShowAsWindow(eWindowShowStyle.Dialog) == true)
            {
                RefreshFoundItemField(actionToView);
            }
        }
Exemple #21
0
        private void AvailableActionsGrid_RowDoubleClick(object sender, EventArgs e)
        {
            // we can decide based on the action added if we need to open the ActionEdit Page to get more info
            bool bOpenActionEditPage = true;
            // User want to add action to flow

            Act act = (Act)AvailableActionsGrid.CurrentItem;

            //TODO: If this is set value action open VE
            //TODO: if it is validate - then do all and no show?

            if (act is ActUIElement)
            {
                ActUIElement AUIE = (ActUIElement)act;
                if (AUIE.ElementAction == ActUIElement.eElementAction.SetValue)
                {
                    ValueExpressionEditorPage pa = new ValueExpressionEditorPage(act, ActUIElement.Fields.Value);
                    pa.ShowAsWindow(eWindowShowStyle.Dialog);
                    bOpenActionEditPage = false;
                }

                if (AUIE.ElementAction == ActUIElement.eElementAction.Click)
                {
                    bOpenActionEditPage = false;
                }
            }
            if (bOpenActionEditPage)
            {
                ActionEditPage p = new ActionEditPage(act);
                p.ShowAsWindow();
            }

            // TODO: allow cancel in window

            mBusinessFlow.CurrentActivity.Acts.Add(act);
            RefreshDiagram();
        }
Exemple #22
0
        private void AddAction()
        {
            if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
            {
                Act selectedAction = (Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem);

                //warn regarding Leagacy Actions
                if (LegacyActionsTab.IsSelected)
                {
                    if (selectedAction is IObsoleteAction)
                    {
                        eUserMsgSelection userSelection = Reporter.ToUser(eUserMsgKey.WarnAddLegacyActionAndOfferNew, ((IObsoleteAction)selectedAction).TargetActionTypeName());
                        if (userSelection == eUserMsgSelection.Yes)
                        {
                            selectedAction = ((IObsoleteAction)selectedAction).GetNewAction();
                        }
                        else if (userSelection == eUserMsgSelection.Cancel)
                        {
                            return;//do not add any action
                        }
                    }
                    else
                    {
                        if (Reporter.ToUser(eUserMsgKey.WarnAddLegacyAction) == eUserMsgSelection.No)
                        {
                            return;//do not add any action
                        }
                    }
                }

                if (selectedAction.AddActionWizardPage != null)
                {
                    _pageGenericWin.Close();
                    string classname = selectedAction.AddActionWizardPage;
                    Type   t         = Assembly.GetExecutingAssembly().GetType(classname);
                    if (t == null)
                    {
                        throw new Exception("Action edit page not found - " + classname);
                    }

                    WizardBase wizard = (GingerWPF.WizardLib.WizardBase)Activator.CreateInstance(t, mContext);
                    WizardWindow.ShowWizard(wizard);
                }
                else
                {
                    Act newAction = null;
                    newAction         = (Act)selectedAction.CreateCopy();
                    newAction.Context = mContext;
                    // copy param ex info
                    for (int i = 0; i < selectedAction.InputValues.Count; i++)
                    {
                        newAction.InputValues[i].ParamTypeEX = selectedAction.InputValues[i].ParamTypeEX;
                    }

                    newAction.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper();

                    //adding the new act after the selected action in the grid
                    //TODO: Add should be after the last, Insert should be in the middle...
                    int selectedActIndex = -1;
                    if (mActionsList.CurrentItem != null)
                    {
                        selectedActIndex = mActionsList.IndexOf((IAct)mActionsList.CurrentItem);
                    }
                    mActionsList.Add(newAction);
                    if (selectedActIndex >= 0)
                    {
                        mActionsList.Move(mActionsList.Count - 1, selectedActIndex + 1);
                    }

                    _pageGenericWin.Close();

                    //allowing to edit the action
                    ActionEditPage actedit = new ActionEditPage(newAction);
                    actedit.ShowAsWindow();

                    if (newAction is ActPlugIn)
                    {
                        ActPlugIn p = (ActPlugIn)newAction;
                        // TODO: add per group or... !!!!!!!!!

                        //Check if target already exist else add it
                        // TODO: search only in targetplugin type
                        TargetPlugin targetPlugin = (TargetPlugin)(from x in mBusinessFlow.TargetApplications where x.Name == p.ServiceId select x).SingleOrDefault();
                        if (targetPlugin == null)
                        {
                            // check if interface add it
                            // App.BusinessFlow.TargetApplications.Add(new TargetPlugin() { AppName = p.ServiceId });

                            mBusinessFlow.TargetApplications.Add(new TargetPlugin()
                            {
                                PluginId = p.PluginId, ServiceId = p.ServiceId
                            });

                            //Search for default agent which match
                            mContext.Runner.UpdateApplicationAgents();
                            // TODO: update automate page target/agent

                            // if agent not found auto add or ask user
                        }
                    }
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
                return;
            }
        }
        /*
         * private void Action_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         * {
         *  if (e.PropertyName == nameof(Act.Status))
         *  {
         *      this.Dispatcher.Invoke(() =>
         *      {
         *          xExecutionStatusIcon.Status = mAction.Status.Value;
         *
         *          if (mAction.Status.Value == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Running)
         *          {
         *              xRunActBtn.IsEnabled = false;
         *              xRunActBtn.Opacity = 0.4;
         *          }
         *          else
         *          {
         *              xRunActBtn.IsEnabled = true;
         *              xRunActBtn.Opacity = 1;
         *          }
         *
         *          string returnVals = GetAllRetVals(mAction);
         *
         *          if (!string.IsNullOrEmpty(mAction.Error))
         *          {
         *              xErrorTxtBlock.Visibility = Visibility.Visible;
         *              xErrorTxtBlock.Text += mAction.Error;
         *          }
         *          else
         *          {
         *              xErrorTxtBlock.Visibility = Visibility.Collapsed;
         *              xErrorTxtBlock.Text = "Error : ";
         *          }
         *
         *          if (string.IsNullOrEmpty(mAction.ExInfo) == false)
         *          {
         *              xExecInfoTxtBlock.Visibility = Visibility.Visible;
         *              xExecInfoTxtBlock.Text += mAction.ExInfo;
         *          }
         *          else
         *          {
         *              xExecInfoTxtBlock.Visibility = Visibility.Collapsed;
         *              xExecInfoTxtBlock.Text = "Execution Info : ";
         *          }
         *
         *          if (!string.IsNullOrEmpty(returnVals))
         *          {
         *              xExecInfoTxtBlock.Visibility = Visibility.Visible;
         *              xExecInfoTxtBlock.Text += Environment.NewLine + "Return Values : " + returnVals;
         *          }
         *          else
         *          {
         *
         *          }
         *      });
         *  }
         *
         *  if (e.PropertyName == nameof(Act.ReturnValues))
         *  {
         *  }
         * }
         */

        void SetPlatformBasedUIUpdates()
        {
            if (IsLegacyPlatform)
            {
                if (mPlatform.PlatformType().Equals(ePlatformType.Web) || (mPlatform.PlatformType().Equals(ePlatformType.Java) && !mElementInfo.ElementType.Contains("JEditor")))
                {
                    //TODO: J.G: Remove check for element type editor and handle it in generic way in all places
                    AvailableActions = mPlatform.GetPlatformElementActions(mElementInfo);
                }
                else
                {                                                                                                  // this "else" is temporary. Currently only ePlatformType.Web is overided
                    AvailableActions = ((IWindowExplorerTreeItem)mCurrentControlTreeViewItem).GetElementActions(); // case will be removed once all platforms will be overrided
                }

                if (AvailableActions.CurrentItem == null && AvailableActions.Count > 0)
                {
                    AvailableActions.CurrentItem = AvailableActions[0];
                }

                DefaultAction = (Act)AvailableActions.CurrentItem;
                xActEditPageFrame.Visibility = Visibility.Collapsed;

                xOperationsScrollView.Visibility = Visibility.Visible;

                InitActionsGrid();
                InitLocatorsGrid();

                InitOutputValuesGrid();

                BindingHandler.ObjFieldBinding(xErrorTxtBlock, TextBlock.TextProperty, DefaultAction, nameof(Act.Error));
                BindingHandler.ObjFieldBinding(xExecInfoTxtBlock, TextBlock.TextProperty, DefaultAction, nameof(Act.ExInfo));
                BindingHandler.ObjFieldBinding(xOutputValuesGrid, DataGrid.ItemsSourceProperty, DefaultAction, nameof(Act.ReturnValues));
                BindingHandler.ObjFieldBinding(xOutputValuesGrid, IsVisibleProperty, DefaultAction, nameof(Act.ReturnValues), new OutPutValuesCountConverter());
                //BindingHandler.ObjFieldBinding(xActExecutionDetails, Expander.IsExpandedProperty, mAction, Convert.ToString(mAction.Status.Value == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed || mAction.Status.Value == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed), new CheckboxConfigConverter());
            }
            else
            {
                DefaultAction.Context = mContext;

                if (mPlatform.PlatformType().Equals(ePlatformType.Java) && mElementInfo.ElementType.Contains("JEditor"))
                {
                    ActInputValue inputPar = DefaultAction.GetOrCreateInputParam(ActUIElement.Fields.IsWidgetsElement);
                    if (inputPar != null && inputPar.Value == "true")
                    {
                        mElementInfo.ElementTypeEnum = eElementType.EditorPane;
                        (DefaultAction as ActUIElement).ElementType = eElementType.EditorPane;
                        inputPar.Value = "false";
                    }
                }

                (DefaultAction as ActUIElement).ElementData = mElementInfo.GetElementData();
                DefaultAction.Description = string.Format("{0} : {1} - {2}", (DefaultAction as ActUIElement).ElementAction, mElementInfo.ElementTypeEnum.ToString(), mElementInfo.ElementName);
                SetActionDetails(DefaultAction);
                actEditPage = new ActionEditPage(DefaultAction, General.eRIPageViewMode.Explorer);

                xActEditPageFrame.Visibility = Visibility.Visible;

                xActEditPageFrame.Content = actEditPage;

                xOperationsScrollView.Visibility = Visibility.Collapsed;
            }

            //BindingHandler.ObjFieldBinding(xExecutionStatusIcon, UcItemExecutionStatus.StatusProperty, mAction, nameof(Act.Status));
            InitDataPage();
        }
Exemple #24
0
        private void AddAction()
        {
            if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
            {
                if (((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage != null)
                {
                    _pageGenericWin.Close();
                    string classname = ((Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem)).AddActionWizardPage;
                    Type   t         = Assembly.GetExecutingAssembly().GetType(classname);
                    if (t == null)
                    {
                        throw new Exception("Action edit page not found - " + classname);
                    }

                    WizardBase wizard = (GingerWPF.WizardLib.WizardBase)Activator.CreateInstance(t);
                    WizardWindow.ShowWizard(wizard);
                }
                else
                {
                    Act aNew = null;

                    if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
                    {
                        Act selectedAction = (Act)(((ucGrid)ActionsTabs.SelectedContent).CurrentItem);
                        aNew = (Act)selectedAction.CreateCopy();
                        // copy param ex info
                        for (int i = 0; i < selectedAction.InputValues.Count; i++)
                        {
                            aNew.InputValues[i].ParamTypeEX = selectedAction.InputValues[i].ParamTypeEX;
                        }
                    }
                    else
                    {
                        Reporter.ToUser(eUserMsgKeys.NoItemWasSelected);
                        return;
                    }
                    aNew.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();

                    //adding the new act after the selected action in the grid
                    //TODO: Add should be after the last, Insert should be in the middle...



                    int selectedActIndex = -1;
                    if (mActionsList.CurrentItem != null)
                    {
                        selectedActIndex = mActionsList.IndexOf((Act)mActionsList.CurrentItem);
                    }
                    mActionsList.Add(aNew);
                    if (selectedActIndex >= 0)
                    {
                        mActionsList.Move(mActionsList.Count - 1, selectedActIndex + 1);
                    }

                    _pageGenericWin.Close();

                    //allowing to edit the action
                    ActionEditPage actedit = new ActionEditPage(aNew);
                    actedit.ShowAsWindow();

                    if (aNew is ActPlugIn)
                    {
                        ActPlugIn p = (ActPlugIn)aNew;
                        // TODO: add per group or... !!!!!!!!!

                        //Check if target already exist else add it
                        // TODO: search only in targetplugin type
                        TargetPlugin targetPlugin = (TargetPlugin)(from x in App.BusinessFlow.TargetApplications where x.Name == p.ServiceId select x).SingleOrDefault();
                        if (targetPlugin == null)
                        {
                            // check if interface add it
                            // App.BusinessFlow.TargetApplications.Add(new TargetPlugin() { AppName = p.ServiceId });

                            App.BusinessFlow.TargetApplications.Add(new TargetPlugin()
                            {
                                PluginId = p.PluginId, ServiceId = p.ServiceId
                            });

                            //Search for default agent which match
                            App.AutomateTabGingerRunner.UpdateApplicationAgents();
                            // TODO: update automate page target/agent

                            // if agent not found auto add or ask user
                        }
                    }
                }
            }
        }