How to approve the step from java program ?

Hi all,
I want to approve a step from java program.
I call the store function "wf_notification.setattrtext" & "wf_notification.respond".
It's not work.
The notification's status become to 'CLOSE', but PO_REQUISITION_HEADERS_ALL.AUTHORIZATION_STATUS is 'IN PROCESS'.
And I try to approve the flow from oracle web gui and it's OK !
The notification's status become to 'CLOSE', but PO_REQUISITION_HEADERS_ALL.AUTHORIZATION_STATUS is 'APPROVED'.
The java program as follows, and '1099999' is notification id.
Can anyone please please please help me?
Thanks, all.
Gavin
===================================================================================================
import java.util.*;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.rmi.*;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class CommitPR
public static void main(String[] aArgs) throws Exception
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@10.1.1.1:1521:ORA";
String user = "user";
String password = "password";
Class.forName(driver).newInstance();
String sql;
Connection conn = null;
Statement callStmt;
conn = DriverManager.getConnection(url, user, password);
conn.setAutoCommit(true);
callStmt = conn.createStatement();
sql = "{ CALL WF_NOTIFICATION.SETATTRTEXT ('1099999','RESULT','APPROVE') }";
System.out.println("sql=" + sql);
callStmt.execute(sql);
sql = "{ CALL WF_NOTIFICATION.RESPOND ('1099999','ARRPOVED','EIP_ADMIN') }";
System.out.println("sql=" + sql);
callStmt.execute(sql);
callStmt.close();
conn.close();
===================================================================================================

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

