Focal Point
Batch JAVA program executing .fex file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1271066872

April 01, 2008, 03:14 PM
Todd
Batch JAVA program executing .fex file
I need to know how to execute a .fex report from a Batch JAVA application (not web). I know this can be done through shell script on Unix, we would like to execute directly from JAVA. Thoughts???


7.1.6.
AIX Unix.
HTML, EXCEL, and PDF output
April 01, 2008, 03:56 PM
jbanas6
try something like this which calls a bat routine which runs a focexec

String cmd = "cmd.exe /C c:\\temp\\test.bat";

Process proc;
proc = Runtime.getRuntime().exec(cmd);

StreamDumper stdin = new StreamDumper proc.getInputStream(), false);
StreamDumper stderr = new StreamDumper(proc.getErrorStream(), true);

stdin.start();
stderr.start();


in the bat you could have a dos call

-DOS CALL TEST


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
April 01, 2008, 04:03 PM
jbanas6
here is another way you could try it

import java.io.*;
import java.util.*;
import java.lang.Object;
import java.net.*;

public class Program
{
public static void main(String s[])
{
System.out.println("Hello this programm defines about how to call a servlet with a java application ");
try{


URL servlet = new URL("http://localhost:8080/ibi_apps/WFSerlvet?IBIF_ex=carinst");
URLConnection conn=servlet.openConnection();
conn.setDoOutput(true);
InputStreamReader isr=new InputStreamReader(conn.getInputStream());
BufferedReader br = new BufferedReader(isr);
String str;
System.out.println("Source code is" ); str=br.readLine();
System.out.println(str);


}
catch(IOException e)
{
System.out.println("exception is" +e);
}

}
}


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
April 02, 2008, 02:42 PM
Todd
Keep in mind this is running on Unix. I need to be able to execute this from a Batch JAVA application and not Web. No interaction with a web Server.


7.1.6.
AIX Unix.
HTML, EXCEL, and PDF output
April 02, 2008, 05:03 PM
Darin Lee
Is there a WF server installed on this sames box where the java batch program runs?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
April 02, 2008, 05:11 PM
Todd
It would be on the same newtork, but most likely not the same server.


7.1.6.
AIX Unix.
HTML, EXCEL, and PDF output
April 16, 2008, 11:00 AM
mtguy
Hello ,
Try to expoze the fex procedure like a webservice and after make a call from java .
The webserices is not platform depending .

Regards,
Val

This message has been edited. Last edited by: mtguy,


WF 7.6.2 , iWay 5.5 , Sun Unix , Windows XP , .NET , Oracle , SQL Server and more
April 16, 2008, 11:29 AM
Darin Lee
It isn't platform dependendent but it IS License dependent. Enabling your procedures as web services requires and additional license.

If there is no interaction with a web server and the java program exists on a separate box from your WF server, you're going to be pretty hard pressed to find a solution.

The main question is, How are you running WebFOCUS without a web server?

The rhetorical answer is there probably IS a webserver in there. You just may not have the info you need to access it or is web/IP access explicitly blocked on this box?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat