Try OpenEdge Now
skip to main content
Online Help
Data Object overview : Tasks : Working with Data Objects : Defining Data Object resources : Using the Define Service Interface wizard
 
Using the Define Service Interface wizard
You can use the Define Service Interface wizard to add the Data Object interface annotations to your existing ABL class and procedure files. Defining the service interface involves adding Data Object interface annotations to the ABL class (.cls) and procedure (.p) files. You can then expose the Data Object annotated ABL class and external procedure files as Data Object resources.
Note: To create a Data Object resource from an ABL external procedure, the ABL external procedure must be coded to be run as a singleton procedure. For more information, see the SINGLETON option of the RUN statement in OpenEdge Development: ABL Reference guide.
To add Data Object interface annotations to an ABL class or procedure file:
1. From the Project Explorer view, select a Data Object project.
2. Right-click the Data Object project, and then select Progress OpenEdge > Define Service Interface on the context menu. The Define Service Interface wizard appears.
3. From the Definition Mode drop-down, select Data Object. By default, it is set to Data Object.
4. From the Workspace resources list, select the ABL class and procedure files to which you want to add Data Object interface annotations. This defines the Data Object interface annotations at the procedure or class file level.
Note: If the selected ABL application contains ABL routines (internal procedures, methods, and user-defined functions), they appear on the ABL routines list.
5. From the ABL routines list, select the ABL routines to which you want to add the Data Object annotations. This defines the Data Object interface annotations at the routine level.
6. Click Next. The Edit Annotation page appears.
The Edit Annotation page displays the selected resources in the Select a file list and allows you to select a schema file for a resource and associate a Data Object operation: CRUD (Create, Read, Update, and Delete), Submit, and Invoke.
7. From the Select a file list, select an ABL resource for which you want to define a schema file and associate Data Object operations: CRUD, Submit, or Invoke with ABL routines.
8. On the Main Annotations tab, specify the resource URI and schema for the selected resource. For more information, see the Main Annotations tab.
Note: Select the Enable Main Annotation check box to enable editing.
9. On the CRUD annotations tab, associate ABL routines with CRUD operations (Create, Read, Update, and Delete) or the Submit operation. You can use only one-to-one association. For more information, see the CRUD Annotations tab.
For example, if there is an ABL routine defined as P1 and you want to associate it with the create operation, then select P1 in the Routine name drop-down for the create operation. You cannot associate the ABL routine P1 with any other CRUD operation once it is associated with one operation.
To associate an ABL routine with the Submit operation, you must select the Before-Image option. The Submit operation is only applicable to the datasets (not temp-tables) that you select on the Main Annotations tab. For more information, see the CRUD Annotations tab.
Note: Before you associate any operation with an ABL routine, you must select a schema file for the current ABL application on the Main annotations tab.
10. On the Invoke Annotations tab, associate one or more ABL routines with an invoke operation. You can map as many ABL routines in an ABL file as you have available to an invoke operation. For more information, see the Invoke Annotations tab.
Note: You cannot associate an ABL routine that is already associated with one of the CRUD operations, with the invoke operation.
11. On the Field Annotations tab, specify the fields and appropriate field-level annotations for the selected resource. For more information, see the Field Annotations tab.
12. Click Finish to save your settings and close the Define Service Interface wizard.
The selected ABL class and procedure files are annotated with Data Object interface annotations, and this completes the generation of a Data Object resource for each file.
Note: When you add Data Object interface annotations for ABL resources from a non-Data Object project such as OpenEdge AppServer facets, like REST, AppServer, the Data Object facet is enabled for the project and a Data Object Service gets created. The project behaves as a Data Object project using which you can develop Data Object applications. When you add annotations to any class or procedure file, if the AppServer facet is not available for the project then the project is converted to an ABL Web App project with additional ABL REST Service and ABL Data Object Service facets and a REST based ABL Data Object service is created. The Project Facets page (select Properties > Project Facets on the project context menu) displays the facets associated with your current project.