perf(模型工具类): 优化模型工具获取开始节点方法。
This commit is contained in:
@@ -44,8 +44,11 @@ public class ModelUtils {
|
|||||||
*/
|
*/
|
||||||
public static StartEvent getStartEvent(BpmnModel model) {
|
public static StartEvent getStartEvent(BpmnModel model) {
|
||||||
Process process = model.getMainProcess();
|
Process process = model.getMainProcess();
|
||||||
Collection<FlowElement> flowElements = process.getFlowElements();
|
FlowElement startElement = process.getInitialFlowElement();
|
||||||
return getStartEvent(flowElements);
|
if (startElement instanceof StartEvent) {
|
||||||
|
return (StartEvent) startElement;
|
||||||
|
}
|
||||||
|
return getStartEvent(process.getFlowElements());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user