fix(process): 修复自定义配置 required 不生效

This commit is contained in:
zimoyin
2026-03-11 15:04:11 +08:00
parent f2ff4ae123
commit 8e617d06bc
11 changed files with 49 additions and 17 deletions
+10 -2
View File
@@ -138,6 +138,14 @@ abstract class AbstractProcessNode implements ProcessNodeInterface
return (!empty($this->getConfig()->required)) ? $this->getConfig()->required : $default;
}
/**
* 获取子节点数量
*/
public function getChildNodeCount(): int
{
return count($this->getChildNodes());
}
/**
* 是否是需要的前置节点
* @param string $currentStep
@@ -174,14 +182,14 @@ abstract class AbstractProcessNode implements ProcessNodeInterface
protected function stopNext(ProcessContext $context): ProcessContext
{
return $context->builder()
->skipNodeCount(count($this->getRemainingNodes()))
->skipNodeCount(count($this->getChildNodes()))
->build();
}
/**
* 获取剩余节点
*/
protected function getRemainingNodes(): array
public function getChildNodes(): array
{
$remainingNodes = [];
$node = $this->next;