PTRTI Class Methods

In this section, the PTRTIR class methods are presented in alphabetical order.

Syntax

PostProcess(&triggerrec, &searchdefn, &keys, &keyvalueset)

Description

Use this method to perform post processing activities of a search definition in real time indexing.

Parameters

Parameter

Description

&triggerrec

Specifies the name of the trigger record as a String.

&searchdefn

Specifies the name of the search definition as a String.

&keys

Specifies the key names as in a staging row as an array of String.

&keyvalueset

Specifies the key values of the keys as in a staging row as an array of array of String.

Returns

A number; 0 indicates success and 1 indicates failure.

Note: However, the real time indexing process does not use the return value of the PostProcess method for any processing.

Example

import PTRTIPKG:PTRTI;

class RTI extends PTRTIPKG:PTRTI
   method PostProcess(&triggerrec As string, &searchdefn As string, &keys As array of string, &keyvalueset As array of array of string) Returns number;
end-class;

method PostProcess
   /+ &triggerrec as String, +/
   /+ &searchdefn as String, +/
   /+ &keys as Array of String, +/
   /+ &keyvalueset as Array2 of String +/
   /+ Returns Number +/
   /+ Extends/implements PTRTIPKG:PTRTI.PostProcess +/
   
   Local number &aresult;
   &aresult = 0;
   /* Perform some processing */
   Return &aresult;
   
end-method;

Syntax

Process(&triggerrec, &searchdefn, &keys, &keyvalueset)

Description

Use the Process method to perform the following activities:

  • Preprocessing: Performs the preprocessing task that was performed by an Application Engine program in a search definition.

  • Defer processing of current entries.

  • Discard processing of current entries.

Parameters

Parameter

Description

&triggerrec

Specifies the name of the trigger record as a String.

&searchdefn

Specifies the name of the search definition as a String.

&keys

Specifies the key names as in a staging row as an array of String.

&keyvalueset

Specifies the key values of the keys as in a staging row as an array of array of String.

Returns

An array of number with exactly one of the following values.

Value

Description

0

Defers the entry.

1

Processes the entry.

-1

Discards the entry.

If the method returns an array of numbers consisting of only one array element, the same value is applied to all the entries.

For example, if the keyvalueset has five rows and the return value is 1 (processes the entry), the return value 1 is applied to all the five rows, that is, processing the five rows.

Example

import PTRTIPKG:PTRTI;

class RTI extends PTRTIPKG:PTRTI
   method Process(&triggerrec As string, &searchdefn As string, &keys As array of string, &keyvalueset As array of array of string) Returns array of number;
end-class;

method Process
   /+ &triggerrec as String, +/
   /+ &searchdefn as String, +/
   /+ &keys as Array of String, +/
   /+ &keyvalueset as Array2 of String +/
   /+ Returns Array of Number +/
   /+ Extends/implements PTRTIPKG:PTRTI.Process +/
   
   Local array of number &aresult;
   &aresult = CreateArrayRept(0, 1);
   &aresult.Push(1);
   /* Perform some processing */
   Return &aresult;
   
end-method;