COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: bhanu.samas on 13 Jun 2012 01:15:12 PM

Title: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 13 Jun 2012 01:15:12 PM
I am looking to integrate jobs created in Data Manager with Java.
I want to execute a job from java application and vice-versa.

Thanks in advance.

-Bhanu
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: MFGF on 14 Jun 2012 03:49:28 AM
Data Manager jobs can be executed from the command line - if you right-click a job and choose "Execute", you can see/capture the command (just make sure you omit the -P switch which triggers the "press return to continue" pause at the end of the job). You could then get your Java routine to fire off this command.

From within a jobstream, you can use the system() function to call an executable from the command line (from within a procedure node, for example) if your java routine is compiled into an executable you can call, and/or you could add a User Defined Function to call a java function compiled and linked into a dll, then call this function from a procedure node.

Regards,

MF.
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 15 Jun 2012 06:54:09 AM
Thanks MF,
I will try this.

-Bhanu
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 10 Jul 2012 12:37:27 PM
Hi MF,
I tried to use procedure node. But it wasnt running. Could you please suggest how to call a .bat file using system() in procedure node.

Thanks,
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: MFGF on 11 Jul 2012 04:19:08 AM
Hi,

System('"C:\Cognos Demos\DataManager\Test.bat"');

This worked fine for me.

Regards,

MF.
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 11 Jul 2012 08:54:21 AM
Thanks MF,
Its working now. I didnt use double quotes ('c:/.../google.bat'). Thats why it was not running.

Thanks,
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 11 Jul 2012 03:18:55 PM
Hi MF,
Could you please suggest how to open a URL when the job runs on a server (Linux). I mean job has to open a URL whenever it runs. In windows I created batch file and then I called this batch file by using procedure node. How about in Linux?

Thanks,
Title: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: MFGF on 11 Jul 2012 05:01:54 PM
Could you create a shell script in unix to do it, then call it in the same way as your windows batch file?

MF.

Sent from my iPad using Tapatalk HD
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 12 Jul 2012 01:59:30 PM
Thanks MF,
I tried the following code but I am getting error. Could you please help me?

GOOGLE.SH
#!/bin/bash
$ xdg-open http://www.google.com

Thanks,
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: eknight on 13 Jul 2012 03:08:07 AM
Why are you using xdg-open? What are you trying to do exactly?
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 13 Jul 2012 07:58:48 AM
My requirement is to open an URL once after executing a job in Data Manager.

Thanks,
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 13 Jul 2012 08:18:19 AM
Hi MF,
While I tried to execute that script it was saying "$ command not found".

Thanks,
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: eknight on 16 Jul 2012 03:22:50 AM
Quote from: bhanu.samas on 13 Jul 2012 07:58:48 AM
My requirement is to open an URL once after executing a job in Data Manager.

Do you mean you want to launch a browser window? Or do you just want to pass some variables to a webserver via HTTP GET or something?

If you want to read something from a website you could use the wget command.
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: bhanu.samas on 16 Jul 2012 08:20:09 AM
I want to launch a browser window. Suppose lets say browser has to open and load with http://www.google.com. And I am using following script. But while I execute on server it was throwing error.

#!/bin/bash
$ open http://www.google.com

Could you please guide me.
Title: Re: How to integrate jobs created in cognos datamanger with JAVA or vice-versa?
Post by: eknight on 17 Jul 2012 10:28:00 AM
This should let you launch firefox from the command line, just pass this into your System() call:

/usr/bin/firefox www.google.com &