Beispiel #1
0
        private static IEnumerable <WorkflowInstance> PrintCompleteWorkflow(IPersistenceProvider efProvider)
        {
            var instances = efProvider.GetWorkflowInstances(WorkflowStatus.Complete, "", null, null, 0, 10).Result;

            System.Collections.Generic.IEnumerable <WorkflowInstance> items;
            Console.WriteLine($"--- Closed Workflow --- total: {instances.Count()}");

            items = efProvider.GetWorkflowInstances(instances.Select(s => s.Id)).Result;
            foreach (var item in items)
            {
                var data = item.Data as Approval;
                Console.WriteLine($"{item.Id}, users: {string.Join(',', data.UserList.Select(u => u.Id))}");
                Console.WriteLine($"create date: {item.CreateTime}, complete date: {item.CompleteTime}");
                Console.WriteLine($"next execution: {item.NextExecution}, reference : {item.Reference}");
                Console.WriteLine($"WorkflowDefinitionId: {item.WorkflowDefinitionId}, Status : {Enum.GetName(typeof(WorkflowStatus), item.Status)}");
            }

            return(items);
        }
Beispiel #2
0
        private static void PrintPersistance(IPersistenceProvider efProvider)
        {
            var instances = efProvider.GetRunnableInstances(DateTime.Now).Result;

            foreach (var i in instances)
            {
                Console.WriteLine($"instance: {i}");
            }

            Console.WriteLine("--- Current Workflow ----");
            var items = efProvider.GetWorkflowInstances(instances).Result;

            foreach (var item in items)
            {
                var data = item.Data as Approval;
                Console.WriteLine($"{item.Id}, users: {string.Join(',', data.UserList.Select(u => u.Id))}");
                Console.WriteLine($"create date: {item.CreateTime}, complete date: {item.CompleteTime}");
                Console.WriteLine($"next execution: {item.NextExecution}, reference : {item.Reference}");
                Console.WriteLine($"WorkflowDefinitionId: {item.WorkflowDefinitionId}, Status : {Enum.GetName(typeof(WorkflowStatus), item.Status)}");
            }
        }
        public async Task <IActionResult> Get(WorkflowStatus?status, string type, DateTime?createdFrom, DateTime?createdTo, int skip, int take)
        {
            var result = await _workflowStore.GetWorkflowInstances(status, type, createdFrom, createdTo, skip, take);

            return(Json(result.ToList()));
        }