Page 1 of 1

Routine in trigger

Posted: Thu Jun 23, 2011 6:02 am
by samyamkrishna
Hi,

Is there any way we can use a routine in a trigger.

Without geting the routine is not dimensioned.

I went through a lot of posts regarding this but only found out that it cannot be done.


Regards,
Samyam

Posted: Thu Jun 23, 2011 6:50 am
by chulett
I'm assuming you meant in a Sequence job so off we go to the General forum. And are we talking about a custom / user-defined routine or something else?

Posted: Thu Jun 23, 2011 7:08 am
by samyamkrishna
Yes it is a user defined routine with

JobHandle=DSAttachJob(JobName,DSJ.ERRWARN)
status=DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
Ans=status
inside it.

i want to use this routine on the trigger to decide the flow of teh sequence.

As of now i am using a routine activity.It is working fine.
but when i use the routine in a trigger then i get not dimensioned error.

Is there anything i can do to use the routine in the trigger.

Posted: Thu Jun 23, 2011 7:12 am
by chulett
No. Do what you are doing, using the proper stage and then (I assume) checking the results in any downstream triggers. Make sure you are detaching from the jobs you are checking!

Question - were these jobs run by the current Sequence? I assume not, but wanted to ask and make sure the "why" of what you are doing.

Posted: Thu Jun 23, 2011 7:20 am
by samyamkrishna
yes these jobs were run by the current sequence.
a execute command activity is triggering a dsjob command.

in which the job name is a parameter.

dsjob -run -wait PRJ #jobname#

and based on teh status we have to trigger the flow of activities.

Now we have two options
1.we can use the retun of the dsjob command
this works fine as long as the job runs for below the timeout set in the admin.
but if it crosses the time out value say 3600 sec.
then even if teh job complets the return value is 141 which is wrong

2. I got the routine working but i cannot use it in teh trigger.


Regards,
Samyam

Posted: Thu Jun 23, 2011 7:50 am
by chulett
So, in that case, using a Routine Activity stage is the proper answer here.

Posted: Thu Jun 23, 2011 7:50 am
by samyamkrishna
Thanks craig.