private void ActivateChiefEditor()
        {
            try
            {
                FetchAndLockResponse response = _camundaService.FetchAndLockExternalTask(_workerId, "ObradaUnetihPodatakaiPotrvdaGlUrednika", new[] { "issnBroj" });

                if (!response.Success)
                {
                    Thread.Sleep(500);
                    return;
                }

                var ISSNbroj = (string)response.ResponseData.variables["issnBroj"].value;
                var magazine = _dbContext.Casopisi.FirstOrDefault(x => x.ISSNbroj == ISSNbroj);
                _dbContext.SaveChanges();


                dynamic content = new { };
                _camundaService.CompleteExternalTask(response.ResponseData.id, _workerId, JsonConvert.SerializeObject(content));
            }
            catch (Exception ex)
            {
                return;
            }
        }
예제 #2
0
        public async Task Run([ServiceBusTrigger("notifica.cliente", Connection = "ServiceBusConnectionString")] ExternalTask task, ILogger log)
        {
            var variables = new Dictionary <string, Variable> {
            };

            await _camundaService.CompleteExternalTask(task.Id.ToString(),
                                                       new CompleteExternalTaskRequest { WorkerId = "CreditoProcess", Variables = variables }
                                                       );

            log.LogInformation($"{task.BusinessKey} Cliente notificado");
        }
예제 #3
0
        public async Task Run([ServiceBusTrigger("analise", Connection = "ServiceBusConnectionString")] ExternalTask task, ILogger log)
        {
            // Executar o que precisar

            var variables = new Dictionary <string, Variable>
            {
                { "creditoAprovado", new Variable {
                      Type = "boolean", Value = false
                  } }
            };

            await _camundaService.CompleteExternalTask(
                task.Id.ToString(),
                new CompleteExternalTaskRequest { WorkerId = "CreditoProcess", Variables = variables });

            log.LogInformation($"{task.BusinessKey} Analise de credito concluida");
        }