Menu

job follow regard pred job end condition ?

Help
Chico
2026-03-18
2026-03-19
  • Chico

    Chico - 2026-03-18

    Hi

    Is it possible in JS7 to make 2 path in case or returne code from a job ?
    to explain

    Job1

    • end in CR 0 > job 2
    • end in CR 1 > job 3
    • end in other CR > prompt

    job 4, only launch if job 2 or job 3 are CR 0, or prompt confirmed.

     

    Last edit: Chico 2026-03-18
  • Andreas

    Andreas - 2026-03-18

    Hi Chico,

    if I get it right, the intended logic is designed like this:

    * job1
        * Case When: return code == 0 then job2
        * Case When: return code == 1 then job3
        * Case Else: prompt
    * job4
    

    Find attached the example of a workflow implementing the above flow (consider adjusting Agent assignments to jobs). For details how to use the example see JS7 - How to upload .json examples (kb.sos-berlin.com)

    Consider the following hints:

    • job1 is configured to ignore return codes (exit codes), see attached screenshot. The job is always considered being completed successfully in order to trigger subsequent jobs.
    • job2 and job3 are triggered if the related Case When Instruction evaluates the condition of job1's exit code successfully, using predicates such as $returnCode == 0.
    • a promt is triggered from the Case Else Instruction for exit codes other than 0 and 1.
    • job4 is executed if the order passes one of the Case When Instructions.



    For releases before 2.8.2, the Case Instruction cannot be used. In this situtation you can use nested If Instructions.

     

    Last edit: Andreas 2026-03-18
  • Chico

    Chico - 2026-03-19

    Alright, i forget to slide this toolbar to sedd what was available >_<

    manage to do what i wanted.
    but case-when should be align side by side, instead of following, would be easier to visually understand, dk if the visual alignment can be changed for this

     

Log in to post a comment.

MongoDB Logo MongoDB