Scenario: A new server needs to be set up. Instead of setting up the server manually, use a workflow to automate as much of the set-up as possible. Part of this set-up involves installing a database and populating it with data. The installation of the database takes about fifteen minutes, so the workflow needs to wait for it to finish before trying to populate the data.
Process: This process is created as an auto start Workflow-type project.
The following screen shot shows the process:
The Wait On External Event component in this screenshot is in charge of running the database installer and delaying the process until the database is installed. If the installation timesout, an email is sent to the server administrator.
The Wait on External Event component contains two embedded models: a start process and a wait process. The start process contains a component that launches the database installer. The wait process runs on a schedule to check if the installer has finished.
If the installation succeeds, the process moves into an embedded model that contains more steps for setting up the server, including populating the newly installed database with data. In the screenshot above, this model is called "More steps for setting up the server."
The following screen shot shows the editor for the Wait On External Event component:
Notice the start process, the Time Between Checks schedule, and the wait process. The Time Between Checks schedule dictates how often the wait process runs; in this case once per minute.
The following screen shot shows the Start Process:
Inside the Start Process, an Execute Process (Run) component runs the installer file. The database application is sizeable, and the installation takes considerable time. While the installer is running, the Wait On External Event component waits and periodically checks to see if the installation is finished.
You can set how often the component checks the installation by changing the Time Between Checks property. You can also set when the component will stop checking by changing the Timeout Time Span property.
The following screen shot shows the Wait Process:
This process runs as often as the "Time Between Checks" property tells it to run. The File Exists component is set to look for a file that appears when the database has finished installing. When it finds this file, it knows the installation is complete.
When the Wait On External Event component recognizes that the installation is complete, it exits the waiting cycle and begins the rest of the process.