Page 1 of 1

Sequence Goes To Exception Handler

Posted: Thu Mar 19, 2009 5:11 am
by bi_fujitsu
Hi

I have a sequence with the following flow.

Routine1 ------>JobA----------->JobB---------->Routine2

Exception_Handler---------->Email------------>Terminator

Routine 1 Returns a value which is something like 20070303#15:45#0 or
20070303#15:45#1. In the Trigger option of the routine i am saying that JobA should get executed only if
Convert(@FM,"",(Field(Routine1.$ReturnValue,"#",3))) = '0'

I can see that my routine is retuning a value of '0' but even then instead of going to Job A it goes to Exception Handler.

The problem seems to me is that the sequence is not able to read that Convert(@FM,"",(Field(Routine1.$ReturnValue,"#",3))) is returning me '0'.

Can you please help me in resolving this issue.

Posted: Thu Mar 19, 2009 5:41 am
by priyadarshikunal
Can you please post the logs of this sequence.

It seems like the return value is causing the problem but will only be clear when you post the logs (better is you post detailed logs)

Posted: Thu Mar 19, 2009 8:28 am
by chulett
Been discussed here many times, routines that do not return a zero are considered to have failed if the 'Automatically handle' option is ticked and you don't have the proper triggers set up from the Routine.

Posted: Thu Mar 19, 2009 11:02 pm
by bi_fujitsu
Hi

I did the following activities to get this working after going through the various posts.
!!!!!!!!Thanks a lot for all your Timely Support in resolving this problem well in time.

When we use Routines in our Sequence and if we are triggering any further Activities then the Return Value of a successful Routine should always be 0. If we are assigining a user defined value to a routine which is used as a parameter value for other Activity Stages in the Sequence then that Routine should be executed from the User Variable Activity Stage and the output of the routine should be assigned to a user defined variable.

If we don't do this then the Exception handler will always treat that routine as a failure if the Return Value is other than 0.

If we are triggering two different set of jobs based on the output value of the Routine then we need to use the Nested Condition Stage after the User Variable Activity Stage and there we can define our condition for executing the jobs.

Posted: Thu Mar 19, 2009 11:14 pm
by chulett
That's certainly one way to solve the problem. Another is to use the technique described in the online help - use two triggers from the routine, typically an OK and an Otherwise, both sent to a Sequencer set to 'Any' before moving on to the next stage in the flow. The code generator notices that you are explicitly handling any 'failures' with these triggers, so the 'automatically handle' option is not triggered.

The key is noting that the error message logged is about an 'unhandled exception'... and the solution is to handle any 'exceptions' of this nature yourself.