Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a main job and a sub job, I wanted to add some more filtering to ensure that the data I am using is accurate.
So i enhanced my job to do a db check before we execute the subjob, for example I connect to the database and execute a query, one column in db would essentially have the value '-1' if data has been fully published to this table.
I am having some issues and it isn't working the way I am expecting, so would like some input.
In this case after connecting to the db an outputing the values I go to a tfilter, ensuring that the value is -1, my query will return the following:
-1
nothing
I have switched the rejected/filtered output to see if it would make it work. Ideally if the value does not exist i want to use T-die to kill the whole script, making sure the subjob which i call later doesn't get invoked.
How could I go about implementing this correctly?
Hi JayZ1,
Here is how I would do :
Setup a tDBInput component that get the value you need to check if your DB has been updated
In my case I used a query that give me the value "62" (only one row)
then setup a tJavaRow that assign your query value to a context variable (in this example : "test")
Don't forget to create the context variable "test" (or whatever you want to call it) in the Context window.
Then setup the "Run If" trigger between the tJavaRow and the tDie component using the equals() function on your context variable :
In my example, if the query return 62, the tDie kills the job, when it returns something else the job doesn't get killed.
Hi Thank you this seems like a good possible solution. For some reason for me the IF trigger is executing as false still. Let me provide some screenshots:
originally I just had this empty, I tried changing it to equal 0 so it would get re-assigned either way it wasn't working
Here is the tlog output I was validating USR_ID = -1
Thanks for the help!
Hi JayZ1,
Here is how I would do :
Setup a tDBInput component that get the value you need to check if your DB has been updated
In my case I used a query that give me the value "62" (only one row)
then setup a tJavaRow that assign your query value to a context variable (in this example : "test")
Don't forget to create the context variable "test" (or whatever you want to call it) in the Context window.
Then setup the "Run If" trigger between the tJavaRow and the tDie component using the equals() function on your context variable :
In my example, if the query return 62, the tDie kills the job, when it returns something else the job doesn't get killed.
Hi Thank you this seems like a good possible solution. For some reason for me the IF trigger is executing as false still. Let me provide some screenshots:
originally I just had this empty, I tried changing it to equal 0 so it would get re-assigned either way it wasn't working
Here is the tlog output I was validating USR_ID = -1
Thanks for the help!
You need to put your context.DatabaseCheck as String/Varchar and the value you get from your database as String/Varchar also
Make sure everything is set as varchar for this to work.
Right now you're trying to compare -1 (int) and "-1" varchar which doesn't work in java
Keep me updated if this still doesn't work