Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        static async Task Main(string[] args)
        {
            try
            {
                _zeebeContext = new ZeebeContext(_zeebeUrl);

                var pathOrderProcess = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "workflows", "order-process.bpmn");

                var pathOrderPaymentLinkProcess = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "workflows", "payment_link.bpmn");

                //var pathOrderProcessSalesForce = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "workflows", "order-process-salesforce.bpmn");

                //var pathTimerEmail = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "workflows", "timer-email.bpmn");

                await _zeebeContext.GetTopology();

                await _zeebeContext.DeployProcess(pathOrderProcess);

                await _zeebeContext.DeployProcess(pathOrderPaymentLinkProcess);

                //await _zeebeContext.DeployProcess(pathOrderProcessSalesForce);
                //await _zeebeContext.DeployProcess(pathTimerEmail);
            }
            catch (Exception ex)
            {
                Utils.WriteMessage(ex.Message, ConsoleColor.Red);
                Utils.WriteMessage(ex.StackTrace, ConsoleColor.Red);
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            try
            {
                var zeebeContext = new ZeebeContext(_zeebeUrl);

                var paymentJob  = new PaymentJob(zeebeContext.Client);
                var shipmentJob = new ShipmentJob(zeebeContext.Client);

                var emailJob           = new EmailJob(zeebeContext.Client);
                var databaseCleanerJob = new CleanDataBaseJob(zeebeContext.Client);

                var createPaymentLinkJob       = new CreatePaymentLinkJob(zeebeContext.Client);
                var paymentLinNotificationkJob = new PaymentLinkNotificationJob(zeebeContext.Client);

                Task.Factory.StartNew(() => paymentJob.StartWorker("payment-service-op", Environment.MachineName));
                Task.Factory.StartNew(() => shipmentJob.StartWorker("shipment-service-op", Environment.MachineName));

                Task.Factory.StartNew(() => emailJob.StartWorker("email-service", Environment.MachineName));
                Task.Factory.StartNew(() => databaseCleanerJob.StartWorker("cleaner-service", Environment.MachineName));

                Task.Factory.StartNew(() => createPaymentLinkJob.StartWorker("link-service", Environment.MachineName));
                Task.Factory.StartNew(() => paymentLinNotificationkJob.StartWorker("link-status-service", Environment.MachineName));

                Console.ReadLine();

                paymentJob.StopCurrentWorker();
                shipmentJob.StopCurrentWorker();

                emailJob.StopCurrentWorker();
                databaseCleanerJob.StopCurrentWorker();

                createPaymentLinkJob.StopCurrentWorker();
                paymentLinNotificationkJob.StopCurrentWorker();
            }
            catch (Exception ex)
            {
                Utils.WriteMessage(ex.Message, ConsoleColor.Red);
            }
        }