Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.0

Memory Parameter APIs

General description

This is a general description of the use and purpose of the memory parameters APIs.

These APIs are used to transfer information from the service processor to the service handler when service requests are being handled.

After the service processor has identified the service handler in the service structure, the service handler program is called dynamically. The dynamic call demands that the interface of the service handler program is the same for all service handlers.

As the different types of service handlers need different input and output to receive and return data, it is not feasible to let the interface of the service handlers contain all combinations of the input and output fields the service handlers might need. To ensure that this does not limit the possibility of transferring data to and from the service handlers, APIs has been developed that allows the parameters to be written and read to and from memory.

For each set of parameters, a set of APIs has been created containing:

  1. A "Set" API that writes the value to memory.
  2. A "Get" API that reads the value from memory.
  3. A "Delete" API that deletes the memory store containing the value.

To transfer a parameter from the service processor to the service handler, you would do the following:

  1. In the service processor, call the Set API to make the value available for the handler.
  2. In the service handler, call the Get API to retrieve the value
  3. In the service processor, call the Delete API to ensure that the value is cleared before the next request is handled.

These APIs can be used in any cases where you want to transfer information from a calling to a called program without changing the interface of the called program. However, you should only do this if it is necessary, as the memory handling does carry a performance overhead.

Defining your own memory parameter APIs

If you are going to create your own specialized service processors and service handlers, it is conceivable that you need to transfer additional parameters between the service processor and the service handler.

You can create your own memory API in the following manner:

Create the triples:

Source Object Verb Target Object
MySetAPI is a FNC SystemAbstract.MemoryAPI
MyGetAPI is a FNC SystemAbstract.MemoryAPI
MyDeleteAPI is a FNC SystemAbstract.MemoryAPI

For each of the functions add the fields you want to transfer in the local variable Data (to ensure that you have the same fields, you might want to create a common abstract function that just defines the content of the Data variable).

For MySetAPI, add the fields to Input.

For MyGetAPI, add the fields to output.

Action diagram changes:

MySetAPI:

Post Point Set Set_Get flag:

Set RdWrGlobal<Set_GetPropertyFlag> = <Set_GetPropertyFlag.Set>

Post Point For Set function - set input to data:

Set Data = Input

MyGetAPI:

Post Point Set Set_Get flag:

Set RdWrGlobal<Set_GetPropertyFlag> = <Set_GetPropertyFlag.Get>

Post Point For Get function - set data to output

Set Output/Output = Data

MyDeleteAPI:

Post Point Set Set_Get flag:

Set RdWrGlobal<Set_GetPropertyFlag> = <Set_GetPropertyFlag.Set>

More information

Background: Handling web service requests

Background: Service processors

Background: Service handlers