getProcessApp

getProcessApp(): Application;

The getProcessApp method of the Process class returns a reference to the main Application object of the current process. For example, to return the locale of the main application, call process.getProcessApp.currentLocale.

When using packages, a single process can have multiple transient Application objects: one for the process itself and one for each imported package.

If the process is not using any packages, this method returns the same reference as the app system variable.

If a process is using one or more imported packages, this method returns a reference to the Application object of the process, regardless of the context from which this method was called. The difference in referencing the main Application object when packages are involved is because the app system variable will be different while executing within the package. The value returned by this method is the same as app when the running process began execution, and before any possible changes, owing to context switches into packages.