@Preview(value="3.0") public class FlowContext extends Object
| Modifier and Type | Field and Description |
|---|---|
protected FlowEngine |
engine |
Object |
result |
| Constructor and Description |
|---|
FlowContext() |
FlowContext(String instanceId) |
| Modifier and Type | Method and Description |
|---|---|
void |
backup()
备份
|
<T> T |
computeIfAbsent(String key,
Function<String,T> mappingFunction)
尝试完成
|
Counter |
counter()
计数器
|
FlowEngine |
engine()
当前流程引擎
|
<C,R> org.noear.dami.bus.DamiBus<C,R> |
eventBus()
获取事件总线(based damibus)
|
<T> T |
get(String key)
获取
|
String |
getInstanceId()
获取流实例id
|
<T> T |
getOrDefault(String key,
T def)
获取或默认
|
Object |
getResult()
获取临时结果
|
void |
interrupt()
阻断(当前分支不再后流)
|
void |
interrupt(boolean interrupted)
阻断重置
|
boolean |
isInterrupted()
是否已阻断
|
boolean |
isStopped()
是否已停止
|
void |
manualNext(Node node)
手动下一步(可能要配合中断使用
interrupt()) |
void |
manualNext(Node node,
int depth)
手动下一步(可能要配合中断使用
interrupt()) |
Map<String,Object> |
model()
数据模型
|
<Slf extends FlowContext> |
put(String key,
Object value)
推入
|
<Slf extends FlowContext> |
putAll(Map<String,Object> model)
推入全部
|
<Slf extends FlowContext> |
putIfAbsent(String key,
Object value)
推入
|
void |
recovery()
恢复
|
void |
remove(String key)
移除
|
Object |
run(String script)
运行脚本
|
void |
setResult(Object result)
设置临时结果(有些脚本引擎必须用属性方式)
|
void |
stop()
停止(整个流程不再后流)
|
public transient Object result
protected transient FlowEngine engine
public FlowContext()
public FlowContext(String instanceId)
public void backup()
public void recovery()
public void setResult(Object result)
public Object getResult()
public FlowEngine engine()
public Counter counter()
public void manualNext(Node node) throws FlowException
interrupt())node - 节点FlowExceptionpublic void manualNext(Node node, int depth) throws FlowException
interrupt())node - 节点depth - 执行深度FlowExceptionpublic Object run(String script) throws InvocationTargetException
InvocationTargetExceptionpublic boolean isStopped()
public void stop()
public boolean isInterrupted()
public void interrupt()
public void interrupt(boolean interrupted)
public <Slf extends FlowContext> Slf put(String key, Object value)
public <Slf extends FlowContext> Slf putIfAbsent(String key, Object value)
public <Slf extends FlowContext> Slf putAll(Map<String,Object> model)
public <T> T get(String key)
public <T> T getOrDefault(String key, T def)
public void remove(String key)
public String getInstanceId()
public <C,R> org.noear.dami.bus.DamiBus<C,R> eventBus()
Copyright © 2025. All rights reserved.