- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebFlow
More file actions
77 lines (58 loc) · 2.95 KB
/
webFlow
File metadata and controls
77 lines (58 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FlowExecutor
1.definitionLocator:获取FlowDefinition工具
2.FlowExecutionFactory:FlowExecution创建工厂
3.FlowExecutionRepository:Repository
用:launchExecution(String flowId, MutableAttributeMap input, ExternalContext context)
1.线程变量保存外部变量
2.根据flowId获取Flow
2.FlowExecutionRepository()-->FlowExecution(Flow),没有flowExecutionKey
1.flow:流程
2.status:流程状态
3.flowSessions:
4.listeners:流程监听器,Flow读取
5.keyFactory:Executionkey生成器
6.key:executionkey主键
7.conversationScope:回话
8.attributes:属性,FlowExecutionRepository获取
9.outcome:结果
3.flowExecution.start(input, context)执行流程
4.if 流程没有结束根据flowExecutionKey获取FlowExecutionLock
5.事务保存FlowExecution,返回一个暂停结果
6.createEndResult,返回一个结束结果
7.ExternalContextHolder.setExternalContext(null)
FlowExecutionRepository
AbstractFlowExecutionRepository
1.conversationManager: 会话管理器
2.alwaysGenerateNewNextKey:总是生成新的key标示
用:1.getKey(FlowExecution execution)
1.if executionkey通过conversationManager与ConversationParameters(flowId,flowCaption,flowDescription)->Conversation
返回CompositeFlowExecutionKey(ConversationId,snapshotId),nextSnapshotId子类实现
2.if alwaysGenerateNewNextKey标示 snapshotId发现变化
2.parseFlowExecutionKey(String encodedKey)
1.根据encodedKey解析executionId(conversationManager.parseConversationId),snapshotId组成CompositeFlowExecutionKey
3.getLock(FlowExecutionKey key)
1.conversationManager根据executionId获取conversation
2.返回一个代理ConversationBackedFlowExecutionLock
4.removeFlowExecution(FlowExecution flowExecution)
1.conversationManager根据executionId获取conversation
2.conversation直接end操作
AbstractSnapshottingFlowExecutionRepository
1.FlowExecutionSnapshotFactory:快照工厂
DefaultFlowExecutionRepository
ConversationManager
SessionBindingConversationManager
1.conversationLockFactory:会话锁工厂
用:1.getConversationContainer()->session(sessionKey,ConversationContainer)->ConversationContainer 保存session的sessionKey
2.beginConversation(ConversationParameters conversationParameters)
1.getConversationContainer createConversation(conversationParameters,ConversationContainer,Lock,Id)
2.ConversationContainer.conversations.add(ContainedConversation)
3.getConversation(ConversationId id)
1.遍历ConversationContainer的conversations
4.parseConversationId(String encodedId)
Conversation(Session(key,ConversationConversationContainer))
1.ConversationContainer
2.ConversationLock
3.attributes---(SNAPSHOT_GROUP_ATTRIBUTE,FlowExecutionSnapshotGroup),Snapshot(FlowExecutionSnapshot)
4.attributes---(scope,flowExecution.getConversationScope())
FlowExecutionKey
CompositeFlowExecutionKey(executionId,snapshotId) ContainedConversation(executionId=id)