Skip to content

Commit a09869f

Browse files
committed
[waterflow] From 增加获取订阅者的方法
1 parent 3cd1214 commit a09869f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • framework/waterflow/java/waterflow-core/src/main/java/modelengine/fit/waterflow/domain/stream/nodes

framework/waterflow/java/waterflow-core/src/main/java/modelengine/fit/waterflow/domain/stream/nodes/From.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package modelengine.fit.waterflow.domain.stream.nodes;
88

99
import static modelengine.fit.waterflow.ErrorCodes.FLOW_ENGINE_INVALID_MANUAL_TASK;
10+
import static modelengine.fit.waterflow.ErrorCodes.FLOW_ENGINE_INVALID_NODE_ID;
1011

1112
import modelengine.fit.waterflow.domain.context.FlatMapSourceWindow;
1213
import modelengine.fit.waterflow.domain.context.FlatMapWindow;
@@ -505,6 +506,17 @@ private List<FlowContext<I>> startNodeMarkAsHandled(List<FlowContext<I>> preList
505506
return afterList;
506507
}
507508

509+
/**
510+
* 通过订阅节点Id查找订阅节点
511+
*
512+
* @param nodeId 节点Id
513+
* @return 订阅节点
514+
*/
515+
public To<I, Object> getSubscriber(String nodeId) {
516+
return ObjectUtils.cast(findNode(this, nodeId)
517+
.orElseThrow(() -> new WaterflowException(FLOW_ENGINE_INVALID_NODE_ID, nodeId)));
518+
}
519+
508520
/**
509521
* findNodeFromFlow
510522
*

0 commit comments

Comments
 (0)