Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a scenario. In One of my Master Job 3 Child Job will run. Now after Each Child Job On SubJobOk in toraclerow an update will run to update status in Database for that Particular Table based upon Maximum(Update_Date). in next tOracleInput I am selecting the status of the Table which ran in the First Child Job and passing to that tjavarow where I am passing that Status Value to a Context. From tjavarow using RunIF condition I am triggering the 2nd ChildJob. Now I am using the RunIF Condition like context.status.equals("Y"). Now I want to do a negetive testing where I want to loop based upon some iteration to check for some time whether Status Value changed to N to Y.My Job Design is like this now
ChildJob1---OnComponentOk---toracleRow(UpdateRunning to change status from N to Y)---OnComponentOk---toracleinput(selecting the status of the table related to ChildJob1)---->tjavarow(Passing the STATUS Value to context)--------RunIF(context value equals "Y")----->ChildJob2
I want to loop now whether the status is still N. It will check whether Status changed to Y or not. Zero Byte file based option can't be taken.
I have did this one with some other approach. What I did was in my tloop component in while I gave loop condition like
i=1(loop will start)
context.status.equals("N")
i++
So untill context.status becomes Y loop will not break.I tested this and was working
Can anyone please help
Yes rhall. I want to keep a looping from tjavarow where I will check for Update Status. For Value N it will be on loop and wait for 10mins and again will go to my toracleinput component where I am selecting status from Audit Table and passing that to next tjavarow in context. If time exceeds (e.g 20mins it will exit the loop and send an email.
There are ways to achieve exactly this using a tLoop and a bit of Java code. However, do you really want to wait 1o minutes in-between checks? A maximum wait time is a good idea, but would it not be better to loop (carry out the checks) every 10 seconds (for example) for 10 mins? Then if after 10 mins there is no change, send the email and end the job?
To do this, you could have a configuration similar to below....
tJava
|
tLoop ------> t{DB}Input ------>tJavaFlex----RunIf---->{The rest of the logic}
1) The tJava would create a globalMap variable (maybe a boolean called "loop") to be used in the tLoop and create a globalMap to hold the start date and time of the tLoop.
2) The tLoop would be set to a While loop. For example ....
((Boolean)globalMap.get("loop"))
3) The DB component would return the status
4) The tJavaFlex would test the status returned AND check the current time against the time variable created in the tJava. If the status is what you want, you can end the tLoop after this iteration by setting "loop" to false. This can also be done if the time limit has expired.
5) Your RunIf can be used to choose to execute further code on this iteration or not.
There is a lot of extra logic you will need to fill in for yourself, but this is the basic flow I would advise you use.
Given what I have shown you the tDBInput component will keep firing the same query for each iteration of the loop. You do not need to do anything special to the tDBInput
I have did this one with some other approach. What I did was in my tloop component in while I gave loop condition like
i=1(loop will start)
context.status.equals("N")
i++
So untill context.status becomes Y loop will not break.I tested this and was working