Pass the BPEL Input Payload to Embedded Java Program

Please let me know how can we pass the Input to a BPEL process to the embedded Java Program.
Requirement:
To pass the payload recieved by the BPEL process to a Java method using embedded java activity where we can parse/modify this payload
I tried this approach
Object obj = (Object)getVariableData('variableName');
//call to java method with obj as argument
//In java method
XMLElement xmlElement = (XMLElement)obj;
thereafter I am trying to read the nodes of this element but this is not working.
Please point me to any document/tutorial/examples in this context.
Thanks

Hi
the getVariableData() method returns a org.w3c.dom.Element object (10.1.3 version).
So I believe you should use something like:
Object obj = (Object)getVariableData('variableName');
//call to java method with obj as argument
//In java method
org.w3c.dom.Element xmlElement = (org.w3c.dom.Element)obj;
And to read a node use this:
org.w3c.dom.Node node = xmlElement.getFirstChild().getNodeValue();
However I never tried getVariableData('variableName'), I tried getVariableData('variableName','partName','query') so I don´t know the diferences between these two methods, but I hope this helps you.

Similar Messages

  • How can i pass the  parameter for strored procedure from java

    dear all,
    I am very new for stored procedure
    1. I want to write the strored procedure for insert.
    2. How can i pass the parameter for that procedure from java.
    if any material available in internet create procedure and call procedure from java , and passing parameter to procedure from java

    Hi Ram,
    To call the callable statement use the below sample.
    stmt = conn.prepareCall("{call <procedure name>(?,?)}");
    stmt.setString(1,value);//Input parameter
    stmt.registerOutParameter(2,Types.BIGINT);//Output parameter
    stmt.execute();
    seq = (int)stmt.getLong(2);//Getting the result from the procedure.

  • Could anyone tell me what is the minium requirement to run a java program.

    I am new to java. Could anyone tell me what is the minium requirement to run a java program. Thanks in advance.

    Lara1983 wrote:
    Could anybody give me a direct answer? I think the minium requirement to run a java program is JVM and Java API. Is this right?What does Google tell you?
    BTW in order to get a direct answer, one must ask a direct unambiguous question. Are you asking for the minimum software or hardware requirements to run an application developed in Java or to develop an application in Java. What environment? Details are important and again Google is an interactive search engine, try it!
    Mel

  • WLS JMS supports the clients developed by using non-java program languages,such as,c++,VB...

              WLS JMS supports the clients developed by using non-java program languages,such
              as,c++,VB?
              

    The short answer is yes. This is a frequently asked question. I
              suggest searching this newsgroup in google using terms like "C++",
              "IIOP", ".NET", "JCOM".
              Note also that WL 8.1 (now out in beta) contains a thin java client
              (something like 0 or 300K without JMS, 700k with. The 0K client comes
              from leveraging WL's IIOP support.)
              Tom, BEA
              jerry8006 wrote:
              > WLS JMS supports the clients developed by using non-java program languages,such
              > as,c++,VB?
              

  • Where is the BPEL Instance payload stored in soa database?

    Hi all,
    Given an instance id, I need to get the payload used to invoke the BPEL.
    I searched in the soa database. Also I went through the bpel client apis. But I couldn't find any. Is there any table in the BPEL dehydration store that can give me the entire bpel instance input payload given the instance_id?
    Thanks,
    Shyamala

    Hi,
    have you tried to unzip the blob inside the xml_document table?
    the dockey is availalbe via document_ci_ref

  • How to pass the chinese input insert into DB

    hi guys,
    i am the new one in developing the multilingual software.
    let me explain :
    the tools used are :
    Jboss 4.0.4 , MySQL, Eclipse.
    user key in the chinese or other languages[like greek] in the jsp page. then will uses <form .......... method="post" action="create_user_confirm.jsp"> to redirect the page to create_user_confirm.jsp . In this page request.getParameter is used to get those input and send them to java code to insert into DB.
    my difficulty now is from input jsp page to create_user_confirm.jsp page, i couldnt send the chinese word (greek or spanish) to the 2nd page by using request.getParameter("").it shows me the funny symbols below are some of code of my jsp pages.
    nput.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
              %>
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_confirm.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="name" type="text" id="name" size="35" value="<%=name%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="description" type="text" id="description" size="35" value="<%=description%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="phonenumber" type="text" id="phonenumber" size="35" value="<%=phonenumber %>" /></td>
                        </tr>     
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_password")%></td>
                             <td class="middle" colspan="2"><input class="middle"name="password1" type="password" id="password1" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_passwordrepeat")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="password2" type="password" id="password2" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_privilege")%></td>
                             <td class="middle" colspan="2"><select class="middle" name="privilege" id="privilege">
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=&name=&description=&phonenumber='" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
    create_user_confirm.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="javax.naming.Context"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
         if (ok) {
             String name = request.getParameter("name");
             String description = request.getParameter("description");
             String phonenumber = request.getParameter("phonenumber");
             String password1 = request.getParameter("password1");
             String password2 = request.getParameter("password2");
             String[] privilege = request.getParameterValues("privilege");
             if (name == null)
                  name = "";
             if (description == null)
                  description = "";
             if (phonenumber == null)
                  phonenumber = "";
             if (password1 == null)
                  password1 = "";
             if (password2 == null)
                  password2 = "";
              LSUser user1 = null;
              %>          
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_do.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <input type=hidden name=name value="<%=name%>">
                   <input type=hidden name=description value="<%=description%>">
                   <input type=hidden name=password1 value="<%=password1%>">
                   <input type=hidden name=phonenumber value="<%=phonenumber%>">
                   <input type=hidden name=msg value="<%=message%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><%=name%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><%=description%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <% if(!phonenumber.equals("")) { %>
                             <tr>
                                  <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                                  <td class="middle" colspan="2"><%=request.getParameter("phonenumber")%></td>
                                  <td class="right"> </td>
                             </tr>
                             <tr>
                                  <td colspan="4" style="height: 23px">
                                       <p style="border-bottom: gray 1px solid;"> </p>
                                  </td>
                             </tr>
                        <% } %>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=<%=message%>&name=<%=name%>&description=<%=description%>&phonenumber=<%=request.getParameter("phonenumber")%><%=privStr%>'" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
         i really appreciate whoever reply this post. thanks a lot.

    hi skalster,
    thanks for your reply. currently i use Jboss to make the connection and the configuration to mySQL. the code as such :
    <datasources>
      <local-tx-datasource>
        <jndi-name>RTA_DS</jndi-name>
        <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>root</user-name>
        <password></password>   
        <min-pool-size>5</min-pool-size>
        <max-pool-size>20</max-pool-size>   
          <metadata>
             <type-mapping>mySQL</type-mapping>
          </metadata>
        </local-tx-datasource>
    </datasources>so whatever there is a insertion or retrieval, the system will call entity bean and there is no DB configuration on my code side. all done by Jboss. but now i am more concern on chinese word or other languages which are able to pass the chinese parameter within jsp pages. now i am facing the problem which user key in the chinese or other language's input,it is fail to pass to another jsp (create_user_confirm.jsp) to do the validation. it appears as those funny character from input.jsp to create_user_confirm.jsp by using request.getparameter(). any idea to solve this matter?the source code of the 2 jsp files are at the previous message. i really thanks for your reply.
    have a nice day

  • Pass in date from shell script to java program

    Hi,
    I need to pass in some parameter to my java program.
    eg 'java SomeProgram yyyy mm dd hh mm ss'
    How do i use the shell script to generate the valeus for the year, mth day etc?
    The program is running once everyday.
    I tried $argu0 = `date+%y`
    java SomeProgram $argu0
    but not working... thanks for your help!

    Then, why would you want to use 'date' to provide
    'now' to a Java program when you could just use new
    java.util.Date() which probably makes the same call
    as the Unix 'date' command?That works until you need to use a date other than 'now.'
        public static final String ISO_DATE = "yyyy-MM-dd HH:mm:ss";
        public static void main(String[] args) {
            SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat
                    .getDateTimeInstance();
            sdf.applyPattern(ISO_DATE);
            try {
                Date d = sdf.parse(args[0]);
                // rest of code here
            } catch (ParseException e) {
                // handle exception
        }Users will have to enclose there input with quotes otherwise the JVM will consider their input as two parameters, or you can change the pattern to include a character between dd and HH.

  • Inputting Text in a java program

    How do you input text in a java progerm? Im relearning java at the min. Havnt looked at it since studying it in uni(3 years ago). One problem I am having is that at uni we used a set of API's the uni had created. The problem with this is that I dont have it anymore. With this if I wanted to input some text I did sopmething similar to the following:
    uuInOut.readLine();

    Have you tried Google? with words like 'Java input"? (Top link gives you an answer :) )

  • How to get the erroe message, if i run java program using .bat file

    Hi,
    I have a java file which accepts two inputs as command line argument. I want to make this pgm a tool. So have created a *.bat file which has the following command
    java myprogram arg1 arg2
    I'm gonna share this program with others. So i'll keep the class file and the .bat file in a commaon folder. All the users have to do is, edit the .bat file to give his/her args and run the .bat file. The pbm is, if the user input is not valid, I have put displays in the pgm to show it.
    But if i run thru .bat, I'm not getting the error message or I don't know where it is getting displayed.
    Can anyone help me with this ?
    Thanks,
    Mary

    When i run from the console, I can see the output.
    But, when i double click on the .bat file from the
    folder, it runs fine and i couldn't see the output.
    nullThat's because the error message is printed, and then the console is closed. The message is there but you need to read really really fast :)

  • How can we measure the time of excecution of our Java program?

    i have a java application program which runs depend upon the user input.
    I want to analyze how my application works.
    So i want to measure the time of execution.How can i do it?

    makpandian wrote:
    ..i want to measure the time of execution.
    long startTime = System.currentTimeMillis()
    doTimeConsumingTask();
    long endTime = System.currentTimeMillis()
    System.out.println(  "The task took " + (startTime-endTime)/1000 + " seconds." ); Edit 1:
    I see I was 'too slow off the mark' by 5 minutes. ;)
    Edited by: AndrewThompson64 on Jul 19, 2009 10:58 PM

  • How to use the google search from inside a java program

    Hi guys
    How can i use google search in my java program?
    What will be the type of the reply i get back from google?
    Thanks in advance
    [http://javamilestone.blogspot.com/|http://javamilestone.blogspot.com/]

    Hi,
    You have here some examples about how to make search on google from a Java application.
    The type of reply is JSON
    Here some documentation about it:
    [http://code.google.com/apis/ajaxsearch/documentation/#fonje|http://code.google.com/apis/ajaxsearch/documentation/#fonje]
    And here some snippets:
    [http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets|http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets]
    Regards,
    David.

  • Getting the log files from client using java program

    hi
    this is lalita...and i am doing a project in networking.... i am new to socket programming....i have established the socket connection between the client and server...with this site members' help....now i have to get the log files of the client system from the server.... via the created socket....i need it by tomorrow...i.e apr 12th ....as i have to show it to my guide...
    i just need a core java program that will get the log information of the client from the server......
    Can anybody please help me in this regard..... it would be of great help to me and my group....
    Anxiously awaiting for the replies....
    Thanking you and regards...
    Lalita.

    Simple.
    Server is listening on a specific port for the connection from the clients.
    Connect the client with the server on the above mentioned port.
    Open the streams on both side for the connection and run in separate thread.
    Define a protocol for communication between client and server.
    e.g after connection with the server the server send a text message to the client (send log) now the client first should the log file name and size to the sever and then send the file. the server should save the file.
    then disconnect the client or want to get another file or for other tasks define the other commands

  • Automate the website log in process using java program

    Acutally, on daily basis, I have to open website,loginto that, navigate toa
    link/page,export an excel sheet and do processing.Can I go ahead to automate the same
    through Java Program.
    Thanks,
    amol

    Hello,
    The TechNet Wiki Forum is a place for the TechNet Wiki Community to engage, question, organize, debate, help, influence and foster the TechNet Wiki content, platform and Community.
    Please note that this forum exists to discuss TechNet Wiki as a technology/application.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Passing the same input parameter twise in execute sql task

    Hi All, I want to insert some values to 3 different tables in sql server. Execute sql task is used to populate three tables. Here is the sql statement.
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT ?, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT ?, COL2, COL3 FROM TABLE_B
    Input parameter is mapped as follows :
    Variable name : User::EffectiveDate
    Direction : Input Data Type :
    Date Parameter name :0
    Parameter size :-1
    User::EffectiveDate is datetime variable.
    When the package is executed, it throws an error.
    [Execute SQL Task] Error: Executing the query " " failed with the following error: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Possible failure reasons: Problems
    with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. I am not sure what I am doing wrong here. If anyone could point me to the right direction, I really appreciate.
    Thanks
    shamen

    To expand on the other answers.
    Your SQL command
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT ?, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT ?, COL2, COL3 FROM TABLE_B
    It using 3 input variables.  I assume you didn't pass 3 variables and you want @DT to be column 1 in each.  In that case you would use:
    DECLARE @Dt AS DATE
    SET @Dt = ?
    INSERT INTO TABLE1 SELECT @Dt, COL2, COL3 FROM TABLE_A
    INSERT INTO TABLE2 SELECT @Dt, COL2, COL3 FROM TABLE_B

  • How to pass the value of variable to another java file?

    Hi. I have 2 java files (LogonAction.java and PCAction.java). The value of variable(String getrole) depends on the logon user. How can I use this value of variable in PCAction.java? I want to execute a sql statement in PCAction.java which is (String sql="Select * from PP where role"+"='" + getrole + "'") Thanks a lot.
    LogonAction.java is below:
    package test;
    import test.jdbc.util.ConnectionPool;
    import java.sql.*
    import java.util.*;
    import javax.servlet.http.*;
    import org.apache.commons.logging.*;
    import org.apache.struts.action.*;
    import org.apache.struts.util.*;
    import org.apache.commons.beanutils.PropertyUtils;
    public final class LogonAction extends Action {
    private Log log = LogFactory.getLog("org.apache.struts.webapp.Example");
    private ConnectionPool pool;
    public LogonAction() {
    pool = ConnectionPool.getInstance();
    public String getrole;
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    Locale locale = getLocale(request);
    MessageResources messages = getResources(request);
    ActionErrors errors = new ActionErrors();
    String username = (String)PropertyUtils.getSimpleProperty(form, "username");
    String password = (String)PropertyUtils.getSimpleProperty(form, "password");
    String getusername=CheckUser(username,password);
    getrole=getusername;
    java.lang.System.out.println(getrole);
    if ("".equals(getusername))
    errors.add(ActionErrors.GLOBAL_ERROR,
    new ActionError("error.password.mismatch"));
    getusername=username+getusername;
    // Report any errors we have discovered back to the original form
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    return (mapping.getInputForward());
    // Save our logged-in user in the session
    HttpSession session = request.getSession();
    session.setAttribute(Constants.USER_KEY, getusername);
    if (log.isDebugEnabled()) {
    log.debug("LogonAction: User '" + username +
    "' logged on in session " + session.getId());
    // Remove the obsolete form bean
    if (mapping.getAttribute() != null) {
    if ("request".equals(mapping.getScope()))
    request.removeAttribute(mapping.getAttribute());
    else
    session.removeAttribute(mapping.getAttribute());
    // Forward control to the specified success URI
    return (mapping.findForward("success"));
    * Look up the user, throwing an exception to simulate business logic
    * rule exceptions.
    * @param database Database in which to look up the user
    * @param username Username specified on the logon form
    * @exception ModuleException if a business logic rule is violated
    public String CheckUser(String username,String password){
    Connection con = null;
    try
    con = pool.getConnection();
    String sql = "SELECT * from user WHERE userid = ? AND password= ?";
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
    if (con.isClosed()) {
    throw new IllegalStateException("error.con.isClosed");
    ps = con.prepareStatement(sql);
    ps.setString(1,username);
    ps.setString(2,password);
    rs = ps.executeQuery();
    String returnstr="";
    while(rs.next())
    returnstr=rs.getString("role");
    java.lang.System.out.println(returnstr);
    return returnstr;
    } catch (SQLException e) {
    e.printStackTrace();
    throw new RuntimeException("error.ps.executeQuery");
    } finally {
    try {
    if (ps != null)
    ps.close();
    if (rs != null)
    rs.close();
    } catch (SQLException e) {
    e.printStackTrace();
    throw new RuntimeException("error.rs.close");
    catch (SQLException e)
    e.printStackTrace();
    throw new RuntimeException("Unable to get connection.");
    finally
    try
    if (con != null)
    con.close();
    catch (SQLException e)
    throw new RuntimeException(e.getMessage());
    }

    You can use PreparedStatement and
    String cmd = "select * from PP where role=?";
    PreparedStatement stmt = conn.prepareStatement(cmd);
    stmt.setString(1,theRole);

Maybe you are looking for