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