Working with Procedures

Navigation:  How to Work with Programs >

Working with Procedures

Previous pageReturn to chapter overviewNext page

 

Overview

 

Developing an MCL-Designer application requires a well-planned modular type arquitecture. The required business logic should be organized into separate operations so it becomes easy to maintain (ex: if the developer needs to update/add an element to an operation it is easier because it is ONLY necessary to edit and test a specific section of the application).

With this in mind, procedures can be a very useful tool for the developer - they are used to include the execution of specific or recurring operations and can be called into the application's workflow, whenever needed.

For instance, the day-to-day tasks of a working environment such as a Warehouse environment (Daily Assignment, Picking, Label Printing, etc.), can be represented as procedures.

There are Procedures with a more context related scope (Local Procedures) or a broader scope (Global Procedures). Also, there are procedures that run in the background, parallel to the application's general flow (Background Procedures).

Depending on purpose and context, there are three types of procedures available for use:

 

1. Local Procedures

A specific set of commands (processes), inside a program. A Local Procedure can ONLY be called inside the program it is contained in. When creating a local procedure, you can define input and output parameters that are shared with the processes that call that local procedure.

There is a specific Branch process to call a local procedure - the "Call Local Proc" process.

See Local Procedures.

 

 

2. Global Procedures

A specific program used for recurring actions which can be reused in other projects, meaning, you can create a global procedure in an MCL-Designer V4 project, export it into Library and, then, import it into other MCL-Designer V4 projects.

It can contain screens, controls, routines and local procedures. Basically, it can be considered as a standard program.

To exchange data between the program that called this procedure and the global procedure, it is mandatory to define "input" and "output" parameters.

There is a specific Branch process to call a global procedure - the "Call Global Proc" process.

 

 

3. Background Procedures

A specific program that is launched by an application program (running in the foreground/main thread) and runs asynchronously (in a secondary thread).

Background Procedures are ideal for operations that do not require user/operator intervention or that are potentially time-consuming because they do NOT block the application's execution flow.

The background procedure does NOT include any elements related to user interface (ex: screens; controls).

There is a specific Branch process to call a background procedure - "Call Background Proc" process.

 

If required, you can use the drag-and-drop mechanism as a shortcut to include a Global/Local/Background Procedure to certain elements: a screen, a "routine in", a "routine out" or a control:

If you drag a previously created Procedure from its section onto a compatible element - a screen/control (specifically, its "Actions" tab), a "routine in"/"routine out" (onto its "Routine" tab), the "Event" tab of a global event (ONLY possible for Global Procedures) - it automatically adds the corresponding "Call ... Proc " Branch process to the target element. In the case of Background Procedures, they can also be added to the "Procedure" tab of a Local and/or Global Procedure.

See Working with Call Local Proc Process

See Working with Call Global Proc Process

See Working with Call Background Proc Process

 

 

 

Topics

 

This chapter covers the following topics:

 

Topic

Local Procedures

Global Procedures

Background Procedures