autosys job configuration for job failure.

We need to configure autosys that when a job fails continously for 3 times, we need to call another job.
Is this possible in Autosys, or can anyone advice on the alternative.

Try:

JOB_1a REP 1
|
DONE
|
JOB_1b ( REP 2, same command different name )
|
DONE
|
JOB_1c (REP 3,same command different name )
|
DONE
|
JOB_2 ( if all fails )

If SUCCESS cond. you must break the flow

can u make it little clear, I am a java resource, new to unix.
Can you tell me , how to count on number of time the job has failed using a shell script.