perf(模型工具类): 优化模型工具获取开始节点方法。

This commit is contained in:
konbai
2022-08-19 00:39:46 +08:00
parent d10ba055cb
commit 5fffd9cd0b

View File

@@ -44,8 +44,11 @@ public class ModelUtils {
*/
public static StartEvent getStartEvent(BpmnModel model) {
Process process = model.getMainProcess();
Collection<FlowElement> flowElements = process.getFlowElements();
return getStartEvent(flowElements);
FlowElement startElement = process.getInitialFlowElement();
if (startElement instanceof StartEvent) {
return (StartEvent) startElement;
}
return getStartEvent(process.getFlowElements());
}
/**