> For the complete documentation index, see [llms.txt](https://docs.workersforlabview.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.workersforlabview.io/fundamental-concepts/the-workers-main-vi/default-framework-cases.md).

# Default Framework Cases

The MHL of a Worker's Main VI is required to have these four cases for its proper functioning in the framework (see below).

![The four required framework cases in a Workers MHL](/files/7FEsoObraJXiGsYiZLru)

{% hint style="info" %}
All VIs referenced in this page can be found in the Workers palette in LabVIEW.
{% endhint %}

## Initialize

![MHL \<Initialize> case](/files/dXe6nNkbVTVFDDOUdD9v)

The \<Initialize> case is the first case that is called by the framework in a Workers application. This case receives user-defined initialization data that the Worker requires, sent from the Worker's Caller in the Worker's *Initialization Data.ctl* typedef.

In this case you can perform any initial tasks that requires data received from the Workers *Initialization Data.ctl* typedef.

This case should also be used to write data into the *Initialization Data.ctl* data clusters of this Worker's statically-linked subworkers (if this Worker has any).

The final step required to be performed by this case (or sequence of cases) is for *Initialize subWorkers.vi* to be called, which will call the \<Initialize> case of the Worker's statically-linked subWorkers.

{% hint style="info" %}
**Worker without statically linked subWorkers**

If the Worker contains no statically-linked subWorkers, then the *Initialize subWorkers.vi* will instead call the \<All subWorkers Initialized> case of the Worker.
{% endhint %}

## All subWorkers Initialized

![MHL \<All subWorkers Initialized> case](/files/yHvetvGziOcYuEKGq8Ix)

This case is called by the framework when all of a Worker's statically-linked subWorkers have been successfully initialized. (A Worker will notify its Caller that it has been successfully initialized when its *Initialized Notify.vi* has been called). You can now perform any tasks that are required to be performed now that all the Worker’s statically-linked subWorkers have been initialized.

The final step required to be called by this case (or sequence of cases) is to call *Initialized Notify.vi*. This VI will notify the Worker’s Caller that the Worker has been successfully initialized.

## Start Exiting

![MHL \<Start Exiting> case](/files/KhKs5W2fInQe7zynTvQJ)

Calling the \<Start Exiting> case of a Worker will start the shutdown sequence of the Worker and its subWorkers. This can be done by use of *Worker Start Exiting.vi*.

In this case you can perform any tasks that are required before the shutting down of the Worker's subWorkers.

The final step required to be performed by this case (or sequence of cases) is for *Start Exiting subWorkers.vi* to be called, which will call the \<Start Exiting> case of the Worker's subWorkers.

{% hint style="info" %}
**Worker without subWorkers**

If the Worker contains no subWorkers, then the *Start Exiting subWorkers.vi* will instead call the \<All subWorkers Exiting> case of the Worker.
{% endhint %}

## All subWorkers Exited

![MHL \<All subWorkers Exited> case](/files/fhAipGVYmg3cuWt2Hrfe)

This case is called by the framework when all of a Worker's subWorkers have successfully exited. (A Worker will notify its Caller that it has exited when its *Exited Notify and Cleanup.vi* has been called.) You can now perform any tasks that are required to be performed now that all the Worker’s subWorkers have exited.

The final step required to be called by this case (or sequence of cases) is to call *Exit.vi.* This VI will stop both a Workers MHL and EHL, and then Worker will then exit.
