Skip to content

Commit

Permalink
2023.09.22 Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
monkenWu committed Sep 22, 2023
2 parents 8bea6a6 + 2a32ec3 commit 7bbdde1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/Orchestration/Orchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,7 @@ public function getFailActions(): array
{
$actions = [];
foreach ($this->steps as $step) {
foreach ($step->getStepActionList() as $alias => $action) {
if (!$action->isSuccess()) {
$actions[$alias] = $action;
}
}
$actions = array_merge($actions, $step->getFailStepActionList());
}
return $actions;
}
Expand Down
11 changes: 10 additions & 1 deletion src/Orchestration/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ public function getStepAction(string $alias): ?ActionInterface
*/
public function getStepActionList(): array
{
return $this->actionList;
$returnList = [];
foreach ($this->actionList as $alias => $action) {
if ($action instanceof ActionInterface) {
$returnList[$alias] = $action;
}
}
return $returnList;
}

/**
Expand All @@ -234,6 +240,9 @@ public function getFailStepActionList(): array
{
$failActions = [];
foreach ($this->actionList as $alias => $action) {
if ($action instanceof ActionInterface === false) {
continue;
}
if (!$action->isSuccess()) {
$failActions[$alias] = $action;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Orchestration/StepInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function addAction(string $alias, $action): StepInterface;
* 你可以取得 Orchestrator 已經執行完畢的 Step 中的資料。
* 透過動態的資料,再自行定義自己的動態 Action。
*
* @param callable(\SDPMlab\Anser\Orchestration\Orchestrator) $callable
* @param callable(\SDPMlab\Anser\Orchestration\Orchestrator,\SDPMlab\Anser\Step) $callable
* @return StepInterface
*/
public function addDynamicActions(callable $callable): StepInterface;
Expand Down

0 comments on commit 7bbdde1

Please sign in to comment.