If you are unable to create a new account, please email support@bspsoftware.com

 

Check for tigger file to run another job stream.[CLOSED]

Started by Srik, 04 Apr 2007 01:07:45 PM

Previous topic - Next topic

Srik

Hi.

Can any help me out how to resolve this issue. I have two job streams( 1 & 2)  scheduled separately in windows schedule.

they are separate because they are two different catalogs.

My requirement :

Job 2 should not start until Job 1 is complete.

Is they a way that Job 2 check for flag. if flag is true start job 2 else check after 10 Min's if flag is true.

Thanks in advance
Kanth





MFGF

Hi Kanth,

Yes - you can do this, or alternatively you could call the command to launch Job 2 as the last step of Job 1.

The two techniques would be as follows:

1. Use a SQL node at the end of Job 1 to update a row in a database or a field in a text file to set a flag.  In Job 2, check for the flag being set using a condition node, and if false, loop around and try again.

2. Use a procedure node as the last step in Job 1.  The procedure node would use the System() function to launch the command to fire off Job 2 from the other catalog.

Personally, I'd go with option 2, as it seems to be a more elegant and efficient solution.

Best regards,

MF.
Meep!

Srik

Thanks for solution.

How to implement option 2.

Can u please tell me step by step process.

Thanks,
Kanth

MFGF

Hi Kanth.

1. Open up the catalog containing Job 2, right-click Job 2, and use the Execute option.  This will open up an Execute dialog window, and near the bottom you will see the command line used to execute the jobstream.  Select and copy the command line to the clipboard, then cancel the execute dialog.

2. Open up the catalog containing Job 1, select the Job 1 jobstream, and insert a Procedure Node.  Give it a name, then go to the Action tab and for the command, start by bringing in the System function, then enter two single quotes inside the brackets of the function, then paste the command from the clipboard between the single quotes.  The resultant function call should conform to the following:  System('<your other jobstream command>').  Make sure you remove the pause (-P) switch from the command line too!

3. Link this procedure node into the jobstream so it is the last step the jobstream performs.

4. Save the catalog, and you're done.

Hope that helps.

MF.
Meep!

Srik

Thanks for your info.It is not work for me.

It is throwing error message Unable to find path "c:\program files\.."

I'm looking for some thing like this method.

step 1:
when job 1 completed it should update flag in "process flag"  table with  'Y' .

Step 2:
Job 2 should check for the flag if flag =' Y' then execute builds , else check for flag after 10 mins.

I want to know how to accomplish step 2.(how to write producer for this process)

Thanks.
Kanth.

MFGF

Hi,

You can make this work by making the following change:

Where you command currently begins

System('"c:\program files\cognos\c8\bin\rundsjob.exe" ...

Change it to be

System('c:\"program files"\cognos\c8\bin\rundsjob.exe ...

Best regards,

MF.
Meep!

Srik

Thanks its working.

But I need it in other way which i mentioned.

Thanks,
Kanth.

MFGF

OK - it's not as efficient, but here's how you could code it:

1. In Job 1, add a SQL node.  Set the Database setting to be the data source pointing to the database with the process flag table in it, and add the following syntax:

UPDATE "process flag" SET "flag" = 'Y';

Link this SQL node into your jobstream as the last node to be executed.

2. In Job 2, add a condition node, and on the Action tab, add the following syntax:

Lookup('<connection name>','SELECT "flag" FROM "process flag"') = 'Y'

where <connection name> is the name of your data source pointing to the database with the process flag table in it.

3. Also in job 2, add a procedure node with the following syntax:

Delay(600)

This will introduce a 10-minute pause.

Lastly, link the True leg of the condition node to the start of the existing jobstream flow. Link the False leg of the condition node to the procedure node, and link the procedure node back to the condition node.

Hope that helps,

MF.
Meep!

Srik


hidayahlasim

Hi MF,

The solution given is to run another jobstream..How about killing another jobstream?? Do you have any idea how??

MFGF

I guess it would be possible - each jobstream runs as a process, and in theory, you could look for the process ID and use an OS command to kill it from within a system() function. I would imagine it will be far easier to get the current jobstream to set a value in a table or file and put tests into the other jobstream to check for the existence of the value, then abort if found.

Regards,

MF.
Meep!