Using custom functions

Custom functions can be registered to be used inside an expression.
To register custom functions:
  1. Click Edit > Functions.
    The Custom functions dialog opens with the list of currently registered custom functions.
    1. To add a function, click Add and type the fully qualified Java class name in the text field.
      The new function is added to the list.
      If the function is valid, its name and description can be seen in the details area.
      To be valid, a custom function must meet the following two criteria:
      • It must be a Java class implementing ilog.views.sdm.renderer.IlvSDMCSSFunction .
      • It must be already in the CLASSPATH of the Designer.
      If the function name cannot be loaded into the JVM, a red warning is displayed in place of the name and short description.
    2. To remove a function, select it in the list and click Remove.
  2. To accept the changes, click Apply.
    Note that only valid functions will be registered and shown by the Expression Assist. Any others will be removed.
Example:
  1. Create a new diagram by clicking File > New.
  2. Click Edit > Functions.
  3. Click Add.
  4. Type ilog.views.sdm.renderer.IlvSDMCSSFunction$Test in the “Add a new function” dialog box.
  5. Click OK.
    The new function appears in the list.
    The function is only for testing. It returns its first argument.
  6. Click Apply.
  7. In the diagram window, click one of the blue boxes.
  8. In the Styling Customizer, at the right of the name property field, type + .
    The Expression Assist displays a list of expression options.
  9. Select testFunction .
    The function is added in the expression.
  10. Inside the brackets, type :up .
  11. Press Enter to validate the expression.
All nodes have now :up appended to their label, for example Node 1:up .