Example #1
0
        private static void CheckResult(string workflowId, string name)
        {
            GetTraceForWorkflowResponse traces = null;

            using (var src = new FlowTasksService())
            {
                traces = src.GetTraceForWorkflow(new GetTraceForWorkflowRequest {
                    WorkflowOids = new[] { Guid.Parse(workflowId) }
                });
            }

            bool found = false;

            foreach (var trace in traces.Traces.Where(t => t.Type == TraceEventType.Activity.ToString()))
            {
                if (trace.Action == ActionTrace.WorkflowCompleted.ToString())
                {
                    found = true;
                }
            }
            if (!found)
            {
                throw new Exception(name + ": workflow has not been completed");
            }
        }