Create Operators
Use the SAP Data Hub Modeler to create an operator that you can use in a graph.
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 tool provides.
Procedure
- Start the SAP Data Hub Modeler.
-
In the navigation pane, choose the Repository tab.
The tool displays all graphs, operators, and Dockerfiles available in your repository. These are grouped under the tabs, Graphs, Operators, Docker Files respectively.
-
Create a folder.
- Right-click the Operators section and choose Create Folder to create a new folder in which you want to define the operator.
-
Provide a name for the root folder and choose
OK.
-
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 (name for
the operator in the UI) for the operator.
You can use the display name to search and add the operator when creating graphs.
-
In the Base Operator dropdown list, select the
required base operator.
The operators that you create are derived from the base operators that the tool already provides.
-
Choose OK.
The tool opens the operator editor, which is a form-based editor that you can use to define the operator and its configurations.
-
Define the operator.
Use the operator editor view to define your operator.
- 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.
-
In the Tags section, choose + (Add tag) if
you want to select a tag available in the tag database.
Tags describe the runtime requirements of operators and are the annotations of Dockerfiles that the tool provides. If multiple implementations exist for the operator, the tool displays the different subengines in which you can execute the operator. For each subengine, you can further associate them with tags from the database.
- For each subengine, choose + (Add tag) to select a tag available in the tag database.
-
Define operator configurations.
-
(Optional) If you want the tool to auto propose a type definition based
on the existing operator configurations, choose Auto
Propose.
You can edit the auto proposed type and modify the type properties. Choose (Open Type) 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 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, choose (Open Type).
-
In the Operator Configuration section, choose
+ (Add Parameter) to add and define a new
configuration parameter for the operator.
Provide the configuration parameter name, select the parameter type, and provide a parameter value.
- If you want to use the operator to execute script snippets within the graph, in the Script section, provide the required script.
- After defining the operator, if you want to view the JSON definition for the operator, in the editor toolbar, choose JSON.
-
(Optional) If you want the tool to auto propose a type definition based
on the existing operator configurations, choose Auto
Propose.
-
(Optional) Select a display icon for the operator.
When you use the operator in the graph editor, if you have not selected the required display icon, the tool uses a default operator display icon. You can select and replace the display icon with any of other icons that the tool provides, or you can upload an icon in Scalable Vector Graphics (SVG) format and use it for the operator display in UI.
- In the operator editor, select the operator default icon.
- If you want to use any of the icon that the tool provides, in the Icon dropdown list, select the required icon.
- If you want to upload a SVG file, choose and browse to the required .svg file.
-
Choose OK.
The tool uses the new icon for the operator on the graph editor.
-
(Optional) Create or maintain documentation for the operator.
You can maintain documentation for operators, or if a documentation already exists for an operator, you can modify the documentation. The documentation that you provide, for example, can include information on the operators, its configuration parameters, input ports, output ports, and more. Other users working with this operator can refer to this documentation in the Documentation Tab.
- In the operator editor toolbar, choose (Edit Documentation).
- Provide the required documentation.
- Choose Save.
-
(Optional) Upload auxiliary files.
You can upload such auxiliary files to the repository that the operator may need to access or execute at runtime. It can be any kind of file. For example, binary executables such as a JAR file that the tool must execute, when the graph that uses the operator is executed.
-
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 Managemet application.
-
In the operator editor toolbar, choose (Upload Auxiliary File).
-
(Optional) Edit an existing operator.
- If you want to edit an operator, in the navigation pane, choose Operators tab.
- Right-click the operator, which you want to edit and choose Edit menu option.
-
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 (Save) to save the operator.