public bool ExecuteAction(string actionName)
        {
            try
            {
                ShellInteractionService.ShowProgress();

                try
                {
                    ActionCatalog.Execute(actionName, WorkItem, this, null);
                    return(true);
                }
                finally
                {
                    ShellInteractionService.HideProgress();
                }
            }
            catch (Imi.SupplyChain.UX.ValidationException ex)
            {
                return(false);
            }
            catch (Exception ex)
            {
                ShellInteractionService.ShowMessageBox(StringResources.ActionException_Text, ex.Message, ex.ToString(), Infrastructure.MessageBoxButton.Ok, Infrastructure.MessageBoxImage.Error);
            }

            return(false);
        }
 public void PackStationOverviewPackRowEventHandler(object sender, EventArgs eventArgs)
 {
     if (eventArgs is Imi.SupplyChain.Warehouse.UX.Views.PickLoadCarrier.PackStationOverviewPackRowEventArgs)
     {
         ActionCatalog.Execute(WorkItem.Items.FindByType <PackStationActions>().LastOrDefault().PackStationOverviewRunPackRowForPackStation, WorkItem, this, eventArgs as Imi.SupplyChain.Warehouse.UX.Views.PickLoadCarrier.PackStationOverviewPackRowEventArgs);
     }
 }
Beispiel #3
0
 private void Init()
 {
     NBehaveInitializer.Initialize(ConfigurationNoAppDomain.New.SetEventListener(NBehave.EventListeners.EventListeners.NullEventListener()));
     actionCatalog    = TinyIoCContainer.Current.Resolve <ActionCatalog>();
     stringStepRunner = new StringStepRunner(actionCatalog);
     runner           = new FeatureRunner(stringStepRunner, TinyIoCContainer.Current.Resolve <IRunContext>());
 }
        public override void OnBuiltUp(string id)
        {
            base.OnBuiltUp(id);

            packStationOverviewRunPackRowForPackStation += "/" + id;
            ActionCatalog.RegisterActionImplementation(packStationOverviewRunPackRowForPackStation, OnPackStationOverviewRunPackRowForPackStation);
            //ActionCatalog.RegisterSpecificCondition(packStationFromLcEditRunPackRowForPackStation, new PackStationFromLcEditRunPackRowForPackStationCondition());
        }
 public ActionStepStepResolver(object stepHelper)
 {
     _stepHelper    = stepHelper;
     _actionCatalog = new ActionCatalog();
     _stepParser    = new ActionStepParser(new StoryRunnerFilter(), _actionCatalog);
     _stepParser.FindActionStepMethods(stepHelper.GetType(), _stepHelper);
     _parameterConverter = new ParameterConverter(_actionCatalog);
 }
 private void ExecuteActions()
 {
     WorkItem.Items.AddNew <ModuleActions>();
     ActionCatalog.Execute(ActionNames.ShowCustomerQueueManagementView, WorkItem, this, null);
     ActionCatalog.Execute(ActionNames.ShowOfficerQueueView, WorkItem, this, null);
     ActionCatalog.Execute(ActionNames.ServiceCustomerAction, WorkItem, this, null);
     ActionCatalog.Execute(ActionNames.ShowAddVisitorToQueueCommand, WorkItem, this, null);
     ActionCatalog.Execute(ActionNames.ShowFindCustomerCommand, WorkItem, this, null);
 }
