View source | Discuss this page | Page history | Printable version   

Processes

Contents

Processes

A process is a systematic series of actions directed to some end. Typically a process receives some parameters and taking them into account performs some actions to obtain a result. Openbravo defines two main kinds of processes PL/SQL Processes and Java Processes.

All processes (as well as Reports) are managed from the same window: Application Dictionary || Report and Process.

Once a process is defined it can be added to the menu to be called directly from there, it can be invoked through a button or it can be scheduled to be executed in the background.

Background processes can be set as Prevent Concurrent Executions. Before a process with this attribute is about to be executed, it is checked there are no other instances of the same process in execution at the same time, in this case another execution is aborted.

Parameters

When a process (PL/SQL or Java) or a Jasper Report is set as Standard a pop-up message is automatically generated and displayed when invoking it, this message looks like this:

Ref-dialog-params.png

This pop-up has a section with information about the process, this information is obtained from the Help field in the Report and Process tab.

It also prompts for a number of parameters, and finally there are two buttons, OK to start the process and Cancel to close the pop-up and not to do anything else. In case the process did not require any parameter that section would be empty.

When this kind of process requires parameters they must be defined in theApplication Dictionary || Report and Process >> Parameter tab.

Ref-dialog-params-def.png

Parameters are defined in a very similar way than columns are, depending on the Reference field, the parameter is assigned the generated UI for it will be different.

Let's overview some of the most important fields in this tab:

Defining Processes

Processes can be of two different types: PL/SQL Processes and Java Processes. PL/SQL processes are implemented in the PL/SQL language and are executed by the database engine. Java proceses are implemented in the Java language and are executed by the application server.

PL/SQL Processes

PL/SQL Processes are implemented by database stored procedures. For more information read the documentation on How to create a Stored Procedure.

PL/SQL processes are defined in Application Dictionary || Report and Process. The only field to take into account for this kind of processes is Procedure: It is the procedure name in the database. Note that as PL/SQL procedures are assigned to modules, they must be named according to following the naming rules: the name of the procedure must start with the module's DBPrefix.

As the pop-up for PL/SQL processes is always automatically generated, the UI Pattern field must be set as Standard.

In case the process requires any parameter, it is possible to define them. To learn more about how to do it read the section above.

Java Processes

Java processes are implemented by java classes. For more information read the documentation How to create a Java Process.

Java processes are also defined in the Application Dictionary || Report and Process window. Depending on the UI pattern they use, they can be split into Standard and Manual. Additionally, if the UI Pattern is set to Manual is necessary to include an entry in the Process Mapping to make it accessible in the web.xml.

The pop-up used to invoke Java processes defined with Standard UI pattern is automatically generated in the same way the interface for PL/SQL processes is done.

To set a Java process to be have Standard UI just set the UI Pattern field to Standard in the Application Dictionary || Report and Process header. It is also necessary to indicate the Java class that is going to implement the process, this is done adding a new record in the Process Class tab. At least, one record in this tab must be checked as default.

If the process requires parameters they can be defined in the Parameter tab as explained in the Parameters section of this document.

Executing processes

Processes can be executed from the user interface from a menu or in with button. It can also be scheduled to be executed in the background without any user interaction.

Executing a process from a menu option

To execute a process from a menu option you need to define a new menu option that executes the process. Menus are defined in General Setup || Application || Menu. In the Action field the Process entry must be selected, then in the Process field select the process. it will be executed imediately and then saved.

Finally press the Tree button to organize the new menu option in the menu tree, and now the process defined can be executed selecting this new menu created.

Executing a process from a button

To execute a process with a button you need to define a column that references a button. In Application Dictionary || Tables and Columns, go to the column you want to use to execute the process and in the field Reference select the Button entry, then in the Process field select the process you want to execute and save.

When executing a process with a button, record ID the of the current record selected of the table will be passed to the process. This allows to execute functions for specific records.

Executing a process in the background

Backgroung processes are defined in General Setup || Process Scheduling || Process Request. For more information read the documentation How to create a Background Process.

In this window you can define a background process. The process to be executed can be selected in the Process field. Then you define the scheduling for the background process and it is then ready for use.

There is no user interaction necessary to execute the process, thus no pop-up will appear prompting for additional parameters.

Retrieved from "http://wiki.openbravo.com/wiki/Processes"

This page has been accessed 2,641 times. This page was last modified on 17 April 2013, at 14:35. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.