JSDO Generic Service Interface support for Invoke Task
The JSDO Generic Service Interface supports InvokeTask calls for Business Task method through PASOE Web Handler (OpenEdge 11.6+).
The InvokeTaks is implemented in two interface methods: Catalog and InvokeMethod. It's not required to register additional Web Handlers beyond what's documented here.
A Business Task which should be invokable through the Generic Service Interface needs to implement the Consultingwerk.OERA.IBusinessTaskCatalogInfo interface. This Inerface defined the GetCatalogData method which returns the IBusinessTaskCatalogData instance. The catalog data describes the Business Task methods and their parameters:
- ProDataset references
- ProDataset effective parameter mode (Input, Output, InputOutput)
- JSON Serializable Parameter class name
/** * Purpose: Returns the REST/JSDO catalog data to the caller * Notes: * @return The IBusinessTaskCatalogData instance describing the methods of the Business Task */ METHOD PUBLIC Consultingwerk.OERA.IBusinessTaskCatalogData GetCatalogData (): DEFINE VARIABLE oCatalog AS BusinessTaskCatalogData NO-UNDO . // Initialize first Method Descriptor through the catalog data descriptor oCatalog = NEW BusinessTaskCatalogData (THIS-OBJECT:GetClass():TypeName, "SampleBusinessTaskMethod", DATASET dsCustomer:HANDLE, DatasetParameterModeEnum:InputOutput, DATASET dsItem:HANDLE, DatasetParameterModeEnum:Input, GET-CLASS (IntegerHolder)) . // Add a second method oCatalog:Methods:Add ("SampleBusinessTaskMethod2", DATASET dsItem:HANDLE, DatasetParameterModeEnum:Output, GET-CLASS (CharacterHolder)) . RETURN oCatalog . END METHOD.
In the JavaScript code, the Business Task can be called through an JSDO, initialized for the Business Task Name (instead of the Business Entity Name). The Business Task Methods are callable directly on the JSDO instance (like invokable methods of a Business Entity