﻿<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="../scheduler.xsl" type="text/xsl"?>
<!--$Id$-->

<xml_element name     = "job_chain_node"
             title    = "Job Chain Nodes"
             category = "Configuration"
             base_dir = "../"
             parent_page = "../konfiguration.xml"
             author   = "$Author: jz $"
             date     = "$Date: 2012-06-12 21:25:54 +0200 (Di, 12 Jun 2012) $">

         <!--title    = "Jobkettenknoten"-->

    <scheduler_keyword keyword="Job Chain Nodes"/>
    <scheduler_keyword keyword="Jobkettenknoten"/>-->

    <xml_parent_elements>
        <xml_parent_element name="job_chain"/>
    </xml_parent_elements>

    <xml_attributes>
        <xml_attribute name="state" type="string">
            <description>
                <p>
                    The state valid for a job chain node.
                <!--Zustand, für den dieser Jobkettenknoten gilt.-->
                </p>
            </description>
        </xml_attribute>

        <xml_attribute name="job" type="job_name">
            <description>
                <p>
                    The name of the job to be called when an order reaches the state specified.
                <!--Job, der aufgerufen werden soll, wenn ein Auftrag den Zustand erreicht.-->
                </p>
                <p>
                    This attribute should not be specified for the end state.
                <!--Wenn der Zustand einen Endzustand ist, dann geben Sie dieses Attribut nicht an.-->
                </p>
            </description>


            <example>
                <pre>&lt;job_chain_node state="1" job="my_job"/></pre>
                <pre>&lt;job_chain_node state="2" job="../job_in_parent_folder"/></pre>
            </example>
        </xml_attribute>


        <xml_attribute name="next_state" type="string">
            <description>
                <p>
                    An order is given the next state when the <scheduler_method class="Job_impl" method="spooler_process"/> 
                    returns <code>return true</code> for the order.
                <!--<scheduler_method class="Job_impl" method="spooler_process"/> des Jobs mit <code>return true</code> 
                    versetzt einen Auftrag in diesen Folgezustand.-->
                </p>
                <p>
                    The default setting is the <code>state=</code> attribute of the following <code>&lt;job_chain_node></code>.
                <!--Voreingestellt ist der Wert des Attributes <code>state=</code> des folgenden <code>&lt;job_chain_node></code>.-->
                </p>
            </description>
        </xml_attribute>


        <xml_attribute name="error_state" type="string">
            <description>
                <p>
                    When <code>return false</code> is returned by a job's
                    <scheduler_method class="Job_impl" method="spooler_process"/> method,
                    then the order state is changed to error.
                <!--<scheduler_method class="Job_impl" method="spooler_process"/> des Jobs mit <code>return false</code> 
                    versetzt einen Auftrag in diesen Fehlerzustand.-->
                </p>
            </description>
        </xml_attribute>


        <xml_attribute name="delay" type="seconds" initial="0">
            <description>
                <p>
                    Delays an order before handing it over to a job.
                <!--Verzögert den Auftrag vor Übergabe an den Job.-->
                </p>
            </description>
        </xml_attribute>

        <xml_attribute name="on_error" type="suspend|setback">
            <description>
                <p>
                    After an order processing step, 
                    which the order designates as containing an error,
                    the JobScheduler normally allocates the order the <code>error_state</code> state.
                    The <code>on_error</code> attribute can, however, be used to define another behaviour.
                <!--Nach einem Auftragsschritt, der den Auftrag als fehlerhaft gekennzeichnet hat,
                    versetzt der JobScheduler den Auftrag in den Fehlerzustand <code>error_state</code>.
                    Das kann mit diesem Attribut geändert werden.-->
                </p>
                <p>
                    <code>on_error="suspend"</code> has the same effect as 
                    <scheduler_method class="Order" property="suspended"/><code>=true</code>: 
                    the JobScheduler leaves the order in its current state, however,
                    the next processing step is not carried out and the order is suspended.
                <!--<code>on_error="suspend"</code> wirkt wie 
                    <scheduler_method class="Order" property="suspended"/><code>=true</code>: 
                    Der JobScheduler belässt den Auftrag in seinem Zustand,
                    er bleibt also vor dem Job stehen und wird suspendiert.-->
                </p>
                <p>
                    <code>on_error="setback"</code> has the same effect as 
                    <scheduler_method class="Order" method="setback"/>:
                    the JobScheduler leaves the order in its current state,
                    the next processing step is not carried out and the order is treated in the same way as 
                    <scheduler_element name="delay_order_after_setback"/>.
                <!--<code>on_error="setback"</code> wirkt wie <scheduler_method class="Order" method="setback"/>:
                    Der JobScheduler belässt den Auftrag in seinem Zustand,
                    er bleibt also vor dem Job stehen,
                    so wie es im Job mit <scheduler_element name="delay_order_after_setback"/> eingestellt ist.-->
                </p>
            </description>
        </xml_attribute>

    </xml_attributes>



    <description>
        <p>
            Adds a new job chain node to a job chain (see the <scheduler_method class="Job_chain_node"/> class).
        <!--Fügt einer Jobkette einen neuen Jobkettenknoten hinzu (siehe Klasse <scheduler_method class="Job_chain_node"/>).-->
        </p>
        
        <p>
            The XML elements
        <!--Die XML-Elemente-->
        </p>

        <pre>&lt;job_chain_node state="STATE"       job="JOB" next_state="NEXT_STATE" error_state="ERROR_STATE"/>
&lt;job_chain_node state="ERROR_STATE" /></pre> 

        <p>
            correspond to the following API calls
        <!--entsprechen den API-Aufrufen-->
        </p>
        
        <pre>job_chain.add_job( "JOB", "STATE", "NEXT_STATE", "ERROR_STATE" );
job_chain.add_end_state( "ERROR_STATE" );</pre> 
        
        <p>
            See <scheduler_method class="Job_chain_node"/>, 
            <scheduler_method class="Job_chain" method="add_job"/> 
            and <scheduler_method class="Job_chain" method="add_end_state"/>.
        <!--Siehe <scheduler_method class="Job_chain_node"/>, 
            <scheduler_method class="Job_chain" method="add_job"/> 
            und <scheduler_method class="Job_chain" method="add_end_state"/>.-->
        </p>
    </description>
    
    <xml_child_elements>
        <xml_child_element name="on_return_codes"/>
    </xml_child_elements>
    
</xml_element>
