Skip to content

Commit

Permalink
Merge pull request #286 from baoxiangyang/master
Browse files Browse the repository at this point in the history
fix:上下文中有回调事件时执行
  • Loading branch information
codebdy authored Nov 22, 2023
2 parents 73b411d + bf8fe79 commit cf26b27
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/minions/runtime-core/src/classes/LogicFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export class LogicFlow<LogicFlowContext = unknown> {
case NodeType.End: {
//end 只有一个端口,可能会变成其它流程的端口,所以name谨慎处理
const endJointer = new Jointer(activityMeta.id, activityMeta.name || "output");
// 上下文中有回调事件时执行
endJointer.connect((inputValue, runContext?: {asyncBack?:(isError: boolean, data: unknown) => void}) => {
if (endJointer['outlets']?.length === 1 && runContext?.asyncBack) {
runContext.asyncBack(false, inputValue)
}
})
this.jointers.addOutput(endJointer);
break;
}
Expand Down

0 comments on commit cf26b27

Please sign in to comment.