on 11-02-2022 1:13 PM
Hello,
We are extracting data from BW and staging data in DI data lake(I know that this is not a good idea while using SAP DI but we had to due to the fact that data transfer operator cannot send data directly to ADLV2).
We need to extract 176 millions of data from source packet wise. So I want to create one graph and reuse it.
I have followed the below blog but couldn't successfully pass the variable value to the DI graph which is using pipeline operator to pass the variable.
Could anyone help me on this?
----------------------------------
$.addGenerator(gen)
var graphName = "Test_pipeline_with_dynamicvariable" //Your subgraph name
var ZDATPAKID = "000001"
function gen(ctx) {
// start subgraph
var g
try {
g = $.instantiateGraph(graphName,
{"ZDATPAKID": ZDATPAKID}
)
} catch(e) {
$.fail(e.message)
return
}
// wait for graph execution is finished
status = g.wait()
// check graph status
if (status != $.graphStatus.completed) {
$.fail("Subgraph is failed")
} else {
$.done()
}
}
------------------------------------------
Error:
MessageGroup messages: Group: default; Messages: error building graph: configuration substitution failed for subengine operator subengineOperator0: for process "1_2019" ("pipeline1"): for configuration "configurationSubstitutions[0].value": missing value for "ZDATPAKID" Process(es) terminated with error(s). restartOnFailure==false
Thanks,Sirisha
Hey nsirisha,
You can try to use my custom operator for that.
I also explained a bit other possibilities in this post blog.
I guess I did mistake in the short code from this answer - please check the full code from the post blog.
$.addGenerator(gen)
// This example shows basic usage of a subgraph
// It calls a graph with a parameter, provides input to a port,
// checks a port's output and stops the graph
var graphName = "com.sap.demo.subgraph.call-and-wait.sub"
var subgraphInput = "subgraph-input "
var paramValue = "value1"
function gen(ctx) {
// start subgraph
var g
try {
g = $.instantiateGraph(graphName,
{"param1": paramValue},
// handle subgraph output port with name 'output'
{"output":function(ctx,s){
// check subgraph output
if (s != subgraphInput + paramValue) {
$.fail("Unexpected subgraph output: " + s + " Expected: " + prefix+paramValue)
}
// stop subgraph
g.stop()
}}
)
} catch(e) {
$.fail(e.message)
return
}
// write string in subraph input port with name 'input'
g.input(subgraphInput)
// wait for graph execution is finished
status = g.wait()
// check graph status
if (status != $.graphStatus.completed) {
$.fail("Subgraph is failed")
} else {
$.done()
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.