This chapter explains the use of the Stored Procedure Application Overlay in the
Stardust Browser Modeler. A stored procedure is a subroutine available to applications
that access a relational database system.
The Stored Procedure Application Overlay allows the process designer to:
To explain how the Stored Procedure Application Overlay works, the examples below are using a RDBMS having:
The table projects with some records is defined below.
create table projects (id integer primary key, project varchar(10), license varchar(5)); insert into projects values (1, 'Camel', 'ASF'); insert into projects values (2, 'AMQ', 'ASF'); insert into projects values (3, 'Linux', 'XXX');
The GetAllProjects() stored procedure is defined below.
CREATE PROCEDURE GetAllProjects() BEGIN select * from projects; END;
The calculate stored procedure with IN and OUT parameters to add and multiply two integers.
CREATE PROCEDURE calculate(IN x INT, IN y INT, OUT sum INT, OUT product INT) BEGIN SET sum = x + y; SET product = x * y; END;
This example shows how to use a Stored Procedure application to invoke a procedure having a select request on the projects table. The query result is assigned to an SDT and displayed on the screen.
In this example, the GetProjectsSP activity is using a Stored Procedure Application.
To create a new Stored Procedure application, select Create Stored Procedure Invocation menu item from the Applications pop-up menu accessible from the Process Model tree:

Since the stored procedure will return a list of projects, you have first to define the Project structured data type having attributes similar to the table columns. The Projects structured data type has 0 or more Project.

In the Parameters tab, you have to define the input/output parameters, those parameters can be primitive or structured data.

In the Configuration tab, enter the stored procedure query:

In the Data Source tab, enter the data source connection details (host, port, user, etc.):

Once the process deployed and executed, the stored procedure result should be displayed as follow:

The purpose of this example is to show how to invoke a stored procedures with in/out parameters. In this case, the user enter two numbers, then the calculate stored procedure is used to add and multiply their values.
The in/out parameters are defined in the Stored Procedure Application parameter tab

In the Configuration tab, the stored procedure is invoked as below:

When running the process, if we enter "2" and "12" as parameters, the result will be as follow: