@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)
|
ExecutorService |
executor()
异步执行器
|
FlowContext |
executor(ExecutorService executor)
配置异步执行器
|
static FlowContext |
from(FlowContext old)
数据复制
|
<T> T |
get(String key)
获取
|
String |
getInstanceId()
获取流实例id
|
<T> T |
getOrDefault(String key,
T def)
获取或默认
|
Object |
getResult()
获取临时结果
|
int |
incrAdd(String key,
int delta)
增量添加
|
int |
incrGet(String key)
增量获取
|
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)
Deprecated.
|
Object |
runScript(String script)
运行脚本
|
void |
runTask(Node node,
String description)
运行任务
|
void |
setResult(Object result)
设置临时结果(有些脚本引擎必须用属性方式)
|
void |
stop()
停止(整个流程不再后流)
|
public transient volatile Object result
protected transient FlowEngine engine
public FlowContext()
public FlowContext(String instanceId)
public static FlowContext from(FlowContext old)
public void backup()
public void recovery()
public void setResult(Object result)
public Object getResult()
public FlowEngine engine()
@Preview(value="3.3") @Nullable public ExecutorService executor()
@Preview(value="3.3") public FlowContext executor(ExecutorService executor)
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 void runTask(Node node, String description) throws FlowException
node - 节点description - 任务描述FlowExceptionpublic Object runScript(String script) throws InvocationTargetException
script - 脚本InvocationTargetException@Deprecated public Object run(String script) throws InvocationTargetException
runScript(String)script - 脚本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 int incrAdd(String key, int delta)
public int incrGet(String key)
public void remove(String key)
public String getInstanceId()
public <C,R> org.noear.dami.bus.DamiBus<C,R> eventBus()
Copyright © 2025. All rights reserved.