Procedure
- In Repository, click the Code node, then Routines, then right-click on Routines and select the Create routine option to create a user routine.
-
In the pop-up window, enter a routine name in the Name field (this example uses
MyRoutineDemo). Then click Finish.
-
By default an example function called helloExample is provided whenever a new user routine is created, as follows:
Note: The function annotates are optional, but if you want the function to be displayed in a category so that the function can be chosen from the category when editing the code expression, as the below figure showed, you have to specify the {Category} property.
-
Create a new function called reverseString that is used to reverse a string.
Note: If you need to use external JARs in the function, right-click on the routine name in Repository and select the Edit Routine Libraries option to add external JARs.