|
@@ -648,17 +648,17 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
public async Task StartToEndAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null,
|
|
|
CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
- //var wfModule = await GetWorkflowModuleAsync(dto.DefinitionModuleCode, cancellationToken);
|
|
|
- //var definition = wfModule.Definition;
|
|
|
- //if (definition == null)
|
|
|
- // throw new UserFriendlyException("无效模板编码");
|
|
|
- //if (definition.Status is not EDefinitionStatus.Enable)
|
|
|
- // throw new UserFriendlyException("该模板不可用");
|
|
|
-
|
|
|
- //var endStepDefine = definition.FindEndStepDefine();
|
|
|
- //dto.NextStepCode = endStepDefine.Code;
|
|
|
- //dto.NextStepName = endStepDefine.Name;
|
|
|
- //dto.FlowDirection = EFlowDirection.CenterToFile;
|
|
|
+ var wfModule = await GetWorkflowModuleAsync(dto.DefinitionModuleCode, cancellationToken);
|
|
|
+ var definition = wfModule.Definition;
|
|
|
+ if (definition == null)
|
|
|
+ throw new UserFriendlyException("无效模板编码");
|
|
|
+ if (definition.Status is not EDefinitionStatus.Enable)
|
|
|
+ throw new UserFriendlyException("该模板不可用");
|
|
|
+
|
|
|
+ var endStepDefine = definition.FindEndStepDefine();
|
|
|
+ dto.NextStepCode = endStepDefine.Code;
|
|
|
+ dto.NextStepName = endStepDefine.Name;
|
|
|
+ dto.FlowDirection = EFlowDirection.CenterToFile;
|
|
|
|
|
|
//await StartAsync(dto, externalId, expiredTime, cancellationToken: cancellationToken);
|
|
|
|
|
@@ -667,7 +667,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
nextDto.WorkflowId = workflow.Id;
|
|
|
nextDto.StepId = startStep.Id;
|
|
|
|
|
|
- var endStepDefine = workflow.WorkflowDefinition.FindEndStepDefine();
|
|
|
+ //var endStepDefine = workflow.WorkflowDefinition.FindEndStepDefine();
|
|
|
nextDto.NextStepCode = endStepDefine.Code;
|
|
|
nextDto.NextStepName = endStepDefine.Name;
|
|
|
|