Dependence between independent batch

30 views
Skip to first unread message

Pablo Maldonado

unread,
May 21, 2019, 5:07:50 PM5/21/19
to schedulix
Hello,

I wanted to know if it is possible and like the following:

1 - Define a batch A with a Job A

2 - Define a batch B with a Job B

3 - Define a batch C that calls Batch A and if it ends well follow with Batch B

Thank you


Pablo Maldonado

Ronald Jeninga

unread,
May 22, 2019, 8:11:13 AM5/22/19
to schedulix
Hi Pablo,

the way I understand your question, you'd like to have two batches, A and B, (with some content) that are able to run on themselves.
Further you'd like to have a third batch C that has both A and B as children. B should only run if A terminates with SUCCESS.

And indeed, this is possible.

First of all, A needs to have an exit state profile with a final state that denotes "I_DIDNT_END_WELL" (but I'm not restartable), in addition to the usual SUCCESS state.
If B has the STANDARD exit state profile, you can create a dependency B requires A(SUCCESS).

In order to be able to submit B as a standalone batch, this dependency should have a resolve mode of IGNORE.

The STANDARD exit state profile also contains a state SKIPPED, which is defined as the unreachable state.
If a dependency can't be fulfilled (A has exit state I_DIDNT_END_WELL, which is a final state and won't change ever again), B will acquire exit state SKIPPED without being run.

You can have a look at the E0030_CONDITIONAL example. It basically shows a case-statement.
An if-then-else, or in your case only an if-then, is actually only a simplification of a generic case-statement 

I hope this explanation was understandable.

Best regards,

Ronald

Pablo Maldonado

unread,
May 22, 2019, 1:35:33 PM5/22/19
to schedulix
Hello Ronald

What I want to do is the following:

1 - I have a Batch A with a job (already exists) that runs on a host A.

2 - I have a Batch B with a job (already exists) that runs on a host B.

Now I need to create a Batch C that calls the batch A and then batch B, so I do not see how I can add those batch in the new one that I create, that is to add the batch A and B inside C, I only see the option to create batch but do not add.


Pablo Maldonado
New_Batch.PNG

Ronald Jeninga

unread,
May 23, 2019, 4:53:29 AM5/23/19
to schedulix
Hi Pablo,

first of all, that what I've explained in my previous message is still valid.

If you've created batch C and open it, you can go to the Children Tab.
Being there, you click on the "Hierarchy" button, which is the 8th button from the right (including the greyed out buttons).
Its picture looks a bit like a hierarchy in fact.

Clicking that button will open a new window (or tab, depending on your browser configuration) with a folder tree.
Now you can expand this tree to find your batches A and B.
You check the checkbox in from of them and click on the "copy" button (10th button from the right).
If the window doesn't close by itself, close it manually (this behaviour is a user setting).

Now you're back on the Children Tab of your batch C.
Click on the "paste" button (9th from the right) and click on the "save" button (3rd from the left).

Now the batches A and B are added as children to Batch C.
The only thing left is to create the dependency, which I leave as an exercise.

Best regards,

Ronald

Pablo Maldonado

unread,
May 23, 2019, 10:28:17 AM5/23/19
to schedulix
Hello Ronald

Thank you first of all for the passion and answers.

I already had done that, what I do not know, but I try it is if you copy and paste the batch A and B inside C, if later the batch A changes, inside the C would change automatically or you should repeat the copy and paste process.

Thank you

Pablo Maldonado

Pablo Maldonado

unread,
May 23, 2019, 11:22:14 AM5/23/19
to schedulix
Hello Ronald

I saw that yes, no answer is necessary.

Thank you

Pablo Maldonado

Ronald Jeninga

unread,
May 23, 2019, 11:25:59 AM5/23/19
to schedulix
Hello Pablo,

it's just a reference between C and A, resp C and B.
This means, if A changes in some way, the new definition of A will take effect after the change.

But if you submit C and afterwards change, say, B, the definition of B at submit time of C will be used.
If the C is submitted a second time, this time after the change, the new definition of B is used.

This enables you to change batches that are submitted once per day, but have a run time of more than 24h.
Something that is halfway common in big data / data warehouse environments.

Does this answer your question?

Best regards,

Ronald
Reply all
Reply to author
Forward
0 new messages