8 3 1 System Property Evaluation Functions

LANSA Composer

8.3.1 System Property Evaluation Functions

If you choose the option to Evaluate / set by call to 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.

  • Your function may be created using RDML or it may be fully RDMLX enabled.
  • Your function must be defined with function options(*direct)
  • Your function must be created and compiled at a LANSA level that is compatible with the version of LANSA Composer that you are using
  • Your function must be deployed to the partition module library for the LANSA system and partition in which LANSA Composer is installed on your LANSA Composer server (for example LICLICLIB)

 

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.

Name

Description

Type

Usage

DXREQUES

Request code.  LANSA Composer will set this to one of the following values:

'GET' - indicates the function should evaluate the specified system property and place its value in field DXSPVL

'SET' - indicates the function should set the value of the specified system property using the value provided in field DXSPVL.

A(10)

Input

DXSPID

System property identifier.  Your function may be used to evaluate or set the values of more than one system property.  If you design your solution in this way, your function will need to test this value (and/or the DXSPII field value) to determine which system property it is being requested to evaluate or set.

A(20)

Input

DXSPII

System property internal identifier.  This is a unique internal identifier that LANSA Composer assigns to each system property definition.

A(32)

Input

DXSPVL

System property value.

For a GET request, your function must set the value of this field to contain the evaluated value of the specified system property.

For a SET request, your function should set the value of the specified system property using the value provided in this field.

A(256)

Input (SET)

Output (GET)

DXRESULT

Result code.  If your function completes normally, its should set the value of this field to 'OK'.  If the result code contains any other value, LANSA Composer will assume that the evaluation request failed and will not use the returned system property value.

A(2)

Output

 

 

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