docs.intersystems.com
Home  /  Application Development: Creating Productions  /  Business Process and Data Transformation Language Reference  /  DTL Elements  /  DTL <transform>


Business Process and Data Transformation Language Reference
DTL <transform>
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Transform an object of one type into an object of another type.
Synopsis
<transform sourceClass="MyApp.SAPtoJDE"            targetClass="AlsoMine.JDE"  />
Attributes
Attribute Description Value
sourceClass Required. The class name of the input object for the data transformation. The name of a valid object and property.
targetClass Required. The class name of the output object for the data transformation. The name of a valid object and property.
sourceDocType Optional. When the input object is a virtual document, this string identifies its DocType. A string.
targetDocType Optional. When the output object is a virtual document, this string identifies its DocType. A string.
language Optional. Should be objectscript objectscript
create Optional. The create option desired for the target object. If not specified, the default is new. This can take one of the following values: new, copy, or existing as detailed in the following description.
Elements
Element Purpose
<annotation> Optional. A text string that describes the <transform> element.
Most activities Optional. <transform> may contain zero or more of the following elements in any combination: <assign>, <code>, <foreach>, <if>, <sql>, <subtransform>, or <trace>.
Description
The <transform> element is the outermost element for a DTL document. All the other DTL elements are contained within a <transform> element. Within the <transform>, the two objects have the names source and target, respectively. For example:
<transform targetClass='Demo.DTL.ExampleTarget'
           sourceClass='Demo.DTL.ExampleSource'
           create='new'
           language='objectscript'>

       <trace value='"Convert from lowercase to uppercase"'/>
       <assign property='target.UpperCase'
          value='$ZCONVERT(source.LowerCase,"U")'
          action='set'/>

</transform>
Source and Target Objects
The sourceClass and targetClass may identify standard production message classes, each of which contains a set of properties. If so, the sourceDocType and targetDocType attributes are not needed.
Alternatively, the sourceClass and targetClass may identify virtual documents. In this case the sourceDocType and targetDocType attributes are needed to tell InterSystems IRIS which message structure to expect in the virtual document.
Values for the create Option
The create option for the target object may have one of the following values: