File tree Expand file tree Collapse file tree
flow/src/main/java/org/bekit/flow Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727@ Import ({EventBusConfiguration .class ,
2828 FlowsHolder .class ,
2929 ProcessorsHolder .class ,
30- FlowTxsHolder .class })
30+ FlowTxsHolder .class ,
31+ DefaultFlowListener .class })
3132public class FlowEngineConfiguration {
3233
3334 // 流程引擎
3435 @ Bean
35- public FlowEngine flowEngine () {
36- return new DefaultFlowEngine ();
37- }
38-
39- // 默认的流程监听器
40- @ Bean
41- public DefaultFlowListener defaultFlowListener () {
42- return new DefaultFlowListener ();
36+ public FlowEngine flowEngine (FlowsHolder flowsHolder , FlowTxsHolder flowTxsHolder ) {
37+ return new DefaultFlowEngine (flowsHolder , flowTxsHolder );
4338 }
4439}
Original file line number Diff line number Diff line change 1414import org .bekit .flow .flow .FlowsHolder ;
1515import org .bekit .flow .transaction .FlowTxExecutor ;
1616import org .bekit .flow .transaction .FlowTxsHolder ;
17- import org .springframework .beans .factory .annotation .Autowired ;
1817import org .springframework .util .ClassUtils ;
1918
2019import java .util .Map ;
2322 * 流程引擎默认实现类
2423 */
2524public class DefaultFlowEngine implements FlowEngine {
26- @ Autowired
25+ // 流程持有器
2726 private FlowsHolder flowsHolder ;
28- @ Autowired
27+ // 流程事务持有器
2928 private FlowTxsHolder flowTxsHolder ;
3029
30+ public DefaultFlowEngine (FlowsHolder flowsHolder , FlowTxsHolder flowTxsHolder ) {
31+ this .flowsHolder = flowsHolder ;
32+ this .flowTxsHolder = flowTxsHolder ;
33+ }
34+
3135 @ Override
3236 public <T > T start (String flow , T target ) {
3337 return start (flow , target , null );
Original file line number Diff line number Diff line change 1515import org .bekit .flow .annotation .listener .FlowListener ;
1616import org .bekit .flow .event .FlowExceptionEvent ;
1717import org .bekit .flow .event .NodeDecidedEvent ;
18- import org .springframework .beans .factory .annotation .Autowired ;
19-
20- import javax .annotation .PostConstruct ;
2118
2219/**
2320 * 默认的流程监听器
2421 * (流程引擎初始化时会初始化本监听器,其作用是监听所有流程发生的事件,然后将事件转发给对应流程的特定流程监听器(@TheFlowListener))
2522 */
2623@ FlowListener
2724public class DefaultFlowListener {
28- @ Autowired
29- private EventBusesHolder eventBusesHolder ;
3025 // 特定流程事件发布器
3126 private EventPublisher eventPublisher ;
3227
33- @ PostConstruct
34- public void init () {
28+ public DefaultFlowListener (EventBusesHolder eventBusesHolder ) {
3529 eventPublisher = new DefaultEventPublisher (eventBusesHolder .getEventBus (TheFlowListenerType .class ));
3630 }
3731
You can’t perform that action at this time.
0 commit comments