Beispiel #7
0
        public virtual void SetUp()
        {
            hooksCatalog  = new HooksCatalog();
            actionCatalog = new ActionCatalog();
            var runContext = new RunContext(MockRepository.GenerateStub <IContextHandler>(), new HooksHandler(hooksCatalog));
            IStringStepRunner stringStepRunner = new StringStepRunner(actionCatalog);

            featureRunner = new FeatureRunner(stringStepRunner, runContext);
        }
        private void ServiceCustomer(QueueEntry entry)
        {
            ICurrentQueueEntryService currentEntryService = WorkItem.Services.Get <ICurrentQueueEntryService>();

            currentEntryService.CurrentEntry = entry;
            AssignCustomerToServicing(entry);
            GetOrCreateEntryWorkItem(entry).Activate();
            ActionCatalog.Execute(ActionNames.ActivateOfficerQueueView, WorkItem, this, null);
        }
        public override void OnPackStationOverviewRunUndoPacking(WorkItem context, object caller, object target)
        {
            WorkItem wi = GetModuleWorkItem(context);

            if (wi.Items.FindByType <RunUndoPackingAction>().Count == 0)
            {
                wi.Items.AddNew <RunUndoPackingAction>();
            }

            RunUndoPackingActionParameters actionParameters = null;
            PackStationOverviewViewToRunUndoPackingActionTranslator translator = null;

            if (context.Items.FindByType <PackStationOverviewViewToRunUndoPackingActionTranslator>().Count > 0)
            {
                translator = context.Items.FindByType <PackStationOverviewViewToRunUndoPackingActionTranslator>().Last();
            }
            else
            {
                translator = context.Items.AddNew <PackStationOverviewViewToRunUndoPackingActionTranslator>();
            }

            PackStationOverviewPresenter overviewPresenter = null;

            if (context.Items.FindByType <PackStationOverviewPresenter>().Count > 0)
            {
                overviewPresenter = context.Items.FindByType <PackStationOverviewPresenter>().Last();
            }
            if (overviewPresenter == null)
            {
                return;
            }

            actionParameters = translator.Translate(overviewPresenter.ToLoadCarrierId);
            actionParameters.IsItemSelected          = true;
            actionParameters.IsMultipleItemsSelected = false;

            IPackStationOverviewView view = context.SmartParts.FindByType <PackStationOverviewView>().Last();

            try
            {
                ActionCatalog.Execute(ActionNames.RunUndoPacking, context, caller, actionParameters);

                // Check if view should be closed.
                bool ignoreClosing = ((context.Items.Get("IgnoreClose") != null) &&
                                      ((bool)(context.Items.Get("IgnoreClose"))));

                overviewPresenter.ClearAllButPackedBy();
            }
            catch (Imi.SupplyChain.UX.ValidationException ex)
            {
                view.HandleValidationResult(ValidationHelper.ConvertToResult((Imi.SupplyChain.UX.ValidationException)ex));
            }
        }
Beispiel #10
0
        private void CreateActionCatalog()
        {
            actionCatalog = new ActionCatalog();
            Action <string> given = x => { };

            actionCatalog.Add(new ActionMethodInfo("name $x".AsRegex(), given, given.Method, "Given"));
            Action when = () => { };

            actionCatalog.Add(new ActionMethodInfo("greeted".AsRegex(), when, when.Method, "When"));
            Action <string> then = y => Assert.AreEqual("Nisse", y);

            actionCatalog.Add(new ActionMethodInfo("Hello $y".AsRegex(), then, then.Method, "Then"));
        }
Beispiel #11
0
            public void EstablishContext()
            {
                _wasCalled     = false;
                _actionCatalog = new ActionCatalog();
                Action firstAction  = () => Assert.Fail("This action shouldnt be called");
                var    actionMethod = new ActionMethodInfo(new Regex("def$"), firstAction, firstAction.Method, "Given", this);

                _actionCatalog.Add(actionMethod);

                Action secondAction       = () => { _wasCalled = true; };
                var    secondActionMethod = new ActionMethodInfo(new Regex("abc def$"), secondAction, secondAction.Method, "Given", this);

                _actionCatalog.Add(secondActionMethod);
            }
Beispiel #12
0
            public void ShouldConsiderAllWhitespaceAsEqual()
            {
                var catalog = new ActionCatalog();

                var action = new ActionMethodInfo(
                    "my savings account\nbalance is $balance".AsRegex(),
                    new object(),
                    GetDummyParameterInfo(),
                    null);

                catalog.Add(action);
                var actionExists = catalog.ActionExists("Given my\tsavings account balance is 500".AsStringStep(""));

                Assert.That(actionExists, Is.True);
            }
Beispiel #13
0
            public void ShouldGetAction()
            {
                var catalog = new ActionCatalog();

                var action = new ActionMethodInfo(
                    "my savings account balance is $balance".AsRegex(),
                    new object(),
                    GetDummyParameterInfo(),
                    null);

                catalog.Add(action);

                var actionResult = catalog.GetAction(new StringStep("Given", "my savings account balance is 500", ""));

                Assert.That(actionResult, Is.Not.Null);
            }
