コード例 #1
0
        public void Can_Get_For_Node_By_Status(int nodeId, int count, int status)
        {
            Scaffold.Instances(count, status: status, nodeId: nodeId);

            List <WorkflowInstancePoco> results = _service.GetForNodeByStatus(nodeId, new [] { status }).ToList();

            Assert.Equal(count, results.Count);
            foreach (WorkflowInstancePoco result in results)
            {
                Assert.Equal(nodeId, result.NodeId);
                Assert.Equal(status, result.Status);
            }
        }
コード例 #2
0
ファイル: TasksController.cs プロジェクト: mhamel/Plumber
        public IHttpActionResult GetStatus(int id)
        {
            try
            {
                IEnumerable <WorkflowInstancePoco> instances = _instancesService.GetForNodeByStatus(id, new List <int> {
                    (int)WorkflowStatus.PendingApproval
                });

                return(Ok(instances.Any()));
            }
            catch (Exception ex)
            {
                string msg = $"Error getting status for node {id}";
                Log.Error(msg, ex);
                return(Content(HttpStatusCode.InternalServerError, ViewHelpers.ApiException(ex, msg)));
            }
        }