Data Provider: OutputOfficial Content

As you may already know, the output of a Data Provider is a hierarchical structure. The way GeneXus represents that kind of data is the Structured Data Type (SDT) object or a collection of them (indeed, there is another way, that you could see below).

The way to retrieve that output is not the usual one (through the 'parm' rule). There is a special Output property instead. It is mandatory to associate that SDT to the Data Provider through that property.

Of course, the structure of the defined output in the source has to match the structure of the SDT you associate in the Output Properties of the Data Provider. There can be more than one solution to the same Source, as we can see in the following examples: 


DP Source + Output + SDT DP Source + Output + SDT version 2


Besides the possibilities of returning a simple SDT, a collection of it can be returned.

Since the SDT is already a collection, it is not necessary to set the value of the Collection property as True. We would have to do this if we wanted the Data Provider to return a collection based on a simple structured data type. 

In addition a data provider can be exposed as a web service by setting the Expose as Web Service property to true.

Business Component as output#

The Transaction object is also a GeneXus way to represent hierarchical data, but at database level, through a user interface (the Form). The corresponding hierarchical structure resulting of keeping only the structure (and all the logic) but not the Form is called Business Component (BC). So, a Business Component also involves an SDT, that is, a hierarchical structure that can be used in the same scenarios an SDT can be used.  Then, the output of a Data Provider not only can be an SDT (or collection of them) but also a BC (or collection of them).

The BC output case doesn't have any difference with the SDT output case. The BCs structure is filled inside the Data Provider just like an SDT. The object that calls the Data Provider will have to work with the BC, executing the Save method to insert into the database. That is, to the Data Provider point of view, there is no difference between an SDT output and a BC one.

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.