Calling ODI scenario fom java program

Hi,
i have my ODI scenario. But i need to execute that scenario from a java code n pass variables as well. can any one plz guide me how to do it

Hi,
In 11g we have a folder oracle.sdk in our ODI home. So from there pick up the following jars and paste in ur java classpath:
1)     bsf.jar
2)     bsh-2.0b2.jar
3)     commons-collections-3.2.jar
4)     eclipselink.jar
5)     odi-core.jar
6)     ojdl.jar
7)     oracle.ucp_11.1.0.jar
8)     persistence.jar
9)     spring-beans.jar
10)     spring-core.jar
11)     spring-dao.jar
12)     spring-jdbc.jar
After that this was the code. Edit as per ur requirements.
package oracle.odi.publicapi.samples.agent;
import oracle.odi.core.OdiInstance;
import oracle.odi.core.config.MasterRepositoryDbInfo;
import oracle.odi.core.config.OdiInstanceConfig;
import oracle.odi.core.config.WorkRepositoryDbInfo;
import oracle.odi.core.security.Authentication;
import oracle.odi.runtime.agent.invocation.ExecutionInfo;
import oracle.odi.runtime.agent.invocation.InvocationException;
import oracle.odi.runtime.agent.invocation.RemoteRuntimeAgentInvoker;
* This sample starts a scenario in a remote agent.
public class OdiStartScenInvocation
public static void main(String[] args)
try
// Starting the session on the remote agent.
RemoteRuntimeAgentInvoker remoteRuntimeAgentInvoker = new RemoteRuntimeAgentInvoker("http://localhost:20910/oraclediagent", "MyOdiUser", "MyOdiPassword".toCharArray());
ExecutionInfo exeInfo = remoteRuntimeAgentInvoker.invokeStartScenario("MYSCENARIO", "001", null, null, "GLOBAL", 5, null, true, "WORKREP");
// Retrieve the session ID.
System.out.println("scenario started in session : " + exeInfo.getSessionId()); //$NON-NLS-1$
catch (InvocationException e)
System.err.println("Agent NACK received for " + e.getInvocationRequestName()); //$NON-NLS-1$
System.err.print("|Code: " + e.getCode()); //$NON-NLS-1$
System.err.print("|Session Id: " + e.getMessage()); //$NON-NLS-1$
e.printStackTrace();
catch (Exception e)
e.printStackTrace();
}

