Crash when call Ask Parameter inside Ask Question

I got this error when edit data. It is fine if it is the first time enter it but if I edit it, sometime it crash.

It was Ask Parameter Action with the default value.
[?Enter Credit Card Number;(([4-5]\d{15})( exp )(0[1-9]|1[0-2])(/)(\d{2}))?;{ENTITY DATA:Customer:Credit Card#};ON;]

I think it happen because it was called from inside Ask Question. So, I have Ask Question and button execute Ask Parameter Action then go back to Ask Question Screen again. It can only can fired once and next time will crash.

-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.50
Region:      en
DB:          SQ
Machine:     DESKTOP-87JVJCS
User:        sukasem
Date:        9/30/2015
Time:        1:14 AM

    Inner Exception 3
Type:        System.ArgumentException
Message: An element with the same key 'Enter Credit Card Number;(([4-5]\d{15})( exp )(0[1-9]|1[0-2])(/)(\d{2}))?;{ENTITY DATA:Customer:Credit Card#};ON;' already exists in the ExpandoObject.
-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.11.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.11.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.11.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Domain, Version=1.0.0.0
System.Core, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Samba.Persistance, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 10 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -360
--FreePhysicalMemory = 1975800
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.10240

Machine
-DESKTOP-87JVJCS
--Manufacturer = Apple Inc.
--Model = MacBookPro9,2
--TotalPhysicalMemory = 4197130240
--UserName = DESKTOP-87JVJCS\sukasem

-----------------------------

This rule is the same thing if I executed it multiple time it will crash.

Did you trimmed error log ?

Sorry, this is full log

-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.50
Region:      en
DB:          SQ
Machine:     DESKTOP-87JVJCS
User:        sukasem
Date:        9/30/2015
Time:        4:33 PM

User Explanation:

sukasem said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Common.Services.ApplicationState.<>c.<NotifyEvent>b__99_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(String automationCommandName, String automationCommandValue, String nextCommandValue, Boolean executeOnce, Boolean clearSelection)
   at Samba.Modules.PosModule.TicketViewModel.ExecuteAutomationCommand(AutomationCommand automationCommand, String selectedValue, String nextValue)
   at Samba.Modules.PosModule.TicketViewModel.OnExecuteAutomationCommand(CommandContainerButton obj)
   at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Primitives.ToggleButton.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Common.Services.ApplicationState.<>c.<NotifyEvent>b__99_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , IApplicationState , String , Object )
   at Samba.Presentation.Controls.ActionProcessors.AskQuestion.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 2
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at Samba.Presentation.Services.Common.ExtensionMethods.PublishEvent[TEventSubject](TEventSubject eventArgs, String eventTopic, Boolean wait)
   at Samba.Presentation.Common.Services.ApplicationState.<>c.<NotifyEvent>b__99_0(ActionData x)
   at Samba.Services.Implementations.AutomationModule.ActionDataBuilder.InvokeFor(Action`1 dataAction)
   at CallSite.Target(Closure , CallSite , Object , Action`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , IApplicationState , String , Object )
   at Samba.Presentation.Common.Services.CommandExecutionService.ExecuteAutomationCommand(String commandName, String commandValue, Object dataObject)
   at CallSite.Target(Closure , CallSite , ICommandExecutionService , String , String , Object )
   at Samba.Modules.AutomationModule.ActionProcessors.ExecuteAutomationCommand.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 3
Type:        System.ArgumentException
Message:     An element with the same key 'Enter Credit Card Number;(([4-5]\d{15})( exp )(0[1-9]|1[0-2])(/)(\d{2}))?;{ENTITY DATA:Customer:Credit Card#}' already exists in the ExpandoObject.
Source:      System.Core
Stack Trace: at System.Dynamic.ExpandoObject.TrySetValue(Object indexClass, Int32 index, Object value, String name, Boolean ignoreCase, Boolean add)
   at System.Dynamic.ExpandoObject.TryAddMember(String key, Object value)
   at System.Dynamic.ExpandoObject.System.Collections.Generic.IDictionary<System.String,System.Object>.Add(String key, Object value)
   at Samba.Services.Implementations.AutomationModule.RuleQueryBuilder.Execute(List`1 actionContainers)
   at CallSite.Target(Closure , CallSite , Object , List`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.UpdateQueryValues(Object dataObject, List`1 actionContainers)
   at CallSite.Target(Closure , CallSite , RuleExecutor , Object , List`1 )
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWithLogging(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.RuleExecutor.ExecuteWith(Object dataParameter, Action`1 dataAction)
   at Samba.Services.Implementations.AutomationModule.NotificationService.NotifyEvent(String eventName, Object dataParameter, Int32 terminalId, Int32 departmentId, Int32 userRoleId, Int32 ticketTypeId, Action`1 dataAction)
   at Samba.Presentation.Common.Services.ApplicationState.NotifyEvent(String eventName, Object dataObject)
   at CallSite.Target(Closure , CallSite , IApplicationState , String , Object )
   at Samba.Presentation.Controls.ActionProcessors.AskQuestion.Process(ActionData actionData)
   at Samba.Services.Common.RuleActionTypeRegistry.ProcessAction(String actionType, ActionData actionData)
   at Samba.Services.Implementations.AutomationModule.AutomationService.ProcessAction(String actionType, ActionData actionData)
   at Samba.Modules.AutomationModule.AutomationModule.<OnInitialization>b__5_0(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
DevExpress.Xpf.LayoutControl.v14.1, Version=14.1.11.0
System.Xml, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.11.0
System, Version=4.0.0.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.11.0
WindowsBase, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Domain, Version=1.0.0.0
System.Core, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Runtime.Serialization, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
Stateless, Version=1.0.0.0
PropertyTools, Version=2012.4.14.1
Samba.Localization, Version=1.0.0.0
ReachFramework, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
EntityFramework, Version=6.0.0.0
FluentValidation, Version=3.4.0.0
Omu.ValueInjecter, Version=2.3.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Samba.Persistance, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 10 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -360
--FreePhysicalMemory = 1682112
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.10240

Machine
-DESKTOP-87JVJCS
--Manufacturer = Apple Inc.
--Model = MacBookPro9,2
--TotalPhysicalMemory = 4197130240
--UserName = DESKTOP-87JVJCS\sukasem

-----------------------------

I think that explains the error pretty good.

I would say the issue is not that rule… its the rule handeling the Automation Command executed… can you show that?


The Rule AC Store CC Card is not an issue if I did not execute it under Ask Question. Every other Ask Parameter that executed under Ask question that loop back to Ask Question again will crash.

What do you mean loop back to ask question?

See execute automation command that call ask question again after finished ask parameter

I dont see another ask question?

ohh I see what your saying… what is the reason to loop that? How do you stop the loop?

Its probably looping it before you enter your value for the first action btw.

Because server will have to do something else on main Ask Question.

You might want to rethink that flow. Maybe use a different event like Ticket Tag updated…instead of looping it in same rule.

The second action is not going to wait for first action to finish before it executes. Once the dialog pops up its already executed the other action regardless if you entered data yet or not.

1 Like

Well, not that it is causing your crash (though it might be), you really should stop naming things with the [square brackets] because they have special meaning and the engine might try to parse them.

Looks like you are creating a loop. One Rule calls the other, which in turn calls the original… how do you get out?

1 Like

You can see that we are stumped atm and its not lack of understanding… its lack of information. Maybe explain your entire process and show us what its doing. I see some scripts in there too…

1 Like

OK, I will rename it. There is Cancel & Close Ticket buttons to get out of Ask Question.

I was using it without looping. It was fine but I have to click Main delivery again SO, I thought why not just looping it, maybe it is not a good idea.

It is Dynamic Buttons (It is cool using script) :wink: Maybe we should have script instead of rule or Script box in the Rule instead :smile:

function mainMenuButtons(TicketType,TicketStatus,DeliveryCharged,AutoFee,PayOut) {
	DeliveryCharged = Number(DeliveryCharged);
	PayOut = Number(PayOut.replace(/ Re-Settle/g,""));
	var buttonList = '';
	if (TicketType == 'Online') {
		buttonList = "Pay Cash,Pay Customer Account,Delivery Payout,Cancel";	
	} else {
		switch(TicketStatus) {
	     	case 'New Orders':
				buttonList = "Auto Delivery Fee $"+AutoFee+"="+AutoFee+",Manual Delivery Fee,Credit Card Info,Pickup Time,Close Ticket,Cancel";
	        	break;
	     	case 'Unpaid':
				if (DeliveryCharged < 1){
					buttonList = "Auto Delivery Fee $"+AutoFee+"="+AutoFee+",Manual Delivery Fee,Credit Card Info,Close Ticket,Cancel";
				}
				if (DeliveryCharged > 0 && PayOut < 1){
					buttonList = "Print Bill,Credit Card Info,Manual Delivery Fee,Save Delivery Fee,Delivery Payout,Close Ticket,Cancel";	
				}			
				if (DeliveryCharged > 0 && PayOut > 0){
					buttonList = "Pay Cash,Pay Debit/Credit,Delivery Payout,Cancel";			
				}			
				break;
	     	default:
	         	buttonList = "Print Bill,Credit Card Info,Manual Delivery Fee,Delivery Payout,Pay Cash,Pay Debit/Credit,Pay Customer Account,Cancel";
	 	}		
	}

	return buttonList;			
}

1 Like

Cool. Yah, scripting rox!

2 Likes

OK, I narrow down a bit. It will crash if Ask Question Rule was call be Execute Automation Command in another rule.

For Ex, If I click Cancel button in Ask Question (which is call by Execute Automation Command from another rule to break it) so, it go back to order screen then I click Automation Command button for Ask Question Rule directly, It will not crash when I execute Ask parameter.

So, it seem I can’t loop it. :frowning:

I’m not sure if I’m getting what you need correctly but regarding error log I’ve fixed the issue.

1 Like