Announcement Announcement Module
Collapse
No announcement yet.
Control Flow on First Step Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Control Flow on First Step

    I have a job that can have 2 steps, and depending on arguments and how the job gets invoked, I may not want both steps to run. Sometimes I would like to perform step1 first, then step2, but other times I only want to perform step 2. Is there any way, aside from creating a pre-step that makes a decision on those arguments? I can interrogate the parms in the reader itself and just "return null", but I'd like to keep job flow logic out of the job.

  • #2
    Right now I am simply exiting the first step if a certain parameter is not set. It seems like there should be a better way to do this.

    Comment


    • #3
      I would use a decision to start the job. That decision would interrogate the parameters passed in and either send the user to step 1 or step 2 as required. This allows your steps to be decoupled of that flow (as they should be).

      Comment


      • #4
        Thanks for you help.

        Comment


        • #5
          So, can you actually start the job with a decision? It looks like I'd have to create a fake step or something on which the decision would act.

          Comment


          • #6
            The following is allowed:

            Code:
            	<job id="deciderFirstJob">
            		<decision decider="myDecider" id="decider1">
            			<next on="*" to="step1"/>
            			<next on="OTHER" to="step2"/>
            			<fail on="ERROR"/>
            		</decision>
            		<step id="step1" parent="formatFileStep"/>
            		<step id="step2" parent="formatFileStep"/>
            	</job>

            Comment


            • #7
              It works, thanks.

              Comment

              Working...
              X