RunGraph
Short Description |
Ports |
Metadata |
RunGraph Attributes |
Details |
Examples |
Compatibility |
See also |
Short Description
RunGraph runs CloverDX graphs. Graph names can be specified in the component attribute or received through the input port.
Ports
Port type | Number | Required | Description | Metadata |
---|---|---|---|---|
Input | 0 | For graph names and CloverDX command line arguments. | Input Metadata for RunGraph | |
Output | 0 | For information about a graph execution. | Output Metadata for RunGraph | |
1 | For information about an unsuccessful graph execution. | Output Metadata for RunGraph |
Information about a successful execution of the specified graph is sent to the first output port.
Information about an unsuccessful execution of the specified graph is sent to the second output port.
Metadata
Metadata cannot be propagated through the RunGraph component.
The component has metadata templates assigned to all its ports.
Input metadata
Metadata on the input port must have at least 2 field.
The first two metadata fields must be string
.
Table 62.5. Input Metadata for RunGraph
Field number | Field name | Data type | Description |
---|---|---|---|
0 | <anyname1> | string | The name of the graph to be executed, including the path. |
1 | <anyname2> | string |
CloverDX command line argument.
Warning:
Arguments sent in this field are ignored
when the Same JVM attribute is |
Output Metadata
Both output ports must have the same metadata. The metadata on the output ports can have additional fields, the additional fields must be placed after the metadata fields from the template.
Table 62.6. Output Metadata for RunGraph
Field number | Field name | Data type | Description |
---|---|---|---|
0 | graph | string | The name of the graph to be executed, including the path. |
1 | result | string |
Result of the graph execution
( |
2 | description | string | Detailed description of a graph fail. |
3 | message | string | The value of org.jetel.graph.Result . |
4 | duration | integer, long, or decimal | The duration of a graph execution in milliseconds. |
5 | runId | long | Identification of the execution of the graph which runs on CloverDX Server. |
RunGraph Attributes
Attribute | Req | Description | Possible values |
---|---|---|---|
Basic | |||
Graph URL | [1] | The name of one graph, including the path, that should be executed by the component. Information about success or fail is sent to the first or the second output port, respectively. | |
The same JVM |
By default, the same JVM instance is used to run the specified graphs.
If switched to | true (default) | false | |
Graph parameters to pass |
Parameters that are used by executed graphs.
List a sequence separated by a semicolon.
If the attribute The same JVM is switched to | ||
Alternative JVM command | [2] |
Command line to execute external process.
If you want to give more memory to individual graphs
that should be run by this RunGraph component,
type in | java -cp (default) | other java command |
Advanced | |||
Log file URL |
The name of the file, including the path, containing the log of external processes.
The logging will be performed to the specified file
independently on the value of the attribute The same JVM.
If The same JVM is set to | ||
Create directories |
If set to | false (default) | true | |
Append to log file | [2] | By default, data in the specified log file is overwritten on each graph run. | false (default) | true |
Graph execution class | [2] | Full class name to execute graph(s). | org.jetel.main.runGraph (default) | other execution class |
Command line arguments | [2] | Arguments of a Java command to be executed when running graph(s). | |
Ignore graph fail |
By default, if the execution of any of the specified graphs fails,
the graph with RunGraph (that executes them) fails too.
If this attribute is set to | false (default) | true | |
[1] Either Graph URL must be specified or the input port connected. [2]
These attributes are applied only if the attribute
The same JVM is set to |
Details
RunGraph works in two modes. You can define a graph to run using the Graph URL attribute or send it using input edge.
Processing of command line arguments
All command line arguments passed to the RunGraph
component (either as the second field of an input record
or as the cloverCmdLineArgs
component property)
are regarded as a space delimited list of arguments which can be quoted.
Moreover, the quote character itself can be escaped by a backslash.
Example 62.2. Working with Quoted Command Line Arguments
Let us have the following list of arguments:
firstArgument "second argument with spaces" "third argument with spaces and \" a quote"
The resulting command line arguments which will be passed to the child JVM are:
1) firstArgument
2) second argument with spaces
3) third argument with spaces and " a quote
Notice in 2), the argument is actually unquoted. That grants an OS-independent approach and smooth run on all platforms.
Error logging
If the executed graph fails, the caused error message and exception stacktrace are printed out to a standard graph log. If this graph failure caused the parent graph to fail (the Ignore graph fail attribute is false) the caused error message is printed out on ERROR logging level, otherwise on INFO level.
Notes and limitations
RunGraph cannot run a graph with subgraphs in separate JVM.
Details of graphs running in separate JVM cannot be seen in execution view of the component.
Graphs running in separate JVM do not send runId to the output.
RunGraph on CloverDX Server
You cannot run a graph in separate JVM on CloverDX Server.
Tip | |
---|---|
Use the Ctrl+ shortcut to instantly open the graph. |
Examples
Running a graph using RunGraph |
Running several graphs using RunGraph |
Running a graph using RunGraph
Run graph ProcessInvoices.grf.
Solution
Use the Graph URL attribute to define the graph to be run and do not connect an input edge.
Attribute | Value |
---|---|
Graph URL | ${GRAPH_DIR}/ProcessInvoices.cdf |
Running several graphs using RunGraph
Run several graphs using the RunGraph component.
Solution
Send graph URLs to the RunGraph using the input edge. Do not fill in the attribute Graph URL.
Compatibility
Version | Compatibility Notice |
---|---|
4.0 | Previous versions required to specify Command line arguments if the path to the graph was set up using the Graph URL attribute. |