Page 1 of 1

Execute Command Stage return value

Posted: Thu Dec 30, 2010 11:39 pm
by arpitchopra
Hi everyone,

I am facing a very strange problem. Here is my sequence design:


Execute command -----return val 0---------> job1
-----return val 1---------> job2


The command stage executes a unix script which returns 0 if a file is found and 1 if it is not found (using "exit 0" or "exit 1"). The trigger in Command stage reads this returned value and moves to Job1 if it is 0 and Job2 if it is 1.

My requirement in both the cases is is that this master sequence should always finish successfully. However, right now, it finishes with a warning. Whenever the script returns 1, the sequence throws a "Warning" that "Command did not finish OK, reply = 1".

Is there any way to suppress this ?

Posted: Fri Dec 31, 2010 3:23 am
by ray.wurlod
Yes. Create explicit triggers for Warning and Failure. These take precedence.

Posted: Fri Dec 31, 2010 3:46 am
by arpitchopra
How ??

Posted: Fri Dec 31, 2010 3:54 am
by kishore2456
In Triggers tab of execute command stage you can specify your both conditions(success and failure) using different links where you can validate your conditions using the return value

Posted: Fri Dec 31, 2010 3:57 am
by arpitchopra
I'm doing exactly that.
But, in the triggers tab, I use Return Value option. if = 1 then Job1 and if = 0 then Job2.

But still, when the command executes, it gives a warning.

Posted: Fri Dec 31, 2010 4:13 am
by samyamkrishna
In the trigger tab.

Expression type : Custom
Expression : <Execcmdstagename.ReturnValue>=1

Is this what you have given

Posted: Fri Dec 31, 2010 4:35 am
by arpitchopra
Nopes.

Expression Type: Return Value (Conditional)
Expression: = 1



But I have a solution to the problem. Found it on the forum itself. Suppressed that warning by unchecking the "Log warnings after activities that finish with status other than OK"


Thanks for the help guys.