Beispiel #14
0
            public void ShouldGetActionWithTokenInMiddleOfString()
            {
                var          catalog = new ActionCatalog();
                Action <int> action  = accountBalance => { };

                var actionMethodInfo = new ActionMethodInfo(
                    "I have $amount euros on my cash account".AsRegex(),
                    action,
                    action.Method,
                    null);

                catalog.Add(actionMethodInfo);

                var actionFetched = catalog.GetAction(new StringStep("Given", "I have 20 euros on my cash account", ""));

                Assert.That(actionFetched, Is.Not.Null);
            }
Beispiel #15
0
        // Called when action list is to be updated on screen
        public void ShowActions(string actionString)
        {
            //System.Diagnostics.Debug.WriteLine("Entering ShowActions on Dialog " + View.Id + ",    " + actionString);

            ICollection <ShellAction> serviceActions = ShellInteractionService.Actions;

            // remove old Action data
            ICollection <ShellAction> tempActions = new List <ShellAction>();;

            foreach (ShellAction shellAction in serviceActions)
            {
                tempActions.Add(shellAction);
            }

            foreach (ShellAction shellAction in tempActions)
            {
                ActionCatalog.RemoveActionImplementation(shellAction.Id);
                serviceActions.Remove(shellAction);
            }
            actions.Clear();
            if (actionString.Length == 0)
            {
                return;
            }

            // decode actionString and add new Actions
            char[]      delimiter    = { ';' };
            string[]    actionsArray = actionString.Split(delimiter);
            ShellAction action;

            for (int i = 0; i < actionsArray.Length - 1; i = i + 2)
            {
                action              = new ShellAction(workItem);
                action.Id           = (string)actionsArray.GetValue(i) + Separator + View.Id; // make sure Id is unique!
                action.Caption      = (string)actionsArray.GetValue(i + 1);
                action.IsAuthorized = true;
                action.IsEnabled    = true;
                action.Parameters   = action.Id;
                actions.Add(action);

                ActionCatalog.RegisterActionImplementation(action.Id, OnAction);
                serviceActions.Add(action);
                //System.Diagnostics.Debug.WriteLine("action " + action.Caption + " was added");
            }
        }
Beispiel #16
0
            public void EstablishContext()
            {
                _actionCatalog = new ActionCatalog();
                Action <string, string> firstAction = (a, b) => { };
                var stepMatcher  = "$a and $b".AsRegex();
                var actionMethod = new ActionMethodInfo(stepMatcher, firstAction, firstAction.Method, "Given", this);

                _actionCatalog.Add(actionMethod);

                Action <FooBar> secondAction       = _ => { };
                var             secondActionMethod = new ActionMethodInfo(stepMatcher, secondAction, secondAction.Method, "Given", this);

                _actionCatalog.Add(secondActionMethod);

                Action <List <FooBar> > thirdAction = _ => { };
                var thirdActionMethod = new ActionMethodInfo(stepMatcher, thirdAction, thirdAction.Method, "Given", this);

                _actionCatalog.Add(thirdActionMethod);
            }
Beispiel #17
0
 public override void SetUp()
 {
     _actionCatalog    = new ActionCatalog();
     _actionStepParser = new ActionStepParser(_storyRunnerFilter, _actionCatalog);
     _actionStepParser.FindActionSteps(typeof(TestLib.ConfigFileActionSteps).Assembly);
 }
 public bool CanActionExecute(string actionName)
 {
     return(ActionCatalog.CanExecute(actionName, WorkItem, this, null));
 }
