Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%iKnow] >  [TextTransformation] >  [Definition]
Private  Storage   

abstract class %iKnow.TextTransformation.Definition extends %RegisteredObject

This class represents a Text Transformation model, as defined in its Transformation XData block. See the %Apply and %ApplyBatch methods for ways how to invoke this model on input text.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 18


Summary

Methods
%AddToSaveSet %Apply %ApplyBatch %ApplyStream
%ClassIsLatestVersion %ClassName %ConstructClone %CreateKeyValue
%CreateSection %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Extends %GetParameter %IsA %IsModified
%New %NormalizeObject %ObjectModified %OnAfterTransformation
%OnBeforeTransformation %OnCreateKeyValue %OnCreateSection %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject


Parameters

• parameter DEFAULTSECTIONHEADER = "no header";

Methods

• final classmethod %Apply(ByRef pString As %String, Output pOutput As %iKnow.TextTransformation.Output) as %Status

Invokes the model defined in Transformation on the string pString, identifying sections, headers and key-value pairs as specified in the model. These elements are returned through an pOutput object of the output class specified in the model, defaulting to %iKnow.TextTransformation.Output.

pString may also be supplied as an array of strings representing consecutive lines of text (by reference). To invoke the model in batch on a bunch of records, use %ApplyBatch.

• final classmethod %ApplyBatch(pResultSet As %ResultSet) as %Status

Invokes the model specified in Transformation on all records retrieved by pResultSet, populating and saving an output object for each record. The first column of pResultSet is used as an identifier and saved as the Ref property of the output object. The second column is assumed to contain the text to be transformed by this model.

Note that the output object used for this batch operation should inherit from %Persistent in order for the output to be effectively persisted.

See also %Apply.

• final classmethod %ApplyStream(pStream As %Stream.Object, Output pOutput As %iKnow.TextTransformation.Output) as %Status
Invokes the transformation model on a character stream. See also %Apply.
• final method %CreateKeyValue(ByRef pOutput As Output, pHeader As %String, pKey As %String, pValue As %String, pLocation As OutputLocation) as %Status
Helper method to create a KeyValue object. Custom code in any of the callbacks (such as %OnBeforeTransformation) may invoke this method to add default key value pairs.
• final method %CreateSection(ByRef pOutput As Output, pHeader As %String, pText As %String, pLocation As OutputLocation, ByRef pKeyValues) as %Status
Helper method to create a Section object. Custom code in any of the callbacks (such as %OnBeforeTransformation) may invoke this method to add default sections. Note that no further callbacks are invoked for key-value pairs in the pKeyValues array.
• method %OnAfterTransformation(ByRef pOutput As Output) as %Status
This callback method is invoked after a record has been processed, before the Output object is saved.
• method %OnBeforeTransformation(ByRef pOutput As Output) as %Status
This callback method is invoked before a record is processed, after the Output object has been instantiated.
• method %OnCreateKeyValue(ByRef pKeyValue As OutputKeyValue, ByRef pOutput As Output) as %Status
Callback method invoked upon the creation of a KeyValue object. Use this callback to customize behavior upon creating key-value pairs. Setting pKeyValue to null will prevent the key-value pair from being added to the output.
• method %OnCreateSection(ByRef pSection As OutputSection, ByRef pOutput As Output) as %Status
Callback method invoked upon the creation of a Section object. Use this callback to customize behavior upon creating sections. Setting pSection to null will remove the section from the output.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.