|
@@ -543,22 +543,13 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
query = query.Includes(d => d.Countersigns, x => x.Members);
|
|
|
if (withSteps)
|
|
|
query = query.Includes(d => d.Steps);
|
|
|
- //if (withTraces)
|
|
|
- // query = query.Includes(d => d.Traces);
|
|
|
+ if (withTraces)
|
|
|
+ query = query.Includes(d => d.Traces);
|
|
|
|
|
|
var workflow = await query.FirstAsync(cancellationToken);
|
|
|
if (workflow is null)
|
|
|
throw new UserFriendlyException("无效workflowId");
|
|
|
|
|
|
- //if (withSteps)
|
|
|
- //{
|
|
|
- // var steps = await _workflowStepRepository.Queryable()
|
|
|
- // .Where(d => d.WorkflowId == workflow.Id)
|
|
|
- // .OrderBy(d => d.CreationTime)
|
|
|
- // .ToTreeAsync(d => d.Steps, d => d.ParentId, null);
|
|
|
- // workflow.Steps = steps;
|
|
|
- //}
|
|
|
-
|
|
|
if (withTracesTree)
|
|
|
{
|
|
|
workflow.Traces = await _workflowTraceRepository.Queryable()
|
|
@@ -567,14 +558,6 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
.ToTreeAsync(d => d.Traces, d => d.ParentId, null);
|
|
|
}
|
|
|
|
|
|
- if (withTraces)
|
|
|
- {
|
|
|
- workflow.Traces = await _workflowTraceRepository.Queryable()
|
|
|
- .Where(d => d.WorkflowId == workflow.Id)
|
|
|
- .OrderBy(d => d.CreationTime)
|
|
|
- .ToListAsync(cancellationToken);
|
|
|
- }
|
|
|
-
|
|
|
return workflow;
|
|
|
}
|
|
|
|