Try OpenEdge Now
skip to main content
Messaging and ESB
Guidelines for Using and Programming for the OpenEdge Adapter for Sonic ESB : Native Invocation methodology : Declarative invocation files : Annotation examples
 
Annotation examples
You can automatically add annotations in OpenEdge Architect, or you can add them manually. For details on adding annotations in OpenEdge Architect, see Annotating ABL in OpenEdge Architect. The following code samples illustrate annotations:
*External procedure
The following code sample illustrates annotation of an external procedure, foo.p. The only required name-value pairs are type and executionMode, as shown:
/* foo.p */
@openapi.openedge.export FILE (type="ESB",executionMode="external").
DEFINE INPUT PARAM bar AS INT.
DEFINE OUTPUT PARAM ney AS CHAR.
...
Processing this annotation creates the file foo.esboe that describes a non-persistent operation named foo. foo takes an input integer named bar and returns a character string named ney.
*Renamed .esboe file for an external procedure
The following code sample illustrates the annotation of an external procedure, foo.p, that renames the generated .esboe file:
/* foo.p */
@openapi.openedge.export FILE (type="ESB", ,executionMode="external",
         esboeFileName="Renamed_foo").
DEFINE INPUT PARAM bar AS INT.
DEFINE OUTPUT PARAM ney AS CHAR.
...
This annotation creates the file Renamed_foo.esboe that describes a non-persistent operation on the OpenEdge Application Server.
*Internal procedure
The following code sample illustrates the annotation of an internal procedure, barr inside the file foo.p:
/* foo.p */
@openapi.openedge.export FILE (type="ESB", executionMode="persistent").
DEFINE INPUT PARAM bar AS INT.
DEFINE OUTPUT PARAM ney AS CHAR.
...@openapi.openedge.export(type="ESB")
PROCEDURE barr.
DEFINE INPUT PARAM abc AS INT.
DEFINE OUTPUT PARAM xyz AS CHAR.
...
The external procedure foo must be annotated as persistent before the internal procedure barr can be annotated. Three files are created based on these annotations:
*foo.esboefoo.esboe runs the external procedure persistently
*foo_barr.esboefoo_barr.esboe invokes the internal procedure
*foo_release.esboefoo_release.esboe deletes the persistent procedure, unbinding the OpenEdge Application Server from the process