6.9.1 Creating the Transformation Function Definition File

The transformation function definition file defines the configuration of the transformation function invoked from the custom function. Use the file to

The following is a descriptive example of the transformation function definition file. The slanting part is data specified by the user.

<?xml version="1.0" encoding="UTF-8"?>
<func:customFunc xmlns:func="http://www.hitachi.co.jp/soft/xml/cosminexus/cscdt/functions">
<func:jar name="sample.jar">
 <func:package name="jp.co.Hitachi.soft.sample">
  <func:class name="SampleClass">
   <func:method name="sampleFunction">
    <func:comment>Description of sampleFunction</func:comment>
    <func:arguments>
     <func:argument name="arg1">
      <func:comment>Description of arg1</func:comment>
     </func:argument>
     <func:argument name="arg2">
      <func:comment>Description of arg2</func:comment>
     </func:argument>
     <func:argument name="arg3">
      <func:comment>Description of arg3</func:comment>
     </func:argument>
    </func:arguments>
   </func:method>
   <func:method name="sampleStringFunction">
    <func:comment>Description of sampleStringFunction</func:comment>
    <func:arguments>
     <func:argument name="arg1" type="String">
      <func:comment>Description of arg1</func:comment>
     </func:argument>
    </func:arguments>
    <func:return type="String"/>
   </func:method>
   <func:method name="sampleNodeListFunction">
    <func:comment>Description of sampleNodeListFunction</func:comment>
    <func:arguments>
     <func:argument name="arg1" type="Object">
      <func:comment>Description of arg1</func:comment>
     </func:argument>
    </func:arguments>
    <func:return type="NodeList"/>
   </func:method>
  </func:class>
 </func:package>
</func:jar>
</func:customFunc>

The user creates the transformation function definition file using the XML editor. The following points describes how to create the transformation function definition file using the XML editor of Eclipse.

  1. In the Eclipse menu, choose File, New and Others.
    The New dialog box appears.
  2. Choose XML and XML (basic template) and then click Next.
    The XML file page appears.
  3. Specify the directory for saving the transformation function definition file and the file name and then click Next.
    The Create the XML file from the following page appears.
  4. Choose the Create the SML file from XML schema or file radio button and then click Next.
    The Choose XML schema or file page appears.
  5. Click Import file.
    The Import dialog box appears.
  6. Specify the following directory in From the following directories.

    uCosminexus Service Architect installation directory\CSCTE\resources\customfunc

  7. Check the customfunc check box and the customfunction_XMLSchema.xsd check box.
  8. Specify the folder for importing the schema file in Import--destination folder.
  9. Click End.
    The Choose XML schema or file page reappears.
  10. Click Next.
    The Choose root element page appears.
  11. Specify customFunc in Root element and then click End.
    The form of the transformation function definition file is created.

    [Figure]

  12. Add the required elements in the form of the transformation function definition file and create the file.
    The following tabs are used in the transformation function definition file.

    Table 6-8 List of tabs used in the transformation function definition file

    Item no.Element or attribute nameContentsTypeNumber of itemsNumber of characters
    MinimumMaximumMinimumMaximum
    1customFuncTransformation function definitionElement11----
    2jarjar file informationElement1255----
    3namejar file nameAttribute111100
    4packagePackage informationElement1255----
    5namePackage nameAttribute111255
    6classClass informationElement1255----
    7nameClass nameAttribute111100
    8methodMethod informationElement1255----
    9nameMethod nameAttribute111100
    10commentMethod commentElement0101,024
    11argumentsArgument informationElement01----
    12argumentArgumentElement1255----
    13nameArgument nameAttribute111100
    14TypeArgument type (String or Object)Attribute01--
    15commentArgument commentElement0101,024
    16returnReturn valueElement01--
    17typeReturn value type (String or NodeList)Attribute11--
    (Legend)
    --:There is no limit on the number of characters.

    Note the following when creating the transformation function definition file:
    • Do not use the same class name and method name.
    • Do not specify String in the class name.
    • An unintended result such as Java syntax error etc might occur depending on the contents because the comment is embedded as it is in 1 line of the specified character string. If an unintended result occurs, modify the Java file directly.