Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/en_us/3.1-PipelineProtocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The task pipeline is described using JSON format and consists of several nodes.

The task process terminates when any of the following conditions are met:

- The current node's `next` list is empty (if `[JumpBack]` points exist, jump back first)
- The current node's `next` list is empty (if `[JumpBack]` points exist and the flow is not in the error state, jump back first)
- The current node's `next` list misses until timeout
- External `post_stop` is called or `StopTask` action is executed

Expand Down Expand Up @@ -1379,14 +1379,19 @@ Both forms are functionally equivalent. You can choose based on your preference.

**Type**: *boolean*
**Default**: `false`
**Description**: Enables jump-back mechanism. When this node is recognized and matched, after all subsequent nodes in its chain have completed execution, the system will return to the parent node and continue attempting to recognize the parent node's `next` list.
If the current flow is in the error-handling path (`on_error`), jump-back is not performed.
**Description**: Enables jump-back mechanism. When this node is recognized and matched, after all subsequent nodes in its chain have completed execution, the system will return to the parent node and continue attempting to recognize the parent node's `next` list.

If that subsequent chain does not finish normally but falls into an **error state** that is never cleared, the jump-back is not performed — every pending jump-back point is discarded and the `Task` ends in failure.

>**Error state**: the transient state entered when a node's `next` list misses until `timeout`, or when a node's action fails — that is, right before entering `on_error`. It is cleared as soon as any node in `on_error` is recognized and matched; it cannot be cleared if `on_error` is empty or none of its nodes match.

Because a match itself clears the state, a `[JumpBack]` written inside an `on_error` list also jumps back normally once it is matched.

**Execution Flow**:

1. The parent node recognizes nodes in the `next` list sequentially
2. If a node with `jump_back` attribute is recognized and matched, execute that node and its subsequent node chain
3. After the node chain completes execution, return to the parent node if not in error-handling path
3. After the node chain completes execution, return to the parent node if the flow is not in the error state
4. The parent node continues recognition from the beginning of the `next` list

**Example**:
Expand Down
13 changes: 9 additions & 4 deletions docs/zh_cn/3.1-任务流水线协议.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

当满足以下任意条件时,任务流程终止:

- 当前节点的 next 列表为空(若存在 `[JumpBack]` 回跳点,会先回跳)
- 当前节点的 next 列表为空(若存在 `[JumpBack]` 回跳点,且流程不处于错误异常状态,会先回跳)
- 当前节点的 `next` 列表未命中且超时
- 外部调用 `post_stop` 或执行了 `StopTask` 动作

Expand Down Expand Up @@ -1387,14 +1387,19 @@ C:/MaaXXX/resource/my_exec/my_exec.exe

**类型**: *boolean*
**默认值**: `false`
**说明**: 启用跳回机制。当该节点识别命中,系统会在其后续节点链全部执行完毕后,重新返回到该节点所在的父节点,继续尝试识别该父节点的 `next` 列表。
若当前流程处于错误处理路径(`on_error`),则不会执行回跳。
**说明**: 启用跳回机制。当该节点识别命中,系统会在其后续节点链全部执行完毕后,重新返回到该节点所在的父节点,继续尝试识别该父节点的 `next` 列表。

若该后续节点链不是正常结束,而是陷入**错误异常状态**且未能消除,则不会执行回跳——此时所有待执行的回跳点一并作废,任务 `Task` 随即以失败结束。

>**错误异常状态**:节点的 `next` 全部未命中且 `timeout` 超时,或节点动作执行失败——即将进入 `on_error` 的瞬时状态。其后 `on_error` 中任一节点被识别命中即刻解除;若 `on_error` 为空或其中全部未命中,则无法消除。

由于「被命中」本身即可消除该状态,写在 `on_error` 列表中的 `[JumpBack]` 一旦命中,其回跳同样正常执行。

**执行流程**:

1. 父节点按顺序识别 `next` 列表中的节点
2. 若识别命中带有 `jump_back` 属性的节点,执行该节点及其后续节点链
3. 该节点链执行完毕后,若不在错误处理路径,返回到父节点
3. 该节点链执行完毕后,若流程不处于错误异常状态,返回到父节点
4. 父节点继续从 `next` 列表的起始位置重新开始识别

**示例**:
Expand Down