Version

    RunGraph

    RunGraph 64x64

    Short description

    Ports

    Metadata

    RunGraph attributes

    Details

    Examples

    Compatibility

    See also

    Short description

    RunGraph functionality has been superseded by jobflow components ExecuteGraph and ExecuteJobflow. These components are more powerful and together with the jobflow functionality allow for more precise control of job execution.

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

    Same input metadata Sorted inputs Inputs Outputs Each to all outputs[1] Java CTL Auto-propagated metadata

    -

    0-1

    1-2

    -

    1

     Component sends each data record to all connected output ports.

    Ports

    Port type Number Required Description Metadata

    Input

    0

    For graph names and CloverDX command line arguments.

    Output

    0

    For information about a graph execution.

    1

    For information about an unsuccessful graph execution.

    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 fields. The first two metadata fields must be string.

    Table 87. 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 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 be placed after the metadata fields from the template.

    Table 88. 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 (Finished OK, Aborted, or Error)

    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 false, graph(s) run as external processes.

    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 false, this attribute is ignored. For more information, see Details.

    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 -Xmx1g -cp or equivalent according to the maximum memory needed by any of the specified graphs. The -cp suffix is necessary, since the 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

    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 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 the 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 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 true, failures of each executed graph are ignored.

    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 false.

    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 403. 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.

    Use the Ctrl+double-click 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

    6.4

    RunGraph was deprecated. Use ExecuteGraph and ExecuteJobflow instead.