public void ActivityTypeToActionTypeConverter_ConvertToActionType_ConvertPluginService_ExpectedPluginServiceEnum() { //------------Execute Test--------------------------- var actionType = ActivityTypeToActionTypeConverter.ConvertToActionType("PluginService"); //------------Assert Results------------------------- Assert.AreEqual(enActionType.Plugin, actionType); }
public void ActivityTypeToActionTypeConverter_ConvertToActionType_ConvertDbService_ExpectedDbServiceEnum() { //------------Execute Test--------------------------- var actionType = ActivityTypeToActionTypeConverter.ConvertToActionType("DbService"); //------------Assert Results------------------------- Assert.AreEqual(enActionType.InvokeStoredProc, actionType); }
public void ActivityTypeToActionTypeConverter_ConvertToActionType_ConvertWorkflow_ExpectedWorkflowEnum() { //------------Execute Test--------------------------- var actionType = ActivityTypeToActionTypeConverter.ConvertToActionType("Workflow"); //------------Assert Results------------------------- Assert.AreEqual(enActionType.Workflow, actionType); }
public void ActivityTypeToActionTypeConverter_ConvertToActionType_ConvertWebService_ExpectedWebServiceEnum() { //------------Execute Test--------------------------- enActionType actionType = ActivityTypeToActionTypeConverter.ConvertToActionType("WebService"); //------------Assert Results------------------------- Assert.AreEqual(enActionType.InvokeWebService, actionType); }
void InitializeImageSource() { Common.Interfaces.Core.DynamicServices.enActionType actionType = ActivityTypeToActionTypeConverter.ConvertToActionType(Type); ImageSource = GetIconPath(actionType); }
public ServiceDesignerViewModel(ModelItem modelItem, IContextualResourceModel rootModel, IEnvironmentRepository environmentRepository, IEventAggregator eventPublisher, IAsyncWorker asyncWorker) : base(modelItem) { AddTitleBarEditToggle(); AddTitleBarMappingToggle(); // PBI 6690 - 2013.07.04 - TWR : added // BUG 9634 - 2013.07.17 - TWR : resourceModel may be null if it is a remote resource whose environment is not connected! VerifyArgument.IsNotNull("rootModel", rootModel); VerifyArgument.IsNotNull("environmentRepository", environmentRepository); VerifyArgument.IsNotNull("eventPublisher", eventPublisher); VerifyArgument.IsNotNull("asyncWorker", asyncWorker); _worker = asyncWorker; _eventPublisher = eventPublisher; eventPublisher.Subscribe(this); ButtonDisplayValue = DoneText; ShowExampleWorkflowLink = Visibility.Collapsed; RootModel = rootModel; DesignValidationErrors = new ObservableCollection <IErrorInfo>(); FixErrorsCommand = new DelegateCommand(o => { FixErrors(); IsFixed = IsWorstErrorReadOnly; }); DoneCommand = new DelegateCommand(o => Done()); DoneCompletedCommand = new DelegateCommand(o => DoneCompleted()); InitializeDisplayName(); InitializeProperties(); InitializeImageSource(); IsAsyncVisible = ActivityTypeToActionTypeConverter.ConvertToActionType(Type) == Common.Interfaces.Core.DynamicServices.enActionType.Workflow; OutputMappingEnabled = !RunWorkflowAsync; // When the active environment is not local, we need to get smart around this piece of logic. // It is very possible we are treating a remote active as local since we cannot logically assign // an environment id when this is the case as it will fail with source not found since the remote // does not contain localhost's connections ;) var activeEnvironment = environmentRepository.ActiveEnvironment; if (EnvironmentID == Guid.Empty && !activeEnvironment.IsLocalHostCheck()) { _environment = activeEnvironment; } else { var environment = environmentRepository.FindSingle(c => c.ID == EnvironmentID); if (environment == null) { IList <IEnvironmentModel> environments = EnvironmentRepository.Instance.LookupEnvironments(activeEnvironment); environment = environments.FirstOrDefault(model => model.ID == EnvironmentID); } _environment = environment; } InitializeValidationService(_environment); if (!InitializeResourceModel(_environment)) { return; } if (!IsDeleted) { // MUST InitializeMappings() first! InitializeMappings(); InitializeLastValidationMemo(_environment); if (IsItemDragged.Instance.IsDragged) { Expand(); IsItemDragged.Instance.IsDragged = false; } } if (_environment != null) { _environment.AuthorizationServiceSet += OnEnvironmentOnAuthorizationServiceSet; AuthorizationServiceOnPermissionsChanged(null, null); } }
public ServiceDesignerViewModel(ModelItem modelItem, IContextualResourceModel rootModel, IServerRepository serverRepository, IEventAggregator eventPublisher, IAsyncWorker asyncWorker) : base(modelItem) { ValidationMemoManager = new ValidationMemoManager(this); MappingManager = new MappingManager(this); if (modelItem.ItemType != typeof(DsfDatabaseActivity) && modelItem.ItemType != typeof(DsfPluginActivity) && modelItem.ItemType != typeof(DsfWebserviceActivity)) { AddTitleBarEditToggle(); } AddTitleBarMappingToggle(); VerifyArgument.IsNotNull("rootModel", rootModel); VerifyArgument.IsNotNull("environmentRepository", serverRepository); VerifyArgument.IsNotNull("eventPublisher", eventPublisher); VerifyArgument.IsNotNull("asyncWorker", asyncWorker); _worker = asyncWorker; _eventPublisher = eventPublisher; eventPublisher.Subscribe(this); ButtonDisplayValue = DoneText; ShowExampleWorkflowLink = Visibility.Collapsed; RootModel = rootModel; ValidationMemoManager.DesignValidationErrors = new ObservableCollection <IErrorInfo>(); FixErrorsCommand = new DelegateCommand(o => { ValidationMemoManager.FixErrors(); IsFixed = IsWorstErrorReadOnly; }); DoneCommand = new DelegateCommand(o => Done()); DoneCompletedCommand = new DelegateCommand(o => DoneCompleted()); InitializeDisplayName(); InitializeImageSource(); IsAsyncVisible = ActivityTypeToActionTypeConverter.ConvertToActionType(Type) == Common.Interfaces.Core.DynamicServices.enActionType.Workflow; OutputMappingEnabled = !RunWorkflowAsync; var activeEnvironment = serverRepository.ActiveServer; if (EnvironmentID == Guid.Empty && !activeEnvironment.IsLocalHostCheck()) { _environment = activeEnvironment; } else { var environment = serverRepository.FindSingle(c => c.EnvironmentID == EnvironmentID); if (environment == null) { IList <IServer> environments = ServerRepository.Instance.LookupEnvironments(activeEnvironment); environment = environments.FirstOrDefault(model => model.EnvironmentID == EnvironmentID); } _environment = environment; } ValidationMemoManager.InitializeValidationService(_environment); IsLoading = true; _worker.Start(() => InitializeResourceModel(_environment), b => { if (b) { UpdateDesignerAfterResourceLoad(serverRepository); } }); ViewComplexObjectsCommand = new RelayCommand(item => { ViewJsonObjects(item as IComplexObjectItemModel); }, CanViewComplexObjects); }