Create Operators
You can use the SAP Data Hub Modeler to create your own operators and execute them in the graphs. The Modeler provides a form-based editor to create operators.
Context
An operator represents a vertex of a graph. An operator is a reactive component, hence is not intended to terminate, and reacts only to events from the environment. The operators that you create in the modeler are derived from the base operators that the application provides.
Procedure
- Start the SAP Data Hub Modeler.
-
Select a folder.
You create operators within a folder structure in the Modeler repository.
-
In the navigation pane, choose the Repository
tab.
The application displays all graphs, operators, and Dockerfiles, and more that are available in your repository. These objects are grouped under specific folders.
-
Right-click the Operators section and choose
Create Folder.
-
Provide a name for the folder and choose
OK.
This operation creates a folder within which you can create and define the operator.
-
In the navigation pane, choose the Repository
tab.
-
Create an operator.
- Right-click the folder in which you want to create the operator and choose the Create Operator menu option.
- In the Name text field, provide a name for the new operator.
-
In the Display Name text field, provide a display name for the
operator.
The application uses the display name for the operator in the UI. You can use this name to search for the operator in the application.
-
In the Base Operator dropdown list, select the
required base operator.
The operators that you create are derived from the built-in base operators that the application provides.
-
Choose OK.
The application opens the operator editor. Use this form-based editor to define the operator and its configurations.
-
Define the operator.
Use the operator editor to define your operator.
Action Steps Define ports - In the operator editor, choose the Ports tab to define the input and output ports.
- In the Input Ports section, choose + (Add input port) to define the input port name and input port type.
- In the Output Ports section, choose + (Add output port) to define the output port name and output port type.
Define tags Tags describe the runtime requirements of operators and are the annotations of Dockerfiles that the application provides. If multiple implementations exist for the operator, the application displays the different subengines in which you can execute the operator. For each subengine, you can further associate them with tags from the database. To define tags, - In the operator editor, choose the Tags tab.
- In the Tags section, choose + (Add tag) if you want to select a tag available in the tag database.
- For each subengine, choose + (Add tag) to select a tag available in the tag database.
Define configurations - In the operator editor, choose the Configuration tab.
- If you want the application to auto propose a type definition based on the existing operator configurations, choose Generate Config Schema.
- You can edit the auto proposed type and modify the
type properties. In the
Parameters section, choose
(Open Type Schema) to edit the auto proposed type
properties. - (Optional) If you want to import an existing type
definition and reuse it to define the operator
configurations, choose
Import, and select the
required type.
Types allow you to enable semantic type validations on top of the configuration parameters and to define UI conditions. You can create new types or edit an existing type definition available in the repository and reuse it to define the operator configuration. In the navigation pane, choose the Types tab to create new types. After importing a type, if you want to edit its properties, in the Parameters section, choose
(Open Type
Schema). - (Optional) If you want to add and define new
configuration parameters, in the Operator
Configuration section, choose
+ (Add
Parameter).Provide the configuration parameter name, select the parameter type, and provide a parameter value.
Add scripts In graphs, you can use operators that help execute script snippets when the graph is executed. If you want to include such scripts in the operator definition, - In the operator editor, choose the Script tab.
- In the inline editor, enter the required script.
You can also change the default programming language of the editor. In the top right corner of the editor, select the required language.
- If you want to upload a script file from your
system, in the top left corner of the editor, choose
Upload File and click the
icon to browse and select
the required file.
Add operator documentation You can maintain documentation for operators, or if documentation already exists for an operator, then you can modify the documentation. The documentation can contain information, for example, the operator's configuration parameters, input ports, output ports, and more. Adding documentation helps other users when working with this operator. - In the operator editor toolbar, choose the Documentation tab.
- Provide the required documentation.
- In the editor toolbar, choose Save.
-
(Optional) Select a display icon for the operator.
When you use the operator in the graph editor, if you have not uploaded the required display icon, the application uses a default operator display icon. You can replace the display icon with any of other icons that the application provides, or you can upload your own icon in Scalable Vector Graphics (SVG) format and use it for the operator display.
- In the operator editor, select the operator default icon.
- If you want to use a default that the application provides, in the Icon dropdown list, select the required icon.
-
If you want to upload an SVG file, choose
and browse to the
required .svg file.
-
Choose OK.
The application uses the new icon for the operator on the graph editor.
-
(Optional) Upload auxiliary files.
You can upload such auxiliary files to the repository that the operator may access or execute it at runtime. It can be any kind of file, for example, binary executables such as a JAR file that the application must execute when executing the operator.
-
In the operator editor toolbar, choose
(Upload Auxiliary
File).
These files are stored along with the operators in the operator directory. You can access these files from the SAP Data Hub System Management application. Alternatively, you can also upload files from the Repository tab.
-
In the operator editor toolbar, choose
-
(Optional) Edit an existing operator.
- If you want to edit an existing operator, in the navigation pane, choose the Operators tab.
- Right-click the operator, which you want to edit and choose Edit menu option.
-
View JSON definition.
- After defining the operator, if you want to view the JSON definition for the operator, in the editor toolbar, switch to JSON.
-
Save changes.
-
In the editor toolbar, choose
(Save) to save the
operator.
You can now access this operator from the Operators tab (under the Others section) in the navigation pane, and use it for creating graphs.
-
In the editor toolbar, choose
