Annotation Road Blocks

Posted by GregHiggins on 20-Dec-2017 09:02

Imagine how much simpler everyone's life would be if OpenEdge / whatever ran source through the preprocessor before scanning annotations.

Example 1:

@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="true").
@progress.service.resourceMapping(type="REST", operation="create", URI="", alias="", mediaType="application/json").
method public void create ( input-output dataset {&DatasetName} ):

/* Validate Stuff */
this-object:CreateData ( dataset {&DatasetName} by-reference ).

this-object:saveTTDataSource ( jsonDB, temp-table srctt{&TableName}:handle ).

end method /* create */.

Example 2:

&global-define TableName customer

&global-define ClassName {&TableName}BE

&global-define SchemaName ds{&TableName} 

&global-define SchemaPath /path/to/schemas

&global-define ServiceName MyService

@openapi.openedge.export FILE(type="REST", executionMode="singleton", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resource FILE(name="{&ClassName}", URI="/{&ClassName}", schemaName="{&SchemaName}", schemaFile="{&ServiceName}/{SchemaPath}/{&SchemaName}.i").

All Replies

This thread is closed