RunGraph

Not available in Community Designer

Short Description
Ports
Metadata
RunGraph Attributes
Details
Examples
Compatibility
See also

Short Description

RunGraph runs CloverETL graphs. Graph names can be specified in the component attribute or received through the input port.

Component Same input metadata Sorted inputs Inputs Outputs Each to all outputs [1] Java CTL Auto-propagated metadata
RunGraph-
no
0-11-2-
no
no
yes

[1]  Component sends each data record to all connected output ports.

Icon

Ports

Port typeNumberRequiredDescriptionMetadata
Input0
no
For graph names and Clover command line argumentsInput Metadata for RunGraph
Output0
yes
For information about graph execution Output Metadata for RunGraph
1
no
For information about unsuccessful graph executionOutput Metadata for RunGraph

Information about successful execution of the specified graph is sent to the first output port.

Information about unsuccessful execution of the specified graph is sent to the second output port.

Metadata

Metadata cannot be propagated through RunGraph component.

The component has metadata templates assigned to all it's ports.

Input metadata

Metadata on input port has to have at least 2 field. The first two metadata fields has to be string.

Table 56.5. Input Metadata for RunGraph

Field numberField nameData typeDescription
0<anyname1>stringName of the graph to be executed, including path
1<anyname2>stringClover command line argument. Warning: Arguments sent in this field are ignored when the Same JVM attribute is true (see RunGraph Attributes).

Output Metadata

Both output ports must have the same metadata. The metadata on the output ports can have additional fields, the additional fields must placed after the metadata fields from the template.

Table 56.6. Output Metadata for RunGraph

Field numberField nameData typeDescription
0graphstringName of the graph to be executed, including path
1resultstringResult of graph execution (Finished OK, Aborted, or Error)
2descriptionstringDetailed description of graph fail
3messagestringValue of org.jetel.graph.Result
4durationinteger, long, or decimalDuration of graph execution in milliseconds
5runIdlongIdentification of the execution of the graph which runs on CloverETL Server.

RunGraph Attributes

AttributeReqDescriptionPossible values
Basic
Graph URL [1] Name of one graph, including 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 false, graph(s) run as external processes. When working in the server environment, this attribute always has to be true (thus, you cannot pass graph arguments through field 1 of port 0, see Ports). true (default) | false
Graph parameters to pass Parameters that are used by executed graphs. List a sequence separated by semicolon. If The same JVM attribute is switched to false, this attribute is ignored. See Details for more information.  
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 here java -Xmx1g -cp or equivalent according to the maximum memory needed by any of the specified graphs. The '-cp' suffix is necessary, since classpath is automatically appended to your command line and the classpath attribute can differ between various JVM implementations.java -cp (default) | other java command
Advanced
Log file URL Name of the file, including path, containing the log of external processes. The logging will be performed to the specified file independently on the value of The same JVM attribute. If The same JVM is set true (the default setting), logging will also be performed to console. If it is switched to false, logging to console will not be performed and logging information will be written to the specified file. This attribute is ignored for server environment. See URL File Dialog.  
Create directories If set to true, non-existing directories in the Log file URL attribute path are created.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 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 true, fail of each executed graph is ignored. false (default) | true

[1]  Either Graph URL must be specified or input port connected.

[2]  These attributes are applied only if The same JVM attribute is set to false.

Details

RunGraph works in two modes. You can define graph to run using 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 backslash.

Example 56.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, caused error message and exception stacktrace are printed out to standard graph log. If this graph failure caused the parent graph fails (attribute Ignore graph fail is false) the caused error message is printed out on ERROR logging level, otherwise on INFO level.

Notes and limitations

RunGraph cannot run 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 does not send runId to the output.

RunGraph on CloverETL Server

You cannot run graph in separate JVM on CloverETL Server.

Examples

Running a graph using RunGraph
Running several graphs using RunGraph

Running a graph using RunGraph

Run graph ProcessInvoices.grf.

Solution

Use attribute Graph URL to define graph to be run and do not connect an input edge.

AttributeValue
Graph URL${GRAPH_DIR}/ProcessInvoices.cdf

Running several graphs using RunGraph

Run several graphs using RunGraph component.

Solution

Send graph URLs to the RunGraph using input edge. Do not fill in the attribute Graph URL.

Compatibility

4.0

Previous version of CloverETL required to specify Command line arguments if path to graph is set up using Graph URL attribute.

See also

ExecuteGraph
Common Properties of Components
Specific Attribute Types
Others Comparison