11package com .codingapi .springboot .flow .build ;
22
3+ import com .codingapi .springboot .flow .domain .FlowButton ;
34import com .codingapi .springboot .flow .domain .FlowNode ;
45import com .codingapi .springboot .flow .domain .FlowRelation ;
56import com .codingapi .springboot .flow .domain .FlowWork ;
1213import com .codingapi .springboot .flow .user .IFlowOperator ;
1314import com .codingapi .springboot .framework .utils .RandomGenerator ;
1415
16+ import java .util .List ;
17+
1518/**
1619 * 流程工作构建器
1720 */
@@ -65,25 +68,43 @@ public FlowWork build() {
6568
6669 public class Nodes {
6770
68- public Nodes node (String id ,String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , long timeout , TitleGenerator titleGenerator , ErrTrigger errTrigger , boolean editable ) {
69- FlowNode node = new FlowNode (id , name , code , view , NodeType .parser (code ), approvalType , titleGenerator , operatorMatcher , timeout , errTrigger , editable );
71+ public Nodes node (String id , String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , long timeout , TitleGenerator titleGenerator , ErrTrigger errTrigger , boolean editable , List < FlowButton > buttons ) {
72+ FlowNode node = new FlowNode (id , name , code , view , NodeType .parser (code ), approvalType , titleGenerator , operatorMatcher , timeout , errTrigger , editable , buttons );
7073 work .addNode (node );
7174 return this ;
7275 }
7376
74- public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher ,long timeout , boolean editable ) {
75- return node (RandomGenerator .generateUUID (),name , code , view , approvalType , operatorMatcher , timeout , TitleGenerator .defaultTitleGenerator (), null , editable );
77+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , long timeout , boolean editable ) {
78+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , timeout , TitleGenerator .defaultTitleGenerator (), null , editable , null );
79+ }
80+
81+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , long timeout , boolean editable , List <FlowButton > buttons ) {
82+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , timeout , TitleGenerator .defaultTitleGenerator (), null , editable , buttons );
7683 }
84+
85+
7786 public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , boolean editable ) {
78- return node (RandomGenerator .generateUUID (),name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), null , editable );
87+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), null , editable , null );
88+ }
89+
90+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , boolean editable , List <FlowButton > buttons ) {
91+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), null , editable , buttons );
92+ }
93+
94+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , List <FlowButton > buttons ) {
95+ return node (name , code , view , approvalType , operatorMatcher , true , buttons );
7996 }
8097
8198 public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher ) {
82- return node (name , code , view , approvalType , operatorMatcher , true );
99+ return node (name , code , view , approvalType , operatorMatcher , true , null );
100+ }
101+
102+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , ErrTrigger errTrigger , boolean editable , List <FlowButton > buttons ) {
103+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), errTrigger , editable , buttons );
83104 }
84105
85- public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , ErrTrigger errTrigger , boolean editable ) {
86- return node (RandomGenerator .generateUUID (),name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), errTrigger , editable );
106+ public Nodes node (String name , String code , String view , ApprovalType approvalType , OperatorMatcher operatorMatcher , ErrTrigger errTrigger , boolean editable ) {
107+ return node (RandomGenerator .generateUUID (), name , code , view , approvalType , operatorMatcher , 0 , TitleGenerator .defaultTitleGenerator (), errTrigger , editable , null );
87108 }
88109
89110
@@ -102,13 +123,13 @@ public FlowWork build() {
102123 public class Relations {
103124
104125 public Relations relation (String name , String source , String target ) {
105- return relation (name ,source ,target ,OutTrigger .defaultOutTrigger (),1 , false );
126+ return relation (name , source , target , OutTrigger .defaultOutTrigger (), 1 , false );
106127 }
107128
108- public Relations relation (String name , String source , String target , OutTrigger outTrigger ,int order , boolean back ) {
129+ public Relations relation (String name , String source , String target , OutTrigger outTrigger , int order , boolean back ) {
109130 FlowNode from = work .getNodeByCode (source );
110131 FlowNode to = work .getNodeByCode (target );
111- FlowRelation relation = new FlowRelation (RandomGenerator .generateUUID (), name , from , to , outTrigger ,order , back );
132+ FlowRelation relation = new FlowRelation (RandomGenerator .generateUUID (), name , from , to , outTrigger , order , back );
112133 work .addRelation (relation );
113134 return this ;
114135 }
0 commit comments