Similar Messages

  • Call ODI Scenario from a Java Program

    Hi,
    I would like to invoke the ODI Scenario from a Java Program. Is there any way i can do this?
    Please let me know if you have any posts related to this.
    Thanks,
    Mansur

    Check this ..
    How to run ODI scenario from java?

  • Calling servlet from a java program

    Hi
    I need to call a servlet's doPost() method from a java program. I have a specific situation, where I need to call servlet from a java program. DUring this call I need to pass a file and two string to the servlet. Servelt after receiving the file and string uploads the file to the server at a specified location. I am stuck up as how to call servlet from a java program instead of a HTML or JSP.
    Can anyone help me to start with this.
    any suggestion is welcome.

    You have to establish a URLConnection with servlet from your java program.
    URL servletURL = new URL("http://localhost:8080/Myservlet?str1=abc&str2=def");
    URLConnection servletConnection = servletURL.openConnection();you can get the objectOutputStream
    ObjectOutputStream oos = new ObjectOutputStream (servletConnection.getOutputStream());
    oos.writeObject(your file object);-------------------------------------------------
    In the servlet u can get the strings using request.getParameter("str1");
    In the servlet u can get the strings using request.getParameter("str2");
    file = new ObjectInputStream (request.getInputStream()).readObject()a lot of resources are available on this ...
    hope this helps :)

  • How to run ODI scenario from java?

    I am new to java, need to do some testing on how to invoke ODI scenarios from java.
    Can somebody drop me some simple code?
    Thanks a lot,
    Lei

    Hi there
    1. Start your agent (double click agent.bat)
    2. generate scenario for ur package(right click ur package , select generate scenario)
    3. Add the odi-sdk-invocation.jar file to your java project
    ODIcmdScenario=new OdiCommandScenario();
    ODIConnection=new OdiRepositoryConnection();
    ODIConnection.setOdiUser("ur-username");
    ODIConnection.setOdiPassword("ur-password");
    ODIConnection.setJdbcDriver("Driverdetail");
    ODIConnection.setJdbcUrl("url-details");
    ODIConnection.setJdbcUser("dbusername");
    ODIConnection.setJdbcPassword("dbpass");
    ODIcmdScenario.setScenName("scenarioname");
    ODIcmdScenario.setScenVersion("scenarioversion");
    ODIcmdScenario.setLogLevel(5);
    ODIcmdScenario.setContext("context");
    ODIConnection.setWorkRepositoryCode("repository");
    ODIInvocation = new OdiInvocation("hostname", 20910); //20910 default port
    OdiInvocationResult result=ODIInvocation.invokeCommand(ODIcmdScenario,ODIConnection);
    Hope this helps!
    Cheers

  • How to Call .XDO file From Java Program

    Hi,
    I have developed a report in using BI Publisher version 10.1.3.
    I created the report and it only created XDO files. If I want to call XDO file from Java program how I can do that.
    What are the APIs available to do that.
    Thanks
    -Ashutosh

    Hi,
    the JavaAPI didn't work with the xdo-Files. But you can create a proxy stub for the Web Service API of BI Publisher which uses the xdo's in the repository.
    regards
    Rainer

  • Is it possible to Call ODI Scenario from eBS Concurrent request

    Hi Experts
    We have a concurrent request running on oracle eBS system. Is it possible to Invoke the ODI Scenario (on a different server) by submitting a concurrent request. Mostly the concurrent program will be a PL/SQL
    Thanks in advance.

    hey,
    yeah its possible..
    Check this.
    /people/vanita.thareja2/blog/2006/05/23/bpm-sending-message-asynchronously-and-getting-the-response-from-synchronous-system-using-abap-proxies
    These replies too..
    Proxy in BPM
    BPM file to ABAP proxy
    Thanks,
    Vijaya.
    Edited by: Vijaya Lakshmi Palla on Jun 4, 2008 5:32 AM

  • Calling javaFX script from Java program

    I am trying to call JavaFX script from a simple Java program. code as follows:
    import java.io.*;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineManager;
    public class My{
    public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByExtension("fx");
    try {  
    InputStreamReader reader = new InputStreamReader(My.class.getResourceAsStream("first.fx"));
    engine.eval(reader);
    reader.close();
    } catch (Exception e) {
    e.printStackTrace();
    my first.fx file code is here:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import javafx.scene.text.TextAlignment;
    Stage {
    title: "My First JavaFX Sphere"
    scene: Scene {
    width: 250
    height: 250
    content: [
    Text {
    font: Font { size: 24 }
    x: 20, y: 90
    textAlignment: TextAlignment.CENTER
    content:"Welcome to \nJavaFX World"
    } //Text
    ] // content
    } // Scene
    } // Stage
    I am not able to run My.java. runtime error as follows:
    java.lang.NullpointerException
    Kindly correct me, where I am wrong

    I am able to call .fx file from Java. Thank you all for helping me to resolve this problem
    Regards,
    Ritu

  • Calling C++ method from Java program on Linux

    I'm trying to get set up to call a C++ method from a Java app on a SUSE Linux box. I follow the steps of the "Hello World" baby example in Beth Stearns's tutorial, "Integrating Native Code and Java Programs", but I get the following error message:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /users/dmizell/testIF/libhello.so: /users/dmizell/testIF/libhello.so: invalid ELF header (Possible cause: endianness mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at HelloWorld.<clinit>(HW.java:7)
    at Main.main(Main.java:5)
    Any idea what I might be doing wrong?
    thanks
    David

    Your library is compiled in a way which is incompatible with the VM you are using.
    Note that there is a JNI forum.

  • Calling batch file from java Program

    I have made the java program in which i have called the batch file.But the problem is this that when i call batch file locally it executes normally but when i try to execute batcvh file from remote machine it doesn't runrather it gives Runtime IO execption.Error123.Can anyone provide me the solution for this?

    Not without a lot more information. Like for example how you are trying to execute this remote batch file, the code you are using to do that, what kind of server you have no the remote machine to let you remotely execute code, and so on.

  • Calling FND_VAULT.get from Java program

    Hi,
    I am creating a Java Concurrent Program in EBS and from my Java program I want to invoke "FND_VAULT.get" procedure.
    Can someone please guide me on how to do that.
    Thanks

    Actually I am having 4 Shell Scripts which I want to
    call at a time.
    1)run_graph.sh
    2)run_report.sh
    3)web_report.sh
    4)mktg_report.sh
    Now I want to call all the four from a Java Program at
    the same timeWell... if you truly want to run them at the same time, you'll need to look into multithreading.
    What I suspect you really want is to run them in the above order within the same Java program.
    String pathToScripts = "/etc/path/to/your/scripts/";
    String[] scripts = {"run_graph.sh", "run_report.sh", "web_report.sh", "mktg_report.sh"};
    Process p = null;
    for (int i=0; i<scripts.length; i++){
        p = Runtime.getRuntime().exec(pathToScripts + scripts);
    p.waitFor();
    System.out.println(scripts[i] + " completed with exit code " + p.exitValue());
    If you want to capture output or send input for the above processes, see the java.lang.Process and java.lang.Runtime API docs:
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html
    Hope this helps,
    -Scott

  • Call ITS services in Java program

    Hi,
    I have a requirement to access ITS services not in a web browser, but in a Java program. The java program should simulate the web browser. The java program has to open URL connection with ITS, get the HTML page, parse the HTML tags to get the input fields and button information and send it to 3rd party program. Based on the data returned by the 3rd party program, the Java program also has to submit the data on the current HTML page and get the next HTML page.
    The HTML templates used for the above requriement are generated using 'Classic' style.
    The ITS used is Integrated ITS and the java program runs on Netweaver AS.
    I am facing problems in opening up URL connection with ITS through java program, It gives HTTP error. But the URL is working fine in Web browser. The URL looks like
    http://<sap host>:<port>/sap/<ICF service>?sap-client=100&sap-user=<user>&sap-password=<password>
    Thanks & Regards,
    Sudhakar
    Updated:
    I have found the reason for my above reported issue.  The SAP system function ICF_DISPATCH is throwing dump. This system function supports only some web clients for the ICF services. It supports Internet Explorer, Mozarilla fire fox, but doesn't support Google chrome or HTTP request from Java program (my case).
    I am trying to look for the source code of the system function ICF_DISPATCH. SAP documentation says that all the system functions are available in the file sapactab.h. I tried to locate the file in kernel, but couldn't find it. I searched SDN forums too, but didn't get much help.
    Can somebody please advise me on how to overcome this issue.
    Edited by: Sudhakar Ravuri on Dec 23, 2008 8:00 AM

    I recommend to read SAP note 972116 and disable the browser check. But be aware that in this environment no javascript is available. Therefore only services carefully designed will run unders these conditions. WebGUI, EWT.. will not work.
    Regards,
    Klaus

  • How to call stored procedures from java program?

    I have tried to run a program that calls a stored procedure on MySQL
    server version 5.0.17 by using connector/j 5.0, but it always fails on the
    statement: con.preparecall() ,
    have looked on the internet and found out that people can all mysql
    stored procedure all right in their programs, really dont know what's
    wrong with this small peiece of code:
    import java.sql.*;
    public class TestDB {
          // procedure being called is:
         CREATE PROCEDURE `dbsaystorm`.`getsite` ()
         BEGIN
            select  name  from tblsite;
         END
         public static void main(String[] args) {
              try  {
                  //Class.forName("org.gjt.mm.mysql.Driver");
                  Class.forName("com.mysql.jdbc.Driver");
                  Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dbname",
                            "user", "pwd");
           * executing SQL statement here gives perfect correct results:
            // PreparedStatement ps = con.prepareStatement("select name from tblsite");      
            // ResultSet rs =ps.executeQuery();
                  // but in stored procedure way...
                  //it fails here on this prepare call statement:             
                  CallableStatement proc = con.prepareCall("call getsite()");
                  ResultSet rs =proc.executeQuery();                      
                  if (rs == null) return;                                      
                  while (rs.next()){                 
                      System.out.println("site name is: "+ rs.getString(1));                                
                  rs.close();
              } catch (SQLException e) {e.printStackTrace();}
               catch (Exception e) {e.printStackTrace();}         
    }it always gives this exception:
    java.lang.NullPointerException
         at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:959)
         at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1280)
         at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)
         at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)
         at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:453)
         at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)
         at saystorm.server.data.database.TestDB.main(TestDB.java:29)
    where have I gone wrong?
    when I commented out the statement that makes the procedure call and call preparedstatement to execute SQL select statement, it gave perfectly correct result.
    it looks like there is no problem with java prog accessing MYSQL server database, but the it seems that it's just java can't call stored procedure stored on the mysql server version 5.
    can it or can't it? if it can, how is that accomplished?

    It is a bug in the driver because it shouldn't be
    returning that exception (null pointer) even if you
    are doing something wrong.
    Are you using the latest version of the driver?
    The stored procedure runs when you run it from the
    gui/command line using a MySQL tool - correct?
    As suggested you should be using the brackets. What
    is the data type of the 'name' field?
    You could try returning another value like one of the
    following
    select 1, name from tblsite;
    select name, 1 from tblsite;
    That might get around the bug
    Additionally try just the following...
    select 'test' from tblsite;yes, the driver used is in connector/j 5.0--the lastest one, and the
    procedure can run correctedly at either command line or GUI mode
    with no problem whatsoever, the returned data type is string type,
    I have not got the chance to test it again with those values you
    suggested, as I have abandoned the laptop I used to write that code
    initately. There have been some other really weird cases happened on
    that computer. I guess that must be something wrong with the JVM
    installed on it, it was upgraded from jre5.0.04 to 06, and to 09.
    something within hte JVM must have been messed up(the only reasonable
    explanation). Because the same code runs correctly on my new laptop,
    using the same environment: jvm 5.0_09, mysql 5.0.18, connector/J 5.0.
    that old laptop really was a nightmare.

  • Error while calling the BPEL from java program

    Hello All,
    I am tring to call the Synchronous BPEL process from the following code:
    package callbpelfromjava;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    public class BPELCaller {
    public static void main(String args[]){
    String input = "krrish";
    String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
    try{        
    Properties props=new Properties();
    props.setProperty("orabpel.platform","ias_10g");
    props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    props.setProperty("java.naming.provider.url","opmn:ormi://192.168.137.40:6004/home/orabpel");
    props.setProperty("java.naming.security.principal","oc4jadmin");
    props.setProperty("java.naming.security.credentials","welcome1");
    props.setProperty("dedicated.rmicontext", "true");
    Locator locator = new Locator("default", "bpel", props);
    System.out.println("After creating the locator object......");
    IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
    System.out.println("Befor creating the NormalizedMessage object......");
    NormalizedMessage nm = new NormalizedMessage();
    System.out.println("After creating the NormalizedMessage object.*.*.*...");
    nm.addPart("payload", xmlInput);
    System.out.println("Before creating response object......");
    NormalizedMessage res = deliveryService.request("AccessDBBPEL", "process", nm);
    System.out.println("After calling the AccessDBBPEL .*.*.*...");
    Map payload = res.getPayload();
    System.out.println("BPEL called");
    XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
    String replyText=xmlEl.getText();
    System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
    catch (Exception e) {
    e.printStackTrace();
    I Included the following jar files:
    Orabpel-ant.jar
    Orabpel.jar
    Orabpel-common.jar
    Orabpel-boot.jar
    Xmlparserv2.jar
    Ejb30.jar
    and getting the exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at callbpelfromjava.BPELCaller.main(BPELCaller.java:39)
    Am I doing any thing wrong ?
    Thanks
    Krrish

    Hello Marc,
    Thank you for the reply.
    I could not find some of the jar files in my Jdeveloper 10.1.3.1.0
    ../lib/olite40.jar
    ../lib/wsclient_extended.jar
    ../lib/log4j-1.2.14.jar
    could you please help me locating these jars.
    or If possible, could you mail me those jars at [email protected]
    I have included all other jar files you have listed and getting the following errror:
    java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at callbpelfromjava.BPELCaller.main(BPELCaller.java:39)
         at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at callbpelfromjava.BPELCaller.main(BPELCaller.java:39)
    Thanks
    Krrrish

  • Calling SQL LOADER From Java Program

    Hi
    I need to invoke sql loader from inside a Java Class.
    Any Pointers in this regards will be really appreciated.
    Thanks
    Vishal

    You can create two different files which has sqlldr command defined....
    1. loader.sh
    2. loader.bat
    and in the depending on the OS execute one...
             String command = "";
             if(System.getProperty("os.name").equals("Windows 2000")){
                    //if os is windows 2000  then execute bat file
                     command =  <<bat file path>>
              }else{
                      command = <<shell path>>
              Runtime rt = Runtime.getRuntime();
              Process p = rt.exec(command);
              int i = p.exitValue();
             

  • How to call msword application from java program

    hai every body
    i want to know about OLE in java.
    how can i invoke msoffice application in java code.
    if any body have sanple code for this post for me
    thank you

    There are some bridges available ...
    http://www.google.com/search?q=ole+java+bridge

Maybe you are looking for

  • Distortion on display

    I'm experiencing a problem with my iMac in the form of a small streak across the bottom of the display, almost end-to-end, and about as high up as the top of the Dock reaches. This streak is rather faint; normally I can't see it unless the background

  • Plug in errors

    I am using Adobe Acrobat 7.0. It has been working fine, until late yesterday morning. Now when I open it, I get the following messages: error loading plug-in 'catalog.api' failed to initiate error loading plug-in 'JDFProdDef.api failed to initiate er

  • Netweaver SR3 on Linux Enterprise 10 - Which JDK Version

    Hello experts, we are facing problems installing Netweaver SR3 (Java) on Linux Enterprise. The problem is that the step Import Java Dump hangs and the installation does not continue. According to other forum threads one problem might be a wrong JDK v

  • Jdeveloper 10g 10.1.3.3 jdk 1.5.0_22 - shows empty main frame

    Hi, Jdeveloper 10g 10.1.3.3 (OAF) with jdk 1.5.0_22 shows empty main frame without any controls. But if I click on that frame in chaotic order the header text of main frame is changing. It seems like controls are exists, but not visible. If I use jdk

  • How would you use Aperture 3 Labels & Flags in your workflow?

    Now that A3 has the ability to use Labels & Flags, I'm trying to incorporate their use into my workflow but am struggling to find the most effective way. I've used the star rating for selections & refining the selections. In A2 I used keywords on ima