Similar Messages

  • 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

  • How to execute .msi files from java program

    Hi friends,
    i have written a java program which invokes and thereby execute any executable files like .exe and .bat.
    So its working fine with .exe and .bat files, but it is not working with .msi files.......can you please help me how can i execute .msi files as well??
    public class Executeexe {
         public static void main(String ar[])
              try
              Process p=null;
              Runtime rt=Runtime.getRuntime();
              p=rt.exec("D:\\mysql-essential-5.0.83-win32.msi");
              p.waitFor();
    catch(Exception e)
    }here is the program

    Make sure that the command that's being exec'd works from the cmd line.
    Then read this article and do what it says:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Then if you still are having problems explain what "...it is not working with .msi files..." really means, and provide a [SSCCE Example program|http://mindprod.com/jgloss/sscce.html]

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • How to Initiate the Workflow from Java webdynpro?

    Hi All,
    I am developing Customized WD application for ESS, which in turn having integration with Workflow.
    Now How to Initiate the Workflow coding part in Webdynpro Development.
    Through Adaptive RFC Model, i created model using sap_wapi_start_workflow RFC
    Can anybody provide the sample code on this!!!
    What are the stpes i have to follow to this Workflow Initiation from WD Java..
    Thanks In Advance
    Krishna

    Krishna,
    What Alejandro is mentioning that create a RFC which accesses you workflow on ABAP end. At your Java side just make the call the BAPI.
    So you need a BAPI say ZMYBAPI which accesses your ZWORKFLOW.  Now on Java side create a WD project which accesses ZMYBAPI.
    For information on how to connect to a BAPI please refer this [link|https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15]
    Chintan

  • How to execute system command from java program

    Hi all,
    I want to change directory path and then execute bash and other unix commands from a java program. When I execute them separately, it's working. Even in different try-catch block it's working but when I try to incorporate both of them in same try-catch block, I am not able to execute the commands. The change directory command works but it won't show me the effects of the bash and other commands.
    Suggestions??

    The code I am using is....
    try
    String str="cd D:\\Test";
    Process p=Runtime.getRuntime().exec("cmd /c cd
    "+str);your str string is already having cd in it but again you ar giving cd as part of this command also please check this,i will suggest you to remove cd from str
    Process p1=Runtime.getRuntime().exec("cmd /c mkdir
    "+str+"\\test_folder");you should say mkdir once you change your path,but here you are saying mkdir first and then cd D:\Test(this is because of str)..please check this
    Process p2=Runtime.getRuntime().exec("cmd /c bash");
    Process p3=Runtime.getRuntime().exec("cmd /c echo
    himanshu>name.txt");
    catch(IOException e)
    System.err.println("Error on exec() method");
    e.printStackTrace();
    Message was edited by:
    ragas

  • How to run the jmeter through java program

    i wnat interact jmeter through my java program
    i will pass values to jmeter through my java program
    i wnat retrive the results from jmeter to my java program

    Read the manual.

  • How to get oc4j version from Java program

    i have the following in my Java Program
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("java -jar oc4j.jar –version");
    and then i try to read the InputStream from the Process p.
    but this line is not executing, it returns the following error.
    Unknown switch: ?version, type java -jar oc4j.jar -? for help
    if i change it to ----------
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("java -jar $ORACLE_HOME/j2ee/home/oc4j.jar –version");
    then i get another error :
    Exception in thread "main" java.util.zip.ZipException: No such file or directory
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:112)
    at java.util.jar.JarFile.<init>(JarFile.java:127)
    at java.util.jar.JarFile.<init>(JarFile.java:65)
    but if i cd to /oracle/j2ee/home and then run the command java -jar oc4j.jar –version, then it gives me the right output with the right version, but for some reason the samething from inside the java program is giving me errors,
    please help. i just need to read the oc4j version running on the server and display it in JSP.

    Process p = r.exec("java -jar oc4j.jar –version");The character before "version" should be a hyphen; yours is not.
    Process p = r.exec("java -jar $ORACLE_HOME/j2ee/home/oc4j.jar –version");
    then i get another error : Exception in thread "main"
    java.util.zip.ZipException: No such file or directory
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:112)
    at java.util.jar.JarFile.<init>(JarFile.java:127)
    at java.util.jar.JarFile.<init>(JarFile.java:65)One more problem here: $ORACLE_HOME will be not be interpreted in the runtime.exec even if it is defined as an environment variable. So you get an error that tells you oc4j.jar is not found.
    Hope this helps you.

  • 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

  • How to invoke dos shell from java program

    Hi,
    I'm not able to invoke dos shell from java.
    Can any one help me in this issue.
    I'm providing the source code below:
    try{
    Runtime.getRuntime().exec("cmd.exe")
    catch(IOException e) {
    System.out.println(e.getStackTrace());
    Thanks

    Does it throw a different exception?
    Or does it just do nothing at all?
    It does nothing at all[/b
    Is this a standalone Java app?
    Or a Java Applet running via a webbrowser? [b]It's a standalone application

  • How to access system calls from java program?

    i am having a doubt regarding accessing system calls from a Java program like accessing unix system calls from a c program.

    Runtime.getRuntime().exec("line command here");
    example:
    Runtime.getRuntime().exec("ls -la");

  • How to invoke the compiler from another program

    Hi guys,
    Suppose I have a source code located in the file MyClass.java.
    Now suppose I'm running another program, and in this program I want to compile the MyClass.java file and create the MyClass.class file. Is there a way of doing it through the standard API?
    Thanks.

    I believe Java 1.6 has a Compiler class as a part of it's "standard" API. Before that, you've got a package called tools.jar in your SDK directory, which is a Java gateway to the compiler

  • 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.

  • How to pass the value from z-program to screen

    Hi,
    I have created a Z-report which is displaying the data according to the selection screen,but while going to click on 1 pushbutton,it should call z-transaction.
    My problem is how i will pass the selected data to my screen.suppose i have selected 1 material no.,i want to pass the material no. to my matnr field in my screen(which is already present in my screen)

    HI.
    Create SET PF-STATUS 'STATUS'.like as follows.
    1 .double click on  'STATUS1' create pushbutton by appilcation tool bar.
    2 .In fuction attributs ,In fuction code give your t-code.
    3.In Fucntion type give T.
    Eg:
    module STATUS_1001 output.
      SET PF-STATUS 'STATUS1'.
      SET TITLEBAR 'TITLE1'.
    endmodule.                 " STATUS_1001  OUTPU
    It will helpfull u.
    Regards.
    Jay

  • 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

  • Adobe Reader Error in Opening PDF Form

    Why do I get this error message when I try to open PDF Application Form using Adobe Reader? "Error encountered while processing node xfa[0].form[0].form1[0].#subform[5].ApplicationEligibility[0]. Unable to find suitable font for Japanese encoding."

  • Problems in v11 only

    1. save as in browser appears random file name in default, not the orignal file name. 2. search window is so annoying. please make it old fashion way: in the manu bar only and let us use ESC to quit! 3. sometimes i fail to close the search window.  i

  • Browsers slow/not working behind work proxy/firewall

    Everything works great at home. At work, Exchange is fine, getting to local servers is fine, but using any browser is hit and miss. I get 20+mb download speed using speakeasy.net, but in another tab, web pages will not load/ partially load or take fo

  • Running OWB design browser

    Hi I am trying to access OWB design browser but I am getting the following error in my Apache error logs. /pls/wb_runtime_rep/wb_runtime_rep.wmp_api_call.home ORA-0 wb_runtime_rep.wmp_api_call.home: PROCEDURE DOESN'T EXIST I configured DADS from the

  • Family share -how to make individual purchase not using family account

    HHow can I make a purchase using my individual iTunes account while family share is active?