Version

    ExecuteGraph

    Jobflow Component

    Short Description
    Ports
    Metadata
    ExecuteGraph Attributes
    Details
    Examples
    Best Practices
    Compatibility
    See also

    Short Description

    ExecuteGraph runs graphs with user-specified settings and provides execution results and tracking details to output ports.

    [Note]Note

    To be able to use this component, you need a separate jobflow license. Also, the component requires your project to be executed on CloverDX Server.

    ComponentSame input metadataSorted inputsInputsOutputsEach to all outputsJavaCTLAuto-propagated metadata
    ExecuteGraph
    no
    no
    0-10-2
    yes
    no
    yes
    yes

    Ports

    Port typeNumberRequiredDescriptionMetadata
    Input0
    no
    Input tokens with graph execution settings.Any
    Output0
    no
    Execution information for successful graphs.Any
    1
    no
    Execution information for unsuccessful graphs.Any

    The component can have a single input port and two output ports attached.

    Metadata

    ExecuteGraph does not propagate metadata from left to right or from right to left. It propagates metadata of its templates.

    This component has metadata templates on all its ports. The templates are described in Details. See details on metadata templates.

    ExecuteGraph Attributes

    AttributeReqDescriptionPossible values
    Basic
    Graph URLyes

    A path to an executed graph. Only a single graph can be specified in this attribute. The value can be overridden by a value from input token, see the Input mapping attribute. The graph referenced by this attribute is also used for all mapping dialogs - they display dictionary entries and tracking information based on this graph.

     
    Execution typeno

    Specifies a type of execution - synchronous (sequential) or asynchronous (parallel) execution model. Can be overridden by a value from input token, see the Input mapping attribute. See Execution type.

    synchronous (default) | asynchronous
    Timeout (ms)no

    The maximal amount of time dedicated for a graph run; by default in milliseconds, but other time units may be used. If the timeout interval elapses, the graph is aborted. The value can be overridden by a value from an input token, see the Input mapping attribute.

    The Timeout attribute is ignored for asynchronous execution type. Use the MonitorGraph component to watch the running graph.

    0 (unlimited) | positive number
    Input mappingno

    Input mapping defines how data from an incoming token overrides default execution settings. See Input mapping.

    CTL transformation
    Output mappingno

    Output mapping maps results of successful graphs to the first output port. See Output mapping.

    CTL transformation
    Error mappingno

    Error mapping maps results of unsuccessful graphs to the second output port. See Error mapping.

    CTL transformation
    Redirect error outputno

    By default, results of failed graphs are sent to the second output port (error port). If this switch is set to true, results of unsuccessful graphs are sent to the first output port in the same way as successful graphs.

    false (default) | true
    Advanced
    Auto-propagate graph parametersno

    Passes parameter values to executed graph (subgraph) without explicit mapping.

    If a parameter exists in both jobflow and executed graph and if the parameter is public in the executed graph, the parameter value is passed to the executed graph.

    No (default) | yes
    Execution groupno

    The name of an execution group to which the executed graph belongs. An execution group can be used by KillGraph component as a named handler for a set of graphs to be interrupted.

    string
    Execution labelnoA text displayed in an execution view before a graph name.E.g. MyLabel
    Cluster node IDnoA Cluster node ID which will be used for execution of a graph.string
    Execute graph as daemonno

    By default, all graphs are executed in non-daemon mode, so none of them can live longer than the parent graph. CloverDX Server automatically ensures for finished jobs that all non-daemon graphs are interrupted if they have not finished yet. If you want to start a graph which can live longer than the parent graph, set this switch to true.

    false (default) | true
    Skip checkConfigno

    By default, the pre-execution configuration check of the graph is performed only if the check was performed on the parent job. This attribute can explicitly enable or disable the check.

    boolean (default is inherited from parent job)
    Stop processing on failno

    By default, any failed graph causes the component to stop executing other graphs; information about skipped tokens is sent to the error output port. This behavior can be turned off by this attribute. Note: this function works only if an edge is connected to the component's error port.

    true (default) | false
    Number of executorsno

    By default, graphs executed in synchronous mode are triggered one after the other - the next graph is executed right after the previous one finishes. This option allows to increment the number of simultaneously running graphs. The Number of executors attribute defines how many graphs can be executed at once. All of them are monitored and once one of the running graphs finishes processing, another one is executed. This option is applied only to graphs executed in a synchronous mode.

    positive number (1 is default)
    LocalenoThe default Locale of the executed graph.locale ID, see List of all Locale
    Time zonenoThe default Time Zone of the executed graph.time zone ID, e.g. America/New_York

    Details

    Execution type
    Input mapping
    Output mapping
    Error mapping

    The ExecuteGraph component runs a graph with specific settings, waits for the graph to finish and monitors the graph results and tracking information.

    The .sgrf files can be run by the ExecuteGraph component as well as CloverDX graphs.

    Execution Flow in Details

    The component reads an input token, executes a graph based on incoming data values, waits for the graph to finish and sends results to a corresponding port. Results of a successful graph are sent to the first output port. Results of a failed graph are sent to the second output port (error port).

    If the graph run was successful, the component continues with processing of the next input tokens. Otherwise, the component stops executing other graphs, and from that moment on, all incoming tokens are ignored and information about ignored tokens is sent to the error output port. The behavior related to processing after the first graph failure can be changed via the Stop processing on fail attribute. If you set Stop processing on fail to false, the following graphs are executed.

    Connected and Disconnected Ports

    In case no input port is attached, only one graph is executed with default settings specified in the component's attributes.

    In case the first output port is not connected, the component just prints out the graph results to the log.

    In case the second output port (error port) is not attached, the first failed graph causes interruption of the parent job. If you use Redirect error output, the disconnected error port does not cause interruption of the parent job.

    Component Configuration

    For a graph execution, it is necessary to specify a graph location. Optionally, you can set up an execution type, initial values of graph parameters and dictionary content, timeout, execution group and several other attributes.

    Most of the execution settings can be specified on the component via component attributes described bellow. These settings could be considered as a default execution settings.

    The default execution settings can be changed dynamically and individually for each graph execution based on the data from the incoming token. The Input mapping attribute is the place where this override is defined.

    [Tip]Tip

    Right-click the component and click Open Graph to access the graph that is executed. Similarly, in the ExecuteJobflow and ExecuteProfilerJob components, there are the Open Jobflow and Open Profiler Job options.

    Execution type

    The component supports synchronous (sequential) and asynchronous (parallel) graph execution.

    • synchronous execution mode (default) - the component blocks until the graph has finished processing, so graphs are monitored by this component until the end of run.

    • asynchronous execution mode - the component starts a graph and immediately sends the status information to the output. Graphs are only started by this component, the MonitorGraph component should be used for monitoring asynchronously executed graphs.

      If the jobflow that executes the graph finishes earlier than the executed graph, the graph is killed. To avoid killing the graph, set Execute graph as daemon to true.

    Input mapping

    The Input mapping attribute allows to override the settings of the component based on the data from the incoming token. Moreover, initial dictionary content and graph parameters of an executed graph can be changed in Input mapping.

    Input mapping is a regular CTL transformation which is executed before each graph execution. An input token, if any, is only input for this mapping. The transformation's outputs consist of three records: RunConfig, JobParameters and Dictionary.

    • The RunConfig record represents execution settings. If a field of the record is not populated by this mapping, a default value from the respective attribute of the component is used instead.

      Field NameTypeDescription
      jobURLstringOverrides the component attribute Graph URL.
      executionTypestringOverrides the component attribute Execution type.
      timeoutlongOverrides the component attribute Timeout.
      executionGroupstringOverrides the component attribute Execution group.
      executionLabelstringOverrides the component attribute Execution label.
      clusterNodeIdstringOverrides the component attribute Cluster node ID.
      daemonbooleanOverrides the component attribute Execute graph as daemon.
      skipCheckConfigbooleanOverrides the component attribute Skip checkConfig.
      localestringOverrides the component attribute Locale.
      timeZonestringOverrides the component attribute Time zone.
      jobParametersmap[string, string]

      Graph parameters passed to the executed graph. Primary way of the definition of graph parameters is direct mapping to JobParameters record available in Input mapping dialog, where you can easily populate prepared graph parameters extracted from executed graph.

      Graph parameters defined via this map have the highest priority. This map can be used in case the set of graph parameters is not available in design time of jobflow.

    • The JobParameters record represents all internal and external graph parameters of a triggered graph.

    • The Dictionary record represents input dictionary entries of a triggered graph.

    [Note]Note

    JobParameters and Dictionary records are available in the transform dialog only if the component attribute Graph URL links to an existing graph which is used as a template for extraction of graph parameters and a dictionary structure. Only graph parameters and input dictionary entries from this graph can be populated by input mapping, no matter which graph will be actually executed in a runtime.

    Output mapping

    Output mapping is a regular CTL transformation which is used to populate a token passed to the first output port. The mapping is executed for successful graphs. Up to four input data records are available for this mapping.

    If the output mapping is empty, fields of RunStatus record are mapped to output by name.

    • The input token configuring the graph execution. This record is not available for a component without an input connector. This record has Port 0 displayed in the Type column.

      This is very helpful for passing through some fields from input token to output token.

    • RunStatus record provides information about graph execution.

      Field NameTypeDescription
      runIdlong

      A unique identifier of a graph run. In the case of an asynchronous execution type, the value can be used for graph monitoring or interruption.

      orignalJobURLstringThe path to an executed graph.
      startTimelongTime of graph execution.
      endTimelongTime of graph finish, or null for asynchronous execution.
      durationlongGraph execution time in milliseconds.
      executionGroupstringThe name of execution group to which the executed graph belongs.
      statusstring The final graph execution status (FINISHED_OK | ERROR | ABORTED | TIMEOUT | RUNNING for asynchronous execution).
      errExceptionstringCause exception for failed graphs only.
      errMessagestringAn error message for failed graphs only.
      errComponentstringThe ID of the component which caused graph fail.
      errComponentTypestringThe type of the component which caused graph fail.
    • The dictionary record provides content of output dictionary entries of the graph. This record is available for the mapping only if the Graph URL attribute refers to a graph instance which has an output dictionary entry.

    • The tracking record provides tracking information usually available only in the JMX interface of the running graph. This record is available for the mapping only if the Graph URL attribute refers to a graph instance.

      • Tracking fields available for a whole graph:

        Field NameTypeDescription
        startTimelongTime of graph execution.
        endTimelongTime of the graph finish or null for the running graph.
        executionTimelongGraph execution time in milliseconds.
        graphNamestringThe name of an executed graph.
        resultstringThe graph execution status (FINISHED_OK | ERROR | ABORTED | TIMEOUT | RUNNING).
        runningPhaseintegerAn index of a running phase or null if the graph is already finished.
      • Tracking fields available for a graph phase:

        Field NameTypeDescription
        startTimedateTime of phase execution.
        endTimedateTime of the phase finish or null for running phase.
        executionTimelongPhase execution time in milliseconds.
        memoryUtilizationlongA graph memory footprint (in bytes).
        resultstringPhase execution status (FINISHED_OK | ERROR | ABORTED | RUNNING).
      • Tracking fields available for a component:

        Field NameTypeDescription
        namestringThe name of the component.
        usageCPUnumber

        Actual CPU time used by the component expressed by a number from an interval (0, 1) (0 means 0% of CPU is used by the component, 1 means 100% of CPU is used by the component).

        usageUsernumber

        Actual CPU time used by the component in a user mode expressed by a number from an interval (0, 1) (0 means 0% of CPU is used by the component, 1 means 100% of CPU is used by the component).

        peakUsageCPUnumber

        Maximal CPU time used by the component expressed by a number from an interval (0, 1) (0 means 0% of CPU is used by the component, 1 means 100% of CPU is used by the component).

        peakUsageUsernumber

        Maximal CPU time used by the component in user mode expressed by a number from an interval (0, 1) (0 means 0% of CPU is used by the component, 1 means 100% of CPU is used by the component).

        totalCPUTimelongThe number of milliseconds of CPU time used by this component.
        totalUserTimelongThe number of milliseconds of CPU time in the user mode used by this component.
        resultstringThe component execution status (FINISHED_OK | ERROR | ABORTED | RUNNING).
      • Tracking fields available for an input or output port:

        Field NameTypeDescription
        byteFlowintegerThe number of bytes passed through this port per seconds.
        bytePeakintegerThe maximal byteFlow registered on this port.
        totalByteslongThe number of bytes passed through this port.
        recordFlowintegerThe number of records passed through this port per second.
        recordPeakintegerThe maximal recordFlow registered on this port.
        totalRecordslongThe total number of records passed through this port.
        waitingRecordsintegerThe number of records cached on the edge connected to the port.
        averageWaitingRecordsintegerThe average number of records cached on the edge connected to the port.
        usedMemoryintegerThe memory footprint (in bytes) of the attached edge.

    Error mapping

    Error mapping is a regular CTL transformation. The fields are the same as in Output mapping.

    Error mapping is used only if the graph finished unsuccessfully and the second output port is populated instead of the first one.

    If Error mapping is empty, fields of the RunStatus record are mapped to output by name.

    Examples

    Executing graph

    This example shows the basic usage of ExecuteGraph component.

    Execute the graph invoice-processing.grf.

    Solution
    AttributeValue
    Graph URL${GRAPH_DIR}/invoice-processing.grf

    Best Practices

    [Tip]Tip

    If you drag a *.grf file and drop it into the jobflow pane, you will add the ExecuteGraph component.

    Compatibility

    VersionCompatibility Notice
    4.0.0-M2You can now set up the Execution label attribute.
    4.1.0

    You can now auto-propagate graph parameters.

    Empty output mapping and error mapping work as mapping fields by name:

    $out.0.* = $in.0.*; $out.0.* = $in.1.*;