public override Task Execute(IJobExecutionContext context)
        {
            var dc = DbAgent.InitDc();

            var wf = new WorkflowEngine
            {
                WorkflowId    = "f0d6bf5d-359a-4903-97ad-2fa9bd8b2997",
                TransactionId = Guid.NewGuid().ToString()
            };

            dc.DbTran(async() => await wf.Run(dc, new { }));

            return(Task.CompletedTask);
        }
        public override Task Execute(IJobExecutionContext context)
        {
            var dc = DbAgent.InitDc();

            var wf = new WorkflowEngine
            {
                WorkflowId    = "6240e1f7-b90b-4e60-8b2c-36130b043390",
                TransactionId = Guid.NewGuid().ToString()
            };

            dc.DbTran(async() => await wf.Run(dc, new { }));

            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        public static void Init()
        {
            var dc = DbAgent.InitDc();

            if (dc.Table <Workflow>().FirstOrDefault() != null)
            {
                return;
            }

            Directory.GetFiles(Database.ContentRootPath + "\\App_Data\\DbInitializer", "*.Workflows.json")
            .ToList()
            .ForEach(path =>
            {
                string json   = File.ReadAllText(path);
                var dbContent = JsonConvert.DeserializeObject <JObject>(json);

                if (dbContent["workflows"] != null)
                {
                    dc.DbTran(() => DataInitialization.InitWorkflows(dc, dbContent["workflows"].ToList()));
                }
            });
        }