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

 

How to integrate jobs created in cognos datamanger with JAVA or vice-versa?

Started by bhanu.samas, 13 Jun 2012 01:15:12 PM

Previous topic - Next topic

bhanu.samas

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

MFGF

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.
Meep!


bhanu.samas

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,

MFGF

Hi,

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

This worked fine for me.

Regards,

MF.
Meep!

bhanu.samas

Thanks MF,
Its working now. I didnt use double quotes ('c:/.../google.bat'). Thats why it was not running.

Thanks,

bhanu.samas

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,

MFGF

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
Meep!

bhanu.samas

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,

eknight

Why are you using xdg-open? What are you trying to do exactly?

bhanu.samas

My requirement is to open an URL once after executing a job in Data Manager.

Thanks,

bhanu.samas

Hi MF,
While I tried to execute that script it was saying "$ command not found".

Thanks,

eknight

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.

bhanu.samas

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.

eknight

This should let you launch firefox from the command line, just pass this into your System() call:

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