HomeAbout MeContact

Custom Pipeline Operator - Start graph from another graph

By Michal Majer
September 26, 2022
1 min read
Custom Pipeline Operator - Start graph from another graph

Custom Pipeline Operator

My mm.dh.vflowpipeline operator is based on the standard com.sap.dh.vflowpipeline operator. The important difference is that it could receive substitution parameters from the input port.

Click to download mm.dh.vflowpipeline-1.0.0

Operator preview
Operator preview

Configuration parameters

The following parameters can or must be provided in order to execute a pipeline:

  • Graph Name (mandatory): Name of the graph to execute.\ ID: graphName | Type: string | Default: ""
  • Output Port Name: Specify the name of output (exported) port in the subgraph, if you want to receive the data from it.\ ID: pipelineOutPortName | Type: string | Default: ""
  • Configuration Substitutions: The configuration substitutions to be passed into the graph.\ ID: configurationSubstitutions | Type: array | Default: []
  • Stop graph after subgraph: Defaults to false. If set to true, the given graph will be stoped immediately after finishing processing the subgraph.\ ID: stopGraph | Type: bool | Default: false

Note that the value help for the property Graph Name displays always the list of possible graphs from the Modeler instance on the current machine.

Remarks:

Input

  • substitutions: The input message, with substitution parameters.\ Type: message

    Example:

    {
      Attributes: {},
      Body: [{
          "name": "BATCH",
          "value": 1000
      }]
    }
    

Output

  • output: The output port return the data from the subgraph (if output port name is specified).\ Type: any.*

Implementation

Maingraph

Example of a maingraph

Subgraph

Example of a subgraph

It’s required to set port as “exported”. Right click on out port and select “Export port”.

Node Base Operator

const SDK = require("@sap/vflow-sub-node-sdk");
const operator = SDK.Operator.getInstance();

operator.getOutPort("out1").send({
    Attributes: {},
    Body: [{
        "name": "BATCH",
        "value": 1000
    }]
});

Please let me know if, you think this is a useful solution. If you use the operator in your development, please tell me about it!

Please feel free to make any changes, starting from the ID to the program code.

Read more:

Click below image, to read a full blog at blogs.sap.com


Tags

sapdataintelligencesapdioperator
Previous Article
Custom Pipeline Operator - Start graph from another graph
Michal Majer

Michal Majer

SAP Developer

Topics

Apps Development
SAP HANA Database
SAP Data Intelligence

Quick Links

Advertise with usAbout UsContact Us

Social Media