If you choose the option to Evaluate / set by call to RDMLX function, (or the equivalent for an RDML function) then it is your responsibility to create and deploy or install the specified LANSA function that will evaluate (and set) your system property's value.
When LANSA Composer calls your function to evaluate or set a system property value, it will communicate with it using the LANSA exchange list. Specifically, your function must define (if necessary) and use the following fields to identify the request and to return the result. In the case of fields that are indicated to be output variables, your function must use the EXCHANGE command to place them on the LANSA exchange list before returning.
|
Differences for RDML Functions
Database changes in LANSA Composer version 6.0 necessitated a change to the definition of field DXSPVL. In LANSA Composer version 5.0 and earlier it was defined as A(256) – now it is a string with maximum length 1024.
Existing RDML (and RDMLX) evaluation functions created and compiled using the earlier definition will continue to function correctly in version 6.0 (providing values longer than 256 are not used). However, before you rebuild the function, some source-level changes may be required. These notes also apply if you are creating new RDML evaluation functions (but you are advised to use RDMLX for all new implementations).
If you are using the repository field definitions supplied with LANSA Composer, the new definition of field DXSPVL is incompatible with use in RDML functions.
case of_field(#DXREQUES)
when value_is('= ''GET''')
change field(#DXSPVL256) to('''My system property value''')
change field(#DXRESULT) to('''OK''')
exchange fields(#DXRESULT)
use builtin(exchange_alpha_var) with_args('DXSPVL' #dxspvl256)
…
endcase
If you are not using the repository field definitions supplied with LANSA Composer, then you should simply make sure that your function defines field DXSPVL as A(256).
Example RDMLX Function
The following is an example RDMLX function to evaluate (and set) a system property named MY_PROPERTY.
function options(*direct)
* ---------------------------------------------------------------------------
* Program mainline
* ---------------------------------------------------------------------------
case of_field(#dxspid)
when value_is(= 'MY_PROPERTY')
case of_field(#dxreques)
when value_is(= 'GET')
#dxspvl := 'MY_PROPERTY_VALUE'
#dxresult := 'OK'
exchange fields(#dxspvl #dxresult)
when value_is(= 'SET')
* MY_PROPERTY is NOT intended to be writeable
#dxresult := 'ER'
exchange fields(#dxresult)
abort msgtxt('System property MY_PROPERTY not writeable')
endcase
otherwise
abort msgtxt('System property name not recognised by this function')
endcase
return