How to iterate in java embedding?

I have a variable holding a repeatable structure. How do I iterate through this and manipulate the elements in a java step?
Rgds, Henrik

hek123 wrote:
Hi Ronald, I've tried using a transformation with the same source and target - but jdev dont like that - somehow.Do you get an error or an XML structure you don't expect? As Eric says can you paste the source XML, XSLT and the target XML (if there's no error and output is generated).
If you want to handle repeatable XML structures and want to "do something" with every instance of the element, you could also use debatching functionality in the ESB.
How would you suggest i come across the case of "nulling" a repeatable sub-element?What do you mean by nulling?
I cant use assign since it can't handle repeatable structures.
Rgds, HenrikRegards, Ronald

Similar Messages

  • How to use the Java embedding activity in BPel

    hi all,
    How to use the java embedding activity in BPEL
    pls can u provide sample example

    1 Use [Oracle BPEL Process Manager Client Java API Reference|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/overview-summary.html] and especially [com.collaxa.cube.engine.ext|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/com/collaxa/cube/engine/ext/BaseBPELXExecLet.html]
    Instead of System.Out.println use addAuditTrailEntry(java.lang.String message)
    2. If you want to import a package write in code (Source View) of bpel process
    +<bpelx:exec import="package_name"/>+ for example +<bpelx:exec import="java.util.regex.Matcher"/>+
    example 1:
    String bodyAsString;
    StringBuffer myStringBuffer = new StringBuffer();
    try {
    bodyAsString = (String)getVariableData("BodyString");
    addAuditTrailEntry("bodyAsString1: "+ bodyAsString);
    Pattern pattern = Pattern.compile("goodDay");
    Matcher matcher= pattern.matcher(bodyAsString);
    while (matcher.find()) {   
    matcher.appendReplacement(myStringBuffer, "shitDay");
    matcher.appendTail(myStringBuffer);
    bodyAsString = myStringBuffer.toString();
    addAuditTrailEntry("bodyAsString2: "+ bodyAsString);
    } catch (Exception ex) {
    addAuditTrailEntry("Failed+bodyAsString",ex.getMessage());
    I put in code (Source View) the following
    <bpelx:exec import="java.util.regex.Matcher"/>
    <bpelx:exec import="java.util.regex.Pattern"/>
    example2:
    Object temp;
    try {
    temp = ((XMLElement)getVariableData("inputVariable","payload","/ns2:FiscalisMessage/ns2:Body")).getChildNodes().item(1);
    setVariableData("AdjReceipt",temp);
    addAuditTrailEntry("ok",temp.toString());
    catch (Exception ex) {
    addAuditTrailEntry("Failed :",ex);
    I put in code (Source View) the following
    <bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>

  • How to display a BPEL variable using Java Embedding

    Hi, hope someone can help, I'm sure this is something very simple but for the life of me can't seem to find it through the tutorials including the Dev guide.
    Question
    =======
    How can I display user defined and BPEL variables in the process activity "Java Embedding" ?
    ex: System.out.println(bpws:getVariableData("myDatabaseParameterVariable")
    This example doesn't work but this is basically what I am trying to achieve.
    I would appreciate any help with this.
    Rookie

    Actually that's all the code I have.... System.out.println(myDatabaseArg);
    myDatabaseArg is a simple parameter defined in the database adapter configuration wizard which is used as a criteria to retrieve data.
    Just before I invoke the Read I use the Java Embedding to display the content of the parameter.

  • How to include Java embedding in BPEL to connect with Siebel On Demand

    Hi,
    I am trying to integrate Siebel on Demand with BPEL using the instructions given in the Best practices page http://www.oracle.com/technology/tech/fmw4apps/siebel/ofm-siebel-blog-postings.html.
    The code used in the Java embedding does not send a response back. I have increased the timeout period but still i get a time out error.
    Please let me know if anyone is aware of a work aorund for this
    Thanks.

    jamiguel77 wrote:
          1) i have a file .java with some great functions,
    If that is one Java file only I really doubt that those functions are "great" from a technical point of view...
    this functions i need use in all projects, then what is the easy by moment i start a project, and copy this file to project..
      is possible have only 1 file with these utilities functions? (if yes how to declare or use in all projects?)
    Note these utilkities file i want use on JAVA desktop(swinf and javafx), on JSP webpages and in the futhurer on the mobile.
    There is a  common approach to this problem which is a dependency repository. Various build tools address the dependency resolution problem. Most common are maven and greadle. Place your Jar file on a location you can reach from your various developement environments (eg. a share on a server in your network) Then configure your build tool to know about your repository.
    A better solution that a naked net share is a nexus server, which will not only hanlde dependencies you namually placed on your share but also dependencies available on public repositories.
    In your project you simply declare the (direct) dependencies of the Code you're writing. For maven you need an aditional file in your project: the pom.xml. maven (or greadle) will handle all the transient dependencies for you (as long as the pom.xml of the dependency also declares its own dependencies and those other dependencies are reachable for maven too).
    bye
    TPD

  • How to encrypt file on linux using Gnupg command in Java Embedding in BPEL.

    Hi All,
    I am trying to invoke a command script using the java embedding in BPEL Process.I am using the below code to execute the particular command to encrypt the file :-
    try {    
            Runtime rt = Runtime.getRuntime();    
    Process pr = rt.exec(new String[] {"/bin/bash", "-c", "/u01/GnuPG/bin/gpg", "-e", "-r", "Developer","/u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv"});    
             int exitVal = pr.waitFor();            
            String result = "SUCCESS: Process exit with " + exitVal;         
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    } catch(Exception e) {    
            e.printStackTrace();      
      String result = "FAILURE: Exception with " + e.toString();    
            addAuditTrailEntry("result = "+result);      
            setVariableData("outputVariable","payload","/client:processResponse/client:result",result);    
    The above statement does nothing. I am not sure what command i need to use to access to the command line.
    When i try this particular statement from linux machine command prompt :- /u01/GnuPG/bin/gpg -e  -r  Developer /u01/oracle/ConfigFiles/Adapter_controlDir/abc.csv
    It works absolutely fine and it creates the encrypted files also.
    Please suggest , which command i need to use from the java embedding.
    Please suggest!!
    Regards,
    Shah

    I think, you can try, writing these commands into a separate shell script and call that shell script from bpel via Java embedding. However, you might not get a return response.. but you can still give a shot.
    Hope it helps.

  • How to include Logs/log4j in SOA with out using java embedding activity

    Hi,
    I have a requirement where I need to log the values of a particular variable and need to store it in a new log file. Is there any way to log the details with out using java embedding activity.
    Thanks,

    You can try this.
    http://veejai24.blogspot.co.uk/2008/04/simple-way-to-implement-log4j-in-your.html
    Thanks,
    Vijay

  • How to use Java Embedding activity, getting error

    Below is a simple code where in I am just assigning input variable to output variable(of type long), using java embedding activity, and I am getting error in Java Embedding Activity step.
    <bpelx:exec name="Java_Embedding_1" language="java" version="1.4">
    <![CDATA[ 
    Element inputValue1 = (Element)getVariableData("inputVariable", "payload","/client:Pooja_BP1ProcessRequest/client:input1");   
    String arg1=inputValue1.getNodeValue(); 
    setVariableData("outputVariable", "payload","/client:Pooja_BP1ProcessResponse/client:result", new Long(arg1));]]>
    </bpelx:exec>
    Runtime Error:
    <runtimeFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>java.lang.*NumberFormatException*</code>
    </part><part name="summary"><summary>null</summary>
    </part><part name="detail"><detail>[Ljava.lang.StackTraceElement;@1c50684</detail>
    </part></runtimeFault>
    Could anyone please point out the mistake?

    No, that's not working. Throwing below error.
    faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {}
    parts: {{summary=<summary>XPath query string returns zero node.
    According to BPEL4WS spec 1.1 section 14.3, The assign activity &amp;lt;to&amp;gt; part query should not return zero node.
    Please check the BPEL source at line number "" and verify the &amp;lt;to&amp;gt; part xpath query.
    My output varaible is of type long and there i m creating a Long object using it's constructor which takes in a string, Long(String s)
    Actually, I m not just priniting the input, but i need to perform some calculations also on the inputs, like
    Element inputValue1 = (Element)getVariableData("inputVariable", "payload","/client:Pooja_BP1ProcessRequest/client:input1");  
    Element inputValue2 = (Element)getVariableData("inputVariable", "payload","/client:Pooja_BP1ProcessRequest/client:input2");  
    long arg1=Long.parseLong(inputValue1.getNodeValue());  
    long arg2=Long.parseLong(inputValue2.getNodeValue());  
    long arg3 = arg1+arg2; 
    setVariableData("outputVariable", "payload","/client:Pooja_BP1ProcessResponse/client:result", new Long(arg3));                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Could not type cast in java embedding

    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    org.xml.sax.InputSource in = (org.xml.sax.InputSource) getVariableData("Invoke_1_getRoutingAndFrameJumpers_OutputVariable","getRoutingAndFrameJumpersResponse");
    Document doc = db.parse(in);
    In the above code I am trying to type cast the variable getRoutingAndFrameJumpersResponse into org.xml.sax.InputSource so that i can parse.
    I am not getting any error during compilation
    but I am unable to type cast some run time error is coming in the line were I am type casting but I am not able to see the runtime error.
    How can I see the runtime error in java embedding, how to type cast a variable into xml so that I can parse it.

    Hi Arun,
    Could you try using the bpelx:rename extension in an assign activity enables a BPEL process to rename an element through use of XSD type casting.
    <bpel:assign>
    <bpelx:rename elementTo="QName1"? typeCastTo="QName2"?>
    <bpelx:target variable="ncname" part="ncname"? query="xpath_str" />
    </bpelx:rename>
    </bpel:assign>
    Cheers
    A

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • Reading files from Java embedding.

    Dear All,
    My BPEL process has a Java embedding node, and it invokes a Java class, in which an xsl file is being read for transformation.
    I deploy the xsl files directory together with BPEL package (the jar). In the package, I put the file dir at the root level, which means the jar structure looks like the following:
    /BPEL-INF
    /META-INF
    /xsd
    /xsl
    *.wsdl
    *.bpel
    bpel.xml
    The java class is package in /BPEL-INF dir, it's supposed to read files from /xsl dir.
    My question is, how should I put the file path?
    I tried "/xsl/***.xsl" and "../xsl/***.xsl", neither works. Although "/xsl/***.xsl" worked when testing in JDeveloper, but FileNotFound after deployment.
    Thanks,
    Haibo

    I solved this issue by putting the files dir in /BPEL-INF/classes/. and use ClassLoader to read in those files.

  • How to use external Java API in Java Embedd inside BPEL

    How to use external classes inside the BPEL in Java Embed Activity ? Any sample code availble ? Like i want to use log4j API inside BPEL.

    No you dont have to change your startManagedServer.cmd/.sh everytime you need to have a Java Embedding activity. You only need it in case of using Log4J. As log4j requires a configuration xml viz log4j.debug.xml and log4j.dtd you need to let the soa managed server know about it. The best way to load this configuration files is using the JAVA_OPTIONS command during server startup.
    Hope the explanation helps.

  • How to iterate the webservice Data control result set?

    Hi all,
    How to iterate the webservice Data control result set? I have an jsff page where I am displaying the single UserDetails by webservice DataContol. As per my design requirement I should iterate the DataControl resultSet to get the user details and push the same in to Managed bean. Please help me how to do this, any sample code please to iterate the resultset and get the data from it.
       <?xml version='1.0' encoding='UTF-8'?>
       <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:c="http://java.sun.com/jsp/jstl/core">
       <c:set var="uiBundle" value="#{adfBundle['edu.syr.oim.uiBundle']}"/>
       <af:pageTemplate viewId="/templates/jsffTemplate.jspx">
        <f:facet name="fTop"/>
        <f:facet name="fCenter">
          <af:panelGroupLayout layout="scroll" inlineStyle="width:100.0%;">
       <af:panelTabbed id="pt1">
        <af:showDetailItem text="#{uiBundle.PRIVACYFLAGS}" id="sdi4">
                <af:panelGroupLayout id="pgl4" layout="scroll">
                  <af:spacer width="10" height="10" id="s3"/>
                  <af:panelFormLayout id="pfl6">
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTEMAIL}"
                                             id="plam35">
                      <af:outputText value="#{bindings.stuEmail.inputValue}"
                                     id="ot42"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTHOMEADDRESS}"
                                             id="plam39">
                      <af:outputText value="#{bindings.stuPermAddr.inputValue}"
                                     id="ot35"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTHOMEPHONE}"
                                             id="plam40">
                      <af:outputText value="#{bindings.stuPermPhn.inputValue}"
                                     id="ot37"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTCURRENTPHONE}"
                                             id="plam42">
                      <af:outputText value="#{bindings.stuCurrAddr.inputValue}"
                                     id="ot40"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTCURRENTPHONE}"
                                             id="plam36">
                      <af:outputText value="#{bindings.stuCurrPhn.inputValue}"
                                     id="ot38"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.STUDENTACAINFO}"
                                             id="plam41">
                      <af:outputText value="#{bindings.stuAcad.inputValue}"
                                     id="ot36"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.EMPHOMEADDRESS}"
                                             id="plam38">
                      <af:outputText value="#{bindings.empPermAddr.inputValue}"
                                     id="ot39"/>
                    </af:panelLabelAndMessage>
                    <af:panelLabelAndMessage label="#{uiBundle.EMPHOMEPHONE}"
                                             id="plam37">
                      <af:outputText value="#{bindings.empPermPhn.inputValue}"
                                     id="ot41"/>
                    </af:panelLabelAndMessage>
                  </af:panelFormLayout>
                </af:panelGroupLayout>
              </af:showDetailItem>
       </af:panelTabbed> Above is my jsff code. Here how/where to add the phase listener to paopulate the managed bean while page render. Do I need to iterate the DC to get and push the each parameter in to ManagedBean or is there any easy way to do this by EL mapping directly at jsff. Please clarify.
    Thanks
    kln

    That is what exactly I am trying right now. I am binding each of my page fragment outputText item in to backing bean and by that way trying to populate the values.
    But the issue here is, the backing bean method doesn't getting any value until I hit any of the link or the button in the fragment. While loading the page the bean set and get is null. If i hit any link or button it is filled up with the vaule. As per my design, I would like to populate the bean method along with page load before any user action. But cant able to do this!! :(
    Below is my sample code what I am trying right now
            <af:panelLabelAndMessage label="#{uiBundle.NETID}" id="plam13">
                      <af:outputText value="#{bindings.netid.inputValue}" id="ot4" binding="#{UserDataBean.netId}"/>
           </af:panelLabelAndMessage>
    backing bean ex:
    private RichOutputText netId;
    static String netidVal;
        public void setNetId(RichOutputText netId) {
           netidVal= netId.getValue() == null? "":netId.getValue().toString();
           this.netId = netId;
        public RichOutputText getNetId() {
           return netId;
        public String getNetIdVal() {
           return netidVal;
        }Thanks
    kln

  • Good Helping material for Java Embedding Activity

    I want some good tutotial on Java Embedding activity and their use. And how to get the values inside Java Embedding activity and see logs at which location ?
    Is there anyway to print System.out statement in Java Embedding activity ? Where to see the logs and values and how to debug it ??
    Thanks

    This will help you ...
    http://cn.forums.oracle.com/forums/thread.jspa?messageID=9740082
    http://mazanatti.info/index.php?/archives/48-SOA-Suite-11g-how-to-use-its-native-logging-mechanism.html
    Thanks,
    N

  • Query regarding java embedding activity in Oracle SOA Suite 11g

    Hi,
    Recently I've come across a scenario in my project. I've got a BPEL process with a java embedding activity. Now that java embedding activity calls a java class similar to the code below :-
    >ArrayList<MyData> data=MSExcelParser.getData();
    Now, after getting this data inside the java embedding, I need to populate a BPEL variable. The BPEL variable is based on an XSD element "BPELVariable" which looks something like the below snippet :-
    ><xsd:element name="BPELVariable" type="BPELVariableType"/>
    > <xsd:complexType name="BPELVariableType">
    > <xsd:sequence>
    > <xsd:element name="MyData" type="MyDataType" maxouccurs="unbounded"/>
    > </xsd:sequence>
    ></xsd:complexType>
    So the BPEL variable that I want to populate can contain multiple "MyData" tags. Now my question is how can I populate the variable from my java embedding activity once I've got the list. Is it possible?
    Thanks,
    Rahul

    I think we can exchange only data types, i dont see any data type which can hold the object types.
    If you find anything better let us know.
    Constructing string xml and converting to xml is best option i can think of.
    Thanks,
    Vijay

  • Set credential using java embedding activity in SOA11g

    Hi,
    In SOA 10g in java embedding activity we used to set the creadentials like below
    *try {*
    getLocator().lookupProcess("bpelprocess_name").getDescriptor().getPartnerLinkBindings().getPartnerLinkBinding("partnerlink_name").setPropertyValue("basicHeaders",inputvar1);
    *}catch(Throwable ex) {*
    when we try to use the above expression in SOA11g, it doesn't work even after importing mandatory libraries. Pls suggest how to set the security credentials ln SOA11g using Java Embedding.
    Thanks,
    AB

    I can call the service from SOAP UI by providing username and password.Where do you provide username and password in SOAPUI?
    Service endpoint is like : https://myhost.com/ccx/service/hr...It is a SSL call so you need to configure the trust and identity keystore at Weblogic (SOA) server as well. make sure that you have imported the target server's certificate (along with it's CA if any) in your trust store of weblogic. You may refer-
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13707/identity_trust.htm#i1202182
    If it is two way SSL then the target server will also need your server's certificate in it's trust keystore.
    Regards,
    Anuj

Maybe you are looking for