Beispiel #19
0
 public virtual void SetUp()
 {
     _actionCatalog    = new ActionCatalog();
     _actionStepParser = new ActionStepParser(_storyRunnerFilter, _actionCatalog);
     _actionStepParser.FindActionSteps(GetType().Assembly);
 }
        public override void OnPackStationToLCRunFinishPackingWorkflow(WorkItem context, object caller, object target)
        {
            WorkItem wi = GetModuleWorkItem(context);

            if (wi.Items.FindByType <RunFinishPackingWorkflowAction>().Count == 0)
            {
                wi.Items.AddNew <RunFinishPackingWorkflowAction>();
            }

            PackStationToLCViewResult viewResult = null;
            RunFinishPackingWorkflowActionParameters actionParameters = null;
            PackStationToLCViewToRunFinishPackingWorkflowActionTranslator translator = null;
            bool isItemSelected = false;

            if (context.Items.FindByType <PackStationToLCViewToRunFinishPackingWorkflowActionTranslator>().Count > 0)
            {
                translator = context.Items.FindByType <PackStationToLCViewToRunFinishPackingWorkflowActionTranslator>().Last();
            }
            else
            {
                translator = context.Items.AddNew <PackStationToLCViewToRunFinishPackingWorkflowActionTranslator>();
            }

            if (context.Items.FindByType <PackStationToLCViewResult>().Count > 0)
            {
                viewResult     = context.Items.FindByType <PackStationToLCViewResult>().Last();
                isItemSelected = true;
            }
            else
            {
                viewResult = new PackStationToLCViewResult();

                if (context.Items.FindByType <PackStationToLCViewParameters>().Count() > 0)
                {
                    PackStationToLCViewParameters viewParameters = context.Items.FindByType <PackStationToLCViewParameters>().Last();
                }
            }
            actionParameters = translator.Translate(viewResult);
            actionParameters.IsItemSelected          = isItemSelected;
            actionParameters.IsMultipleItemsSelected = false;

            if (context.Items.FindByType <PackStationOverviewViewParameters>().Count > 0)
            {
                PackStationOverviewViewParameters overviewParameters = context.Items.FindByType <PackStationOverviewViewParameters>().Last();
                IPackStationToLCView         view = context.SmartParts.FindByType <PackStationToLCView>().Last();
                PackStationOverviewPresenter overviewPresenter = context.Items.FindByType <PackStationOverviewPresenter>().Last();

                actionParameters.UserId = overviewParameters.UserId;
                try
                {
                    if (!view.Validate())
                    {
                        return;
                    }

                    ActionCatalog.Execute(ActionNames.RunFinishPackingWorkflow, context, caller, actionParameters);

                    // Check if view should be closed.
                    bool ignoreClosing = ((context.Items.Get("IgnoreClose") != null) &&
                                          ((bool)(context.Items.Get("IgnoreClose"))));

                    overviewPresenter.ToLoadCarrierId = string.Empty;
                    overviewPresenter.ClearAllButPackedBy();
                }
                catch (Imi.SupplyChain.UX.ValidationException ex)
                {
                    view.HandleValidationResult(ValidationHelper.ConvertToResult((Imi.SupplyChain.UX.ValidationException)ex));
                }
            }
        }
        public override void OnPackStationFromLcEditRunPackRowForPackStation(WorkItem context, object caller, object target)
        {
            WorkItem wi = GetModuleWorkItem(context);

            if (wi.Items.FindByType <RunPackRowForPackStationAction>().Count == 0)
            {
                wi.Items.AddNew <RunPackRowForPackStationAction>();
            }

            PackStationFromLcEditViewResult          viewResult       = null;
            RunPackRowForPackStationActionParameters actionParameters = null;
            PackStationFromLcEditViewToRunPackRowForPackStationActionTranslator translator = null;
            bool isItemSelected = false;

            if (context.Items.FindByType <PackStationFromLcEditViewToRunPackRowForPackStationActionTranslator>().Count > 0)
            {
                translator = context.Items.FindByType <PackStationFromLcEditViewToRunPackRowForPackStationActionTranslator>().Last();
            }
            else
            {
                translator = context.Items.AddNew <PackStationFromLcEditViewToRunPackRowForPackStationActionTranslator>();
            }

            if (context.Items.FindByType <PackStationFromLcEditViewResult>().Count > 0)
            {
                viewResult     = context.Items.FindByType <PackStationFromLcEditViewResult>().Last();
                isItemSelected = true;
            }
            else
            {
                viewResult = new PackStationFromLcEditViewResult();

                if (context.Items.FindByType <PackStationFromLcEditViewParameters>().Count() > 0)
                {
                    PackStationFromLcEditViewParameters viewParameters = context.Items.FindByType <PackStationFromLcEditViewParameters>().Last();
                }
            }

            actionParameters = translator.Translate(viewResult);
            if (context.Items.FindByType <PackStationOverviewPresenter>().Count > 0)
            {
                if (!string.IsNullOrEmpty(context.Items.FindByType <PackStationOverviewPresenter>().Last().ToLoadCarrierId))
                {
                    actionParameters.ToLoadCarrierId = context.Items.FindByType <PackStationOverviewPresenter>().Last().ToLoadCarrierId;
                }
                else
                {
                    actionParameters.ToLoadCarrierId = string.Empty;
                }
            }
            actionParameters.IsItemSelected          = isItemSelected;
            actionParameters.IsMultipleItemsSelected = false;

            IPackStationFromLcEditView view = context.SmartParts.FindByType <PackStationFromLcEditView>().Last();

            IPackStationOverviewView packStationOverviewView = context.SmartParts.FindByType <IPackStationOverviewView>().LastOrDefault();
            IPackStationFromLCView   packStationFromLcView   = context.SmartParts.FindByType <IPackStationFromLCView>().LastOrDefault();
            IPackStationToLCView     packStationToLcView     = context.SmartParts.FindByType <IPackStationToLCView>().LastOrDefault();

            try
            {
                if (!view.Validate())
                {
                    return;
                }

                ActionCatalog.Execute(ActionNames.RunPackRowForPackStation, context, caller, actionParameters);

                // Check if view should be closed.
                bool ignoreClosing = ((context.Items.Get("IgnoreClose") != null) &&
                                      ((bool)(context.Items.Get("IgnoreClose"))));

                if (context.Items.Contains("RefreshPackStationOverview"))
                {
                    if (((bool)context.Items["RefreshPackStationOverview"]))
                    {
                        packStationOverviewView.Refresh();
                    }
                    else
                    {
                        if (packStationFromLcView != null)
                        {
                            packStationFromLcView.Refresh();
                        }

                        if (packStationToLcView != null)
                        {
                            packStationToLcView.Refresh();
                        }
                    }
                }
                else
                {
                    if (packStationFromLcView != null)
                    {
                        packStationFromLcView.Refresh();
                    }

                    if (packStationToLcView != null)
                    {
                        packStationToLcView.Refresh();
                    }
                }
            }
            catch (Imi.SupplyChain.UX.ValidationException ex)
            {
                view.HandleValidationResult(ValidationHelper.ConvertToResult((Imi.SupplyChain.UX.ValidationException)ex));
            }
        }
 public virtual void Setup()
 {
     actionCatalog = new ActionCatalog();
     runner        = new StringStepRunner(actionCatalog);
 }
        public virtual void OnPackStationOverviewRunPackRowForPackStation(WorkItem context, object caller, object target)
        {
            if (target is Imi.SupplyChain.Warehouse.UX.Views.PickLoadCarrier.PackStationOverviewPackRowEventArgs)
            {
                WorkItem wi = GetModuleWorkItem(context);

                if (wi.Items.FindByType <RunPackRowForPackStationAction>().Count == 0)
                {
                    wi.Items.AddNew <RunPackRowForPackStationAction>();
                }

                Imi.SupplyChain.Warehouse.UX.Views.PickLoadCarrier.PackStationOverviewPackRowEventArgs args = target as Imi.SupplyChain.Warehouse.UX.Views.PickLoadCarrier.PackStationOverviewPackRowEventArgs;

                RunPackRowForPackStationActionParameters actionParameters = new RunPackRowForPackStationActionParameters();
                actionParameters.FromLoadCarrierId   = args.FromLoadCarrier;
                actionParameters.ToLoadCarrierId     = args.ToLoadCarrier;
                actionParameters.PickOrderLineNumber = args.PickOrderLineNumber;
                actionParameters.PickedQuantity      = args.QuantityToPack;
                actionParameters.IsItemSelected      = true;

                IPackStationOverviewView packStationOverviewView = context.SmartParts.FindByType <IPackStationOverviewView>().LastOrDefault();
                IPackStationFromLCView   packStationFromLcView   = context.SmartParts.FindByType <IPackStationFromLCView>().LastOrDefault();
                IPackStationToLCView     packStationToLcView     = context.SmartParts.FindByType <IPackStationToLCView>().LastOrDefault();

                try
                {
                    ActionCatalog.Execute(ActionNames.RunPackRowForPackStation, context, caller, actionParameters);

                    if (context.Items.Contains("RefreshPackStationOverview"))
                    {
                        if (((bool)context.Items["RefreshPackStationOverview"]))
                        {
                            packStationOverviewView.Refresh();
                        }
                        else
                        {
                            if (packStationFromLcView != null)
                            {
                                packStationFromLcView.Refresh();
                            }

                            if (packStationToLcView != null)
                            {
                                packStationToLcView.Refresh();
                            }
                        }
                    }
                    else
                    {
                        if (packStationFromLcView != null)
                        {
                            packStationFromLcView.Refresh();
                        }

                        if (packStationToLcView != null)
                        {
                            packStationToLcView.Refresh();
                        }
                    }
                }
                catch
                {
                    throw;
                }
            }
        }
