IBM Streams 4.2

Customizing default code templates

By default, Streams Studio includes code templates for composite operator, main composite operator, operator invocation, and Use directive. You can customize these default code templates for your SPL application.

Procedure

  1. From the menu, click Window > Preferences.
  2. In the Preferences window, expand IBM Streams > SPL and click Templates to display the Templates window.
  3. Click Edit to modify the default templates.
  4. Click Export to export the templates to an XML file.
  5. In the XML file, for each code template, add the id attribute. The following example shows how to add id="templateID1" to a code template in an XML file:
    <template id="templateID1" autoinsert="true"
    context= "com.ibm.streams.studio.spleditor.SPL.CompositeDef" deleted="false"
    description="General composite definition" enabled="true"
    name="Composite Definition">${modifier} composite ${name} (output ${outputs};
    input ${inputs}) {
      param ${formals};
      type ${types};
      graph ${inovkeOperators};
      config ${configs}; }
    </template>
  6. Copy the edited code templates to the Streams Studio install location/plugins/com.ibm.streams.studio.spleditor.templates/templates/templates.xml file.
  7. Restart Eclipse.