Page 1 of 1

Loop Activity- Return status of each loop

Posted: Wed Aug 25, 2010 6:42 am
by Lovesh_Patni
Hi,
I want to capture the user status of same job executed in loop with different parameters.
Here is my scenario

Job Seq:

Start Loop Activity(For loop i=1 to 4) ->Job Activity->End Loop Activity.

I want user status of each job activity run so that I can use it after End loop activity.I want to avoid dumping the user status into file in each loop run and using it later.Can we store the user status into a varialbe, concatenate it every time in loop and use it after End loop.

Thanks

Posted: Wed Aug 25, 2010 6:57 am
by chulett
There's no concept of a globally scoped variable in Sequence jobs you can update while the job runs. You may be able to build another job that takes in your new UserStatus value and appends it to its current UserStatus, thus concatenating them there but I'm not sure a job can query its own UserStatus value. Worth a shot.

That or just go with the 'write it out to a file' solution. :wink:

Posted: Wed Aug 25, 2010 7:14 am
by JRodriguez
This might work:

Start Loop Activity(For loop i=1 to 4) ->Job Activity->UserVariable -->End Loop Activity.

I guess that you want to have two User Variables to keep the previous value of the job status

Posted: Wed Aug 25, 2010 7:18 am
by chulett
Thought about that but honestly don't think you can update values in that stage. Could be wrong, though but have no way to test anything. :?

Posted: Wed Aug 25, 2010 9:40 am
by arunkumarmm
Or instead of setting it as user status, you can write it to a hashed file and look-up the value after your end-loop activity using UtilityLookUpHash.

Posted: Wed Aug 25, 2010 9:25 pm
by Lovesh_Patni
Thanks to all of you for your inputs.
Yes,I think the only way to do is writing into file and then reading it again after End loop activity.

Posted: Wed Aug 25, 2010 9:55 pm
by chulett
If you go that route, make sure you initialize / empty / clear the sequential file before you hit the loop as inside the loop you'll want to append to the file. That or have your mechanism be smart enough to overwrite on the first iteration and append after that.

Posted: Sun Aug 29, 2010 9:37 pm
by Lovesh_Patni
Hi chulett,

Yes,I'm creating a file before the loop begins and using basic statement WriteseqF to insert data into the file created and delete the file at Exit.

Posted: Sun Aug 29, 2010 10:39 pm
by chulett
Ok, that should be good... is it all working for you?