GWT Command - what is equivalent in Vaadin Flow

In my application (Vaadin 7) I use Command http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/Command.html

Command sayHello = new Command() {
   public void execute() {
     Window.alert("Hello");
   }
 };
 sayHello.execute();

What is equivalent in Vaadin Flow?

See documentation for how to exceute JavaScript command

https://vaadin.com/docs/v10/flow/advanced/tutorial-execute-javascript.html

UI.getCurrent().getPage().executeJavaScript("window.alert($0)","Hello");

I would like to point out that there is a large amount of Java code in execute method that converts a lot based on selected from the form and data retrieved from the database. Everything is on one Vaadin 7 View https://vaadin.com/api/framework/7.7.4/com/vaadin/navigator/View.html, which sets up an appropriate component
(currently this is CustomLayout https://vaadin.com/docs/v7/framework/layout/layout-customlayout.html, whose appearance is determined by the HTML file)

So your question was not simply about calling the “alert” function? You used it just as example, right?

As you have used CustomLayout with html file and probably some custom JavaScript there. Then I would recommend you to check

https://vaadin.com/docs/v11/flow/importing-dependencies/tutorial-ways-of-importing.html

and

https://vaadin.com/docs/v11/flow/importing-dependencies/tutorial-importing.html

Which should help you to integrate the existing html you have.

However, I would also study if it makes sense to migrate your existing html files to Polymer templates (see here: https://vaadin.com/docs/v11/flow/polymer-templates/tutorial-template-basic.html ) and integrate them with methods described here: https://vaadin.com/docs/v11/flow/web-components/integrating-a-web-component.html