|
@@ -589,16 +589,20 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
d.Status is not EWorkflowStepStatus.Handled
|
|
|
);
|
|
|
|
|
|
- var unCompletedCountersign = workflow.Countersigns
|
|
|
- .FirstOrDefault(d => !d.IsCompleted() && d.StarterOrgId == orgId);
|
|
|
- if (unCompletedCountersign is null)
|
|
|
- return (workflow, null, canHandle, canPrevious, unhandlePreviousTrace);
|
|
|
+ WorkflowCountersign? unCompletedCountersign = null;
|
|
|
+ if (!canHandle)
|
|
|
+ {
|
|
|
+ unCompletedCountersign = workflow.Countersigns
|
|
|
+ .FirstOrDefault(d => !d.IsCompleted() && d.StarterOrgId == orgId);
|
|
|
+ if (unCompletedCountersign is null)
|
|
|
+ return (workflow, null, canHandle, canPrevious, unhandlePreviousTrace);
|
|
|
+ }
|
|
|
|
|
|
//var existCountersignEndStep = workflow.Steps.Exists(d =>
|
|
|
// d.IsCountersignEndStep && d.CountersignStartStepId == unCompletedCountersign.StartStepId);
|
|
|
//return (workflow, existCountersignEndStep ? null : unCompletedCountersign.Id, canPrevious);
|
|
|
|
|
|
- return (workflow, unCompletedCountersign.Id, canHandle, canPrevious, unhandlePreviousTrace);
|
|
|
+ return (workflow, unCompletedCountersign?.Id ?? null, canHandle, canPrevious, unhandlePreviousTrace);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|