Ejemplo n.º 1
0
        public void GetCustomerOnboard(Hyland.Unity.Application con, string customerDocument)
        {
            OnbaseSettings onbaseSettings = this.GetOnbaseSettings();
            var            logger         = new FileLogger("C:\\Temp\\OnbaseIntegration.log");

            var statusFilter = new string[]
            {
                "INREVISION"
            };

            try
            {
                var customerRepository         = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(this.GetApiSettings());
                var onbaseConector             = new OnbaseInMemoryConector(con);
                var onbaseCustomerService      = new CustomerOnboardOnbaseService(onbaseSettings, onbaseConector, logger, customerRepository);
                var customerIntegrationUseCase = new CustomerOnboardIntegrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle(new CustomerIntegrationInput
                {
                    StatusFilter = statusFilter
                });
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public void OnWorkflowScriptExecute(Hyland.Unity.Application app, Hyland.Unity.WorkflowEventArgs args)
        {
            OnbaseSettings onbaseSettings = GetOnbaseSettings();
            var            logger         = new FileLogger("C:\\Temp\\OnbaseIntegration.log");

            var statusFilter = new string[]
            {
                "INREVISION"
            };

            try
            {
                var customerRepository         = new CustomerApiRepository(this.GetApiSettings());
                var onbaseConector             = new OnbaseInMemoryConector(app);
                var onbaseCustomerService      = new CustomerOnboardOnbaseService(onbaseSettings, onbaseConector, logger, customerRepository);
                var customerIntegrationUseCase = new CustomerOnboardIntegrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle(new CustomerIntegrationInput
                {
                    StatusFilter = statusFilter
                });
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 public void Disconnect(Hyland.Unity.Application app)
 {
     if (app != null)
     {
         app.Dispose();
     }
 }
Ejemplo n.º 4
0
 public ConfigurationItems(Hyland.Unity.Application app)
 {
     if (app == null)
     {
         throw new ArgumentNullException("app", "The Unity application object is null, make sure to connect first.");
     }
     g_app = app;
 }
Ejemplo n.º 5
0
        public Hyland.Unity.Application Connect(string username, string password)
        {
            try
            {
                Hyland.Unity.OnBaseAuthenticationProperties authProps = Hyland.Unity.Application.CreateOnBaseAuthenticationProperties(g_url, username, password, g_datasource);
                Hyland.Unity.Application app = Hyland.Unity.Application.Connect(authProps);

                return(app);
            }
            catch (InvalidLoginException ex)
            {
                throw new Exception("The credentials entered are invalid.", ex);
            }
            catch (UserAccountLockedException ex)
            {
                throw new Exception("The user account is locked.", ex);
            }
            catch (AuthenticationFailedException ex)
            {
                throw new Exception("Authentication failed.", ex);
            }
            catch (MaxConcurrentLicensesException ex)
            {
                throw new Exception("All licenses are currently in use, please try again later.", ex);
            }
            catch (NamedLicenseNotAvailableException ex)
            {
                throw new Exception("Your license is not availble, please insure you are logged out of other OnBase clients.", ex);
            }
            catch (SystemLockedOutException ex)
            {
                throw new Exception("The system is currently locked, please try back later.", ex);
            }
            catch (UnityAPIException ex)
            {
                throw new Exception("There was an unhandled exception with the Unity API.", ex);
            }
            catch (Exception ex)
            {
                throw new Exception("There was an unhandled exception.", ex);
            }
        }
Ejemplo n.º 6
0
        public void OnWorkflowScriptExecute(Hyland.Unity.Application app, Hyland.Unity.WorkflowEventArgs args)
        {
            var logger = new FileLogger("C:\\Temp\\OnbaseIntegration.log");

            OnbaseSettings onbaseSettings = new OnbaseSettings
            {
                CustomerDocumentType     = "BKO - Cadastro",
                CustomerDocumentFileType = "Unity Form",
                FormIntegrationID        = 117
            };

            CustomerApiSettings apiSettings = new CustomerApiSettings
            {
                BaseUrl              = "https://dev-gapi.simpaul.com.br/",
                IncompletedResource  = "dev/backoffice/client/incomplete",
                ApproveResource      = "dev/backoffice/client/sinacor",
                ReproveResource      = "dev/backoffice/client/{id}/status",
                CustomerResource     = "dev/backoffice/client/onboarding",
                LoginResource        = "dev/backoffice/authentication",
                RegisterAginResource = "dev/backoffice/client/reregister",
                UserLogin            = "******",
                PasswordLogin        = "******"
            };

            try
            {
                var customerRepository = new SimPaulOnbase.Infraestructure.ApiDataAccess.CustomerApiRepository(apiSettings);

                var onbaseConector             = new OnbaseInMemoryConector(app);
                var onbaseCustomerService      = new CustomerTransactionalOnbaseService(onbaseSettings, onbaseConector, logger);
                var customerIntegrationUseCase = new CustomerIncompledIntegrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle();
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.ToString());
            }
        }
        public void OnWorkflowScriptExecute(Hyland.Unity.Application app)
        {
            var onbaseSettings = SettingsService.GetOnbaseSettings();
            var logger         = new FileLogger("C:\\Temp\\OnbaseIntegration_Develop.log");

            try
            {
                logger.Info("Iniciando processo de integração Recadastro");

                var customerRepository    = new CustomerApiRepository(SettingsService.GetApiSettings());
                var onbaseConector        = new OnbaseInMemoryConector(app);
                var onbaseCustomerService = new CustomerReRegistrationOnbaseService(onbaseSettings, onbaseConector, customerRepository, logger);

                var customerIntegrationUseCase = new CustomerRegistrationUseCase(customerRepository, onbaseCustomerService, logger);
                customerIntegrationUseCase.Handle();

                logger.Info("Importação de Recadastrado executada com sucesso");
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.Message);
                throw ex;
            }
        }
 public OnbaseInMemoryConector(Hyland.Unity.Application application)
 {
     _application = application;
 }