Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>

<!--
 Copyright (c) 2013 Red Hat, Inc. and/or its affiliates.

 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html

 Contributors:
 Cheng Fang - Initial API and implementation
-->

<job id="flow" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
    <properties>
        <property name="job-prop" value="job-prop"></property>
        <property name="job-prop-2" value="job-prop-2"></property>
    </properties>
    <listeners>
        <listener ref="L1">
            <properties>
                <property name="listener-prop" value="listener-prop"></property>
                <property name="reference-job-prop" value="#{jobProperties['job-prop']}"></property>
                <property name="reference-job-param" value="#{jobParameters['job-param']}"></property>
                <property name="reference-system-property" value="#{systemProperties['java.version']}"></property>
            </properties>
        </listener>
        <listener ref="L2"></listener>
    </listeners>


    <flow id="flow1" next="step4">
        <step id="step1" next="step2">
            <properties>
                <property name="step-prop" value="step-prop"></property>
                <!-- same property name as in job, to test property resolution precedence -->
                <property name="job-prop-2" value="step-prop-2"></property>
            </properties>
            <batchlet ref="batchlet1">
                <properties>
                    <property name="reference-step-prop" value="step-prop"/>
                </properties>
            </batchlet>
        </step>

        <step id="step3">
            <batchlet ref="batchlet1"/>
            <end on="*" exit-status="done"></end>
        </step>

        <step id="step2">
            <batchlet ref="batchlet1"/>
            <stop on="xyzz" exit-status="stopped" restart="false"/>
            <!-- should not reach here -->
            <fail on="abcd" exit-status="failed"/>
            <!-- should not reach here -->
            <end on="12345" exit-status="done"/>
            <!-- should not reach here -->
            <next on="aaa" to="step1"/>
            <!-- should not reach here -->
            <next on="*" to="decision1"></next>
        </step>

        <decision id="decision1" ref="decider1">
            <properties>
                <property name="decision-prop" value="decision-prop"></property>
                <property name="reference-job-prop" value="#{jobProperties['job-prop']}"></property>
                <property name="reference-step-prop" value="#{jobProperties['step-prop']}"></property>
                <property name="reference-system-prop" value="#{systemProperties['java.version']}"></property>
                <property name="reference-job-param" value="#{jobParameters['job-param']}"></property>
            </properties>
            <next on="aaa" to="step1"></next>
            <!-- should not reach here -->
            <next on="next" to="step3"></next>
            <!-- "next" is the value returned from Decider1.decide() -->
            <end on="*" exit-status="done"></end>
        </decision>
    </flow>

    <step id="step4">
        <batchlet ref="batchlet1">
            <properties>
                <property name="batchlet-prop" value="batchlet-prop"></property>
                <property name="reference-job-prop" value="#{jobProperties['job-prop']}"></property>
                <property name="reference-system-prop" value="#{systemProperties['java.version']}"></property>
                <property name="reference-job-param" value="#{jobParameters['job-param']}"></property>
            </properties>
        </batchlet>
    </step>

</job>
New to GrepCode? Check out our FAQ X