Beispiel #24
0
 public void EstablishContext()
 {
     _actionCatalog      = new ActionCatalog();
     _parameterConverter = new ParameterConverter(_actionCatalog);
 }
 public void PackStationOverviewStopPackingEventHandler(object sender, EventArgs eventArgs)
 {
     ActionCatalog.Execute(WorkItem.Items.FindByType <PackStationActions>().LastOrDefault().PackStationOverviewRunStopPacking, WorkItem, this, null);
 }
Beispiel #26
0
        public override void OnCreateCustomsDeclarationRunCreateCustomsDeclaration(WorkItem context, object caller, object target)
        {
            WorkItem wi = GetModuleWorkItem(context);

            if (wi.Items.FindByType <RunCreateCustomsDeclarationAction>().Count == 0)
            {
                wi.Items.AddNew <RunCreateCustomsDeclarationAction>();
            }

            CreateCustomsDeclarationViewResult          viewResult       = null;
            RunCreateCustomsDeclarationActionParameters actionParameters = null;
            CreateCustomsDeclarationViewToRunCreateCustomsDeclarationActionTranslator translator = null;
            bool isItemSelected = false;

            if (context.Items.FindByType <CreateCustomsDeclarationViewToRunCreateCustomsDeclarationActionTranslator>().Count > 0)
            {
                translator = context.Items.FindByType <CreateCustomsDeclarationViewToRunCreateCustomsDeclarationActionTranslator>().Last();
            }
            else
            {
                translator = context.Items.AddNew <CreateCustomsDeclarationViewToRunCreateCustomsDeclarationActionTranslator>();
            }

            if (context.Items.FindByType <CreateCustomsDeclarationViewResult>().Count > 0)
            {
                viewResult     = context.Items.FindByType <CreateCustomsDeclarationViewResult>().Last();
                isItemSelected = true;
            }
            else
            {
                viewResult = new CreateCustomsDeclarationViewResult();

                if (context.Items.FindByType <CreateCustomsDeclarationViewParameters>().Count() > 0)
                {
                    CreateCustomsDeclarationViewParameters viewParameters = context.Items.FindByType <CreateCustomsDeclarationViewParameters>().Last();

                    viewResult.CustomsDeclarantId = viewParameters.CustomsDeclarantId;
                }
            }

            actionParameters = translator.Translate(viewResult);
            actionParameters.IsItemSelected          = isItemSelected;
            actionParameters.IsMultipleItemsSelected = false;

            ICreateCustomsDeclarationView view = context.SmartParts.FindByType <CreateCustomsDeclarationView>().Last();

            try
            {
                if (!view.Validate())
                {
                    return;
                }

                ActionCatalog.Execute(ActionNames.RunCreateCustomsDeclaration, context, caller, actionParameters);

                if (isItemSelected)
                {
                    if (context.Items.Get("CreateCustomsDeclarationResponse") != null)
                    {
                        CreateCustomsDeclarationResponse serviceResponce = (CreateCustomsDeclarationResponse)context.Items.Get("CreateCustomsDeclarationResponse");

                        if (serviceResponce.CreateCustomsDeclarationResult != null)
                        {
                            if (serviceResponce.CreateCustomsDeclarationResult.CustomsDeclarationId != null)
                            {
                                viewResult.CustomsDeclarationId = serviceResponce.CreateCustomsDeclarationResult.CustomsDeclarationId;
                            }
                        }
                    }
                }

                // Check if view should be closed.
                bool ignoreClosing = ((context.Items.Get("IgnoreClose") != null) &&
                                      ((bool)(context.Items.Get("IgnoreClose"))));

                if (!ignoreClosing)
                {
                    /* close wrapper if view was dynamically loaded */
                    object wrapper = context.Items.Get("Imi.SupplyChain.Warehouse.UX.Views.CustomsDeclaration.ICreateCustomsDeclarationView");

                    if (wrapper == null)
                    {
                        WorkspaceLocatorService.FindContainingWorkspace(context, view).Close(view);
                    }
                    else
                    {
                        WorkspaceLocatorService.FindContainingWorkspace(context, wrapper).Close(wrapper);
                    }
                }
            }
            catch (Imi.SupplyChain.UX.ValidationException ex)
            {
                view.HandleValidationResult(ValidationHelper.ConvertToResult((Imi.SupplyChain.UX.ValidationException)ex));
            }
        }