Unable to setVariableData in Java Embedding BPEL

Hi Folks,
I am a new bee to BPEL. I am trying to set a variable which has been declared in BPEL process from a Java program but it is failing with an error,
"[scac] E:\JDeveloper\mywork\SOADeveloperCookBook\ReadConfigurationProject\SCA-INF\bpel\BPELRe~0\src\orabpel\bpelreadconfigurations\ExecLetBxExe2.java:101: cannot find symbol
[scac] symbol : variable configData"
Even though configData variable is declared in BPEL process it is throwing cannot find symbol error.
Following are import statements and java source code defined in .bpel file:
<bpelx:exec import="java.io.*"/>
<bpelx:exec import="java.util.Properties"/>
<bpelx:exec name="Java_Embedding" version="1.5" language="java">
<![CDATA[/*Write your java code below e.g.      
     System.out.println("Hello, World");     
            try      
              Properties prop = new Properties();      
                BufferedReader br = null;      
         //InputStream is = new FileInputStream("E:/POC/sample.properties");       
         //prop.load(is);      
         File file = new File("E:/POC/service-config.xml");      
         System.out.println("Configuration file details"+file);      
         br = new BufferedReader(new FileReader("E:/POC/service-config.xml"));      
         String data = "";      
          StringBuilder xmlDataStr = new StringBuilder();      
          if(br != null)      
               while((data = br.readLine()) != null)      
                    xmlDataStr.append(data);      
          String configFile = xmlDataStr.toString();
setVariableData("configData",configFile);
addAuditTrailEntry("Configuration details"+configData);
System.out.println("CONFIG FILE IN STRING FORMAT"+configFile);
     catch(Exception ex)
          ex.printStackTrace();
     }]]>
</bpelx:exec>
Could you please advice where I am going wrong?
Thanks,
Paneendra
Edited by: 983077 on Mar 22, 2013 2:25 AM

What is the variable type of configData? if this is simple type string then you can assign the value directly else if the variable of type xsd element or message type the syntax looks as below
setVariableData("variablename","partname","xpath",data);
e.g
setVariableData("outputVariable","payload","/client:HelloJavaEmbedBPELProcessResponse/client:result",xmlData);
Mark the posting appropriately as "helpful" or "correct answer", if your issue is solved.
Regards
Albin I
[http://www.albinsblog.com/]

Similar Messages

  • Java Embedding BPEL activity connecting to UCM Stellent

    Hi..
    Im trying to connect UCM (Stellent) through Java embedding BPEL activity. The code as shown below.
    ****java embed in BPEL*******
    SearchImpl searcont = new SearchImpl();
    Element ssn = (Element)getVariableData("inputVariable","payload","/client:BPELContentProcessRequest/client:input");
    int resultlen = searcont.StellentImpl(ssn.getFirstChild().getNodeValue());
    addAuditTrailEntry("Result Count is : " + resultlen);
    System.out.println("Executing SearchImpl in BPEL: result count is: " + resultlen);
    setVariableData("outputVariable", "payload","/client:BPELContentProcessResponse/client:result", new Integer(resultlen));
    ****java embed in BPEL*******
    We are using SOAP wsdls of Stellent to get content information. As such here we are using Search.wsdl and converted to web proxies and thereby import them in Java codes.
    When we deploy the BPEL process in SOA server we get the follwoing error in the Audit trail.
    2009/01/05 18:41:36 "{http://schemas.oracle.com/bpel/extension}runtimeFault" has been thrown.less
    -<runtimeFault xmlns="http://schemas.oracle.com/bpel/extension">
    -<part name="code">
    <code>java.lang.NullPointerException
    </code>
    </part>
    -<part name="summary">
    <summary>null
    </summary>
    </part>
    -<part name="detail">
    <detail>[Ljava.lang.StackTraceElement;@10df2d6
    </detail>
    </part>
    </runtimeFault>
    On checking the server logs it seems that its unable to instantiate the SearchSoapClient in the web proxy(Search.wsdl).
    09/01/05 15:46:53 cannot locate service implementation class for service: search.proxy.runtime.Search_Impl
    *09/01/05 15:46:53 at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:105)*
    **09/01/05 15:46:53 at oracle.j2ee.ws.client.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:121)**
    **09/01/05 15:46:53 at search.proxy.SearchSoapClient.<init>(SearchSoapClient.java:18)**
    **09/01/05 15:46:53 at com.dso.content.SearchImpl.StellentImpl(SearchImpl.java:19)*09/01/05 15:46:53 at bpel.bpelcontent.ExecLetBxExe6.execute(ExecLetBxExe6.java:88)*09/01/05 15:46:53 at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__executeStatements(BPELXExecWMP.java:49)
    09/01/05 15:46:53 at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:195)
    09/01/05 15:46:53 at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3271)
    09/01/05 15:46:53 at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1697)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:184)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:269)
    09/01/05 15:46:53 at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5244)
    09/01/05 15:46:53 at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1083)
    09/01/05 15:46:53 at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:530)
    09/01/05 15:46:53 at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:333)
    09/01/05 15:46:53 at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
    09/01/05 15:46:53 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    09/01/05 15:46:53 at java.lang.reflect.Method.invoke(Method.java:585)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    09/01/05 15:46:53 at java.security.AccessController.doPrivileged(Native Method)
    09/01/05 15:46:53 at javax.security.auth.Subject.doAs(Subject.java:396)
    09/01/05 15:46:53 at com.evermind.server.ThreadState.runAs(ThreadState.java:622)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    09/01/05 15:46:53 at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    09/01/05 15:46:53 at CubeDeliveryBean_LocalProxy_4bin6i8.handleInvoke(Unknown Source)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:138)
    09/01/05 15:46:53 at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
    09/01/05 15:46:53 at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
    09/01/05 15:46:53 at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
    09/01/05 15:46:53 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    09/01/05 15:46:53 at java.lang.reflect.Method.invoke(Method.java:585)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    09/01/05 15:46:53 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    09/01/05 15:46:53 at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    09/01/05 15:46:53 at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
    09/01/05 15:46:53 at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
    09/01/05 15:46:53 at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
    09/01/05 15:46:53 at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
    09/01/05 15:46:53 at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
    09/01/05 15:46:53 at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
    09/01/05 15:46:53 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
    09/01/05 15:46:53 at java.lang.Thread.run(Thread.java:595)
    Is there any possible solution to resolve this issue. we have included all jar files. Do we have to any configuration in server.xml of SOA server to make the Stellent connections work..
    Kindly assist regarding this issue. Thanks in advance.

    I got the solution.
    Re: Connecting to UCM (Stellent) using Java embedding BPEL activity

  • Restricting actions in "Java Embedding" BPEL component

    While playing around with BPEL processes in Oracle SOA Suite 11g, I found that a System.exit(1) in the Java Embedding component actually shuts down the weblogic server. Are there means to restrict similar code from executing (such as by assigning specific security policies)?
    I'd assume that if the implementation of Java Embedding forks a new JVM to execute the embedded code, this problem wouldn't have occurred. Is there some way in SOA suite to specify this behavior?
    Appreciate your response,
    ~Raman

    What is the variable type of configData? if this is simple type string then you can assign the value directly else if the variable of type xsd element or message type the syntax looks as below
    setVariableData("variablename","partname","xpath",data);
    e.g
    setVariableData("outputVariable","payload","/client:HelloJavaEmbedBPELProcessResponse/client:result",xmlData);
    Mark the posting appropriately as "helpful" or "correct answer", if your issue is solved.
    Regards
    Albin I
    [http://www.albinsblog.com/]

  • How to use setVariableData in Java Embedding in BPEL 2.0

    Hi,
    I need to use the code setVariableData("outPutVariable","payload","/client:processResponse/client:result","ABCDE") in BPEL 2.0
    What code should I write in BPEL 2.0?
    i.e.
    BPEL 1.1 - setVariableData("outPutVariable","payload","/client:processResponse/client:result","ABCDE")
    BPEL 2.0 - ????
    Regards,
    Sam

    Hi,
    Give like given below
    setVariableData("outputVariable","payload","/client:processResponse","ABCDE") .
    change outPutVariable to outputVariable and remove /client:result
    if you have "/client:result" it will not assign.I am also looking for the reason.
    Thanks,
    Srinivas.

  • Unable to deploy BPEL with java embedding

    Hi ,
    I have created a simple BPEL Process with java embedding for over ruling the BPELinstance name in it .But I am unable to deploy as Jdeveloper is showing that jar files should be included in the classpath ,though I had included in the class path. Below are my code and the error which is shown by the Jdeveloper.
    <bpelx:exec name="JavaSetTitle" language="java" version="1.4">
    <![CDATA[
    Element inVarElem = (Element)getVariableData("inputVariable"
    , "payload"
    , "/client:HelloWorldProcessRequest/client:input");
    try
    String inputdata = inVarElemOrpsId.getNodeValue();
    String title = "HelloWorld " + inputdata;
    setTitle(title);
    addAuditTrailEntry("New Title is: >" + title + "<");
    catch (Exception ex)
    ex.printStackTrace();
    }]]>
    </bpelx:exec>
    Error:
    Error: Java compilation failed.
    Failed to compile file(s) "TestBPEL.bpel".
    Exception reported is: TestBPEL.bpel:64: Class bpel.testbpel.Element not found.
    Element inVarElem = (Element)getVariableData("inputVariable"
    ^
    TestBPEL.bpel:64: Class bpel.testbpel.Element not found.
    Element inVarElem = (Element)getVariableData("inputVariable"
    ^
    TestBPEL.bpel:69: Undefined variable or class name: inVarElemOrpsId
    String inputdata = inVarElemOrpsId.getNodeValue();
    ^
    3 errors
    Please verify that file TestBPEL.bpel is valid java file or if all required libraries are included in your classpath.
    classpath: ..\..\..\classes;..\..\ide\lib\javax-ide.jar;..\..\ide\lib\javatools.jar;..\..\ide\lib\ide.jar;..\..\jlib\jewt4.jar;..\..\jlib\share.jar;..\..\jlib\help4.jar;..\..\jlib\inspect4.jar;..\..\lib\xmlparserv2.jar;..\..\jdbc\lib\orai18n.jar;..\lib\jdev-ep.jar;..\..\jdk\lib\tools.jar;..\..\jdk\lib\dt.jar;..\lib\ext\jaxen-1.1-beta-4.jar;..\extensions\oracle.ide.10.1.3.jar;..\..\jlib\ojmisc.jar;..\extensions\oracle.jdeveloper.10.1.3.jar;..\lib\jdev.jar;..\lib\ojc.jar;..\..\jlib\regexp.jar;..\..\ant\lib\ant.jar;..\..\ant\lib\ant-..................

    Or try removing the client: from your original code
    <bpelx:exec name="JavaSetTitle" language="java" version="1.4">
    <![CDATA[
    Element inVarElem = (Element)getVariableData("inputVariable"
    , "payload"
    , "/HelloWorldProcessRequest/input");
    try
    String inputdata = inVarElemOrpsId.getNodeValue();
    String title = "HelloWorld " + inputdata;
    setTitle(title);
    addAuditTrailEntry("New Title is: >" + title + "<");
    catch (Exception ex)
    ex.printStackTrace();
    }]]>
    </bpelx:exec>cheers
    James

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

  • Invocation error in Java Embedding activity of BPEL process in 10g

    Hi,
    I am facing an issue as below in Java embedding activity of BPEL process in 10g...
    Could not invoke: "GTM servlet URL" with verb: POST and context: null
    and the code in java embedding activity is as below...
    // create a new rest invoker stub
    RestInvocation invocation = new RestInvocation();
    org.w3c.dom.Element callOtm_process_InputVariable = (org.w3c.dom.Element)getVariableData("Variable_GTMTransmission");
    // get the result el - so we can derive the namespace needed
    org.w3c.dom.Element callOtm_process_OutputVariable = (org.w3c.dom.Element)getVariableData("Variable_GTMTransmissionAck");
    String GTMURL = "GTM servlet URL";
    try
    callOtm_process_OutputVariable = invocation.invoke
    (callOtm_process_InputVariable, "GET", GTMURL, null,
    callOtm_process_OutputVariable.getNamespaceURI());
    setVariableData("Variable_GTMTransmissionAck", callOtm_process_OutputVariable);
    } finally
    addAuditTrailEntry(invocation.getAuditAsString());
    If anybody is aware of this error, please help me to resolve this issue.
    Thanks in advance.

    Try copy the code from java embedding and paste it to eclipse and run it from there. you will find the exact issue.
    Thanks

  • Java Embedding setVariableData not working - Urgent

    Hi Guys,
    I tried a simple HelloWord/Echo Kinda example, accessing input variable using getVariableData and assigning it to output variable using setVariable data in Java Embedding. It's throwing an error.
    JavaEnbedCode :
    String xmlData = ((oracle.xml.parser.v2.XMLElement) getVariableData("inputVariable","payload","/client:HelloJavaEmbedBPELProcessRequest/client:input")).getFirstChild().getNodeValue();
    setVariableData("outputVariable","payload","/client:HelloJavaEmbedBPELProcessResponse/client:result",xmlData);
    Imports:
    <bpelx:exec import="java.util.*"/>
    <bpelx:exec import="java.lang.*"/>
    <bpelx:exec import="java.rmi.RemoteException"/>
    <bpelx:exec import="javax.naming.NamingException"/>
    <bpelx:exec import="org.w3c.dom.Element"/>
    <bpelx:exec import="java.math.*"/>
    <bpelx:exec import="java.io.*"/>
    <bpelx:exec import="java.net.*"/>
    Error:
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {}
    parts: {{summary=&lt;summary>XPath query string returns zero node.
    According to BPEL4WS spec 1.1 section 14.3, The assign activity &amp;amp;lt;to&amp;amp;gt; part query should not return zero node.
    Please check the BPEL source at line number "" and verify the &amp;amp;lt;to&amp;amp;gt; part xpath query.
    &lt;/summary>
    </summary>
    </part></selectionFailure>
    I am using Jdev 10.1.3.3 and SOA Suite 10.1.3.3
    Thanks in adavance.

    I gave up trying to reference elements, especially those that are accessed through the input and output messages and leave that up to BPEL Assigns. So my inline Java looks like this and it works in 10.1.3.3.
    Hopefully the forum leaves enough of the formatting intact for you to get the idea.
    /*Write your java code below e.g.
         System.out.println("Hello, World");
    try{                                                              
    String in = (String)getVariableData("Input_Value");
    addAuditTrailEntry("You Entered: " + in);
    int InvalidCharsFound = 0;
    String ValidChars="0123456789.";
    String FilteredChars="$ ,";
    String TempChar="";
    String Tempstring="";
    int innum;
    double inval;
    innum=in.length();//get string length
    for (int i=0;i<innum;i++){         
    TempChar = in.substring(i,i+1);
    if (ValidChars.contains(TempChar)){         
    Tempstring+=TempChar;
    else {         
    if (FilteredChars.contains(TempChar)){   
    //filtered char was found
    addAuditTrailEntry("A filtered character was found such as: " + FilteredChars);
    else{   
    //invalid chars
    InvalidCharsFound = 1;
    addAuditTrailEntry("An invalid character was found");
    if (InvalidCharsFound == 0){  
    //clean number input was detected so proceed.
    inval = Double.valueOf(Tempstring).doubleValue();
    inval *= 100;//multiply by 100
    addAuditTrailEntry("Times 100 is: " + inval);
    double out = Math.rint(inval);
    addAuditTrailEntry("Rounded is: " + out);
    out /= 100;
    addAuditTrailEntry("Divided by 100 is: " + out);
    DecimalFormat myFormatter = new DecimalFormat("###.00");
    String output = myFormatter.format(out);
    addAuditTrailEntry("Formated is: " + output);
    setVariableData("Output_Value",output);
    else
    // The number input was not a good clean number
    setVariableData("Output_Value","ERROR the input was not a number");
    catch(Exception e){                                                                    
    addAuditTrailEntry(e);
    If you actually find this Java example that I made usefull keep in mind the Math.rint
    function incorrectly rounds 100.5 to 100 instead of 101. Or in other words with this program if you try to round 100.245 it will produce 100.24. This is not a problem for what I'm using it for as I'm simply trying to correct small inaccuracies found when adding 2 currency numbers using BPEL see Bug No. 6451541
    As far as the Math.rint "bug" I have found this same issue duscussed on the sun java forums and as far as I can tell someone who is mathematically brilliant (compared to me) decided that this was the correct way to round. I'm glad I'm not in school any more.
    Oh the complete BPEL source looks like this (I probably should have included this instead)
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Tue Sep 04 10:45:03 PDT 2007
    Author: RTaylor
    Purpose: Synchronous BPEL Process
    -->
    <process name="BPEL_Round_Currency"
    targetNamespace="http://xmlns.oracle.com/BPEL_Round_Currency"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:client="http://xmlns.oracle.com/BPEL_Round_Currency"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:BPEL_Round_Currency"
    myRole="BPEL_Round_CurrencyProvider"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <!-- Reference to the message that will be returned to the requester-->
    <variable name="inputVariable"
    messageType="client:BPEL_Round_CurrencyRequestMessage"/>
    <variable name="outputVariable"
    messageType="client:BPEL_Round_CurrencyResponseMessage"/>
    <variable name="Input_Value" type="xsd:string"/>
    <variable name="Output_Value" type="xsd:string"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPEL_Round_Currency.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:BPEL_Round_Currency" operation="process"
    variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <assign name="Copy_Input">
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:BPEL_Round_CurrencyProcessRequest/client:input"/>
    <to variable="Input_Value"/>
    </copy>
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:BPEL_Round_CurrencyProcessRequest/client:input"/>
    <to variable="Output_Value"/>
    </copy>
    </assign>
    <bpelx:exec import="java.text.DecimalFormat"/>
    <bpelx:exec name="Round_Output" language="java" version="1.3">
    <![CDATA[/*Write your java code below e.g.                                       
         System.out.println("Hello, World");                                      
    try{                                                              
       String in = (String)getVariableData("Input_Value");                                                                   
       addAuditTrailEntry("You Entered: " + in);  
       int InvalidCharsFound = 0;  
       String ValidChars="0123456789.";   
       String FilteredChars="$ ,";   
       String TempChar="";         
       String Tempstring="";         
       int innum;         
       double inval;         
       innum=in.length();//get string length         
       for (int i=0;i<innum;i++){         
              TempChar = in.substring(i,i+1);         
              if (ValidChars.contains(TempChar)){         
                  Tempstring+=TempChar;         
    else {         
    if (FilteredChars.contains(TempChar)){   
    //filtered char was found
    addAuditTrailEntry("A filtered character was found such as: " + FilteredChars);
    else{   
    //invalid chars
    InvalidCharsFound = 1;
    addAuditTrailEntry("An invalid character was found");
    if (InvalidCharsFound == 0){  
    //clean number input was detected so proceed.
    inval = Double.valueOf(Tempstring).doubleValue();
    inval *= 100;//multiply by 100
    addAuditTrailEntry("Times 100 is: " + inval);
    double out = Math.rint(inval);
    addAuditTrailEntry("Rounded is: " + out);
    out /= 100;
    addAuditTrailEntry("Divided by 100 is: " + out);
    DecimalFormat myFormatter = new DecimalFormat("###.00");
    String output = myFormatter.format(out);
    addAuditTrailEntry("Formated is: " + output);
    setVariableData("Output_Value",output);
    else
    // The number input was not a good clean number
    setVariableData("Output_Value","ERROR the input was not a number");
    catch(Exception e){                                                                    
    addAuditTrailEntry(e);
    }]]>
    </bpelx:exec>
    <assign name="Copy_Output">
    <copy>
    <from variable="Output_Value"/>
    <to variable="outputVariable" part="payload"
    query="/client:BPEL_Round_CurrencyProcessResponse/client:result"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client"
    portType="client:BPEL_Round_Currency" operation="process"
    variable="outputVariable"/>
    </sequence>
    </process>

  • Issue with java embedding activity in bpel 2.0

    Hi.
    I tried the following code inside BPEL 2.0
    <extensionActivity>
    <bpelx:exec name="MillitoDate" language="java">
    <import location="java.text.DateFormat" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.text.SimpleDateFormatt" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.util.Calendar" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.util.*" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.lang.*" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.io.**" importType="http://schemas.oracle.com/bpel/extension/java"/>
    <![CDATA[
    DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
    Calendar calendar = Calendar.getInstance();
    long now = 1365523483000L;
    calendar.setTimeInMillis(now);
    String s=formatter.format(calendar.getTime());
    setVariableData("outputVariable","payload","/client:processResponse/client:result",s);
    ]]>
    </bpelx:exec>
    </extensionActivity>
    But, I am getting following error while deploying "the exception reported is: java.lang.RuntimeException: failed to compile execlets of CleanupProcess". Also, i Tried adding try catch block but no succèss, thé same code is working perfectly in java project.

    Hello Rolando Carrasco,
    Thank for responding my question. I figure out the issue. It is because we need to import the java API's what we are using in the java embedding.
    Thank you,
    Raj

  • Issue with Java Embedding task in BPEL

    Newbe: i have java embedded task in my bpel process which returns one variable(Written java code in editor as it is only 2 lines of code). when i tried to deploy this i am getting the following compiler error in Jdeveloper
    Error(36,39): Failed to compile bpel generated classes.
    failure to compile the generated BPEL classes for BPEL process "BPELSampleProcess" of composite "default/BpelSampleProj!1.4"
    The class path setting is incorrect.
    Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.
    please suggest me what are the jars needed and where to be placed.

    Try this
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100);
    setVariableData("outputVariable","payload","/client:BPEL_Process/client:result",randomInt);
    Delete this line public class ChSam
    Edited by: KrishnaChaitanya on Nov 25, 2010 9:30 PM

  • 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"/>

  • Using embedded Java in BPEL 2.0

    I have found a lot of write ups but am having difficulty.
    My problem is a failure to deploy by composite. I get the message below:
    Redeploying on /Farm_soadev_domain/soadev_domain/AdminServer ...
    Redeploying on "/Farm_soadev_domain/soadev_domain/AdminServer" failed!
    There was an error deploying/undeploying composite on AdminServer: Error occurred during deployment of component: formatDate to service engine: implementation.bpel for composite: formatData: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "E:\Oracle\Middleware\user_projects\domains\soadev_domain\servers\AdminServer\dc\soa_c8abc64b-8475-4479-b54b-b36e4f44c37a"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of formatDate
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    To simplify the issue I have reduced my code snippet to:
    /*Write your java code below e.g.
      System.out.println("Hello, World");
    String testOne = "Hi Mom";
    The embedded section looks like:
        <extensionActivity>
          <bpelx:exec name="decodeBinary" language="java">
            <![CDATA[
    /*Write your java code below e.g. 
      System.out.println("Hello, World");
    String testOne = "Hi Mom";]]>
          </bpelx:exec>
        </extensionActivity>

    I read the blog post here
    Embedding Java in BPEL process
    Based on that I created this test class to help write code:
    The bolded code is the snippet I actually want to implement when I can solve the problem above.
    package com.f17.customfunction;
    import com.collaxa.cube.engine.ext.bpel.v1.nodes.BPELXExecLet;
    public class codeTyper extends BPELXExecLet {
        public codeTyper() {
            super();
        public void exec(){
         // below code gets pasted in here
    String input = (String)getVariableData("testfile");
    oracle.soa.common.util.Base64Decoder Decoder = new oracle.soa.common.util.Base64Decoder(); 
    try { 
    byte[] decodedByteArray = oracle.soa.common.util.Base64Decoder.decode(input.getBytes());
    setVariableData("compANDstore_merge_InputVariable.AusCreditCollection/ns2:AusCredit/ns2:fileData,decodedByteArray",decodedByteArray);
    } catch(Exception e) {
    e.printStackTrace();

  • Using Java Embedding Unzip Code and a Trigger File in a BPEL Process

    Hello,
    Thanks in advance to anyone that contributes with any insight.  It is much appreciated.  Having said that I will get to the crux of my problem.
    I am currently using Oracle 11g.  I have created a SOA composite application that incorporates BPEL and Java.  I have the code needed to unzip and extract compressed folders.  However, when this was first built out using BPEL it automatically created a web service in the "exposed service" lane and not a file adapter which I believe is needed in order to trigger the process via a start.txt file for example.  Based on what I know ... this web service automatically connecting to the BPEL process was simply due to the order of operations, etc.  So by creating a 'read' file adapter first and then creating the BPEL process and selecting the template "Define Service Later", it does not automatcially connect the web service to the BPEL process and it will allow me to connect a file adapter to this BPEL process instead ... great.  When opening up the BPEL file I then connect a recieve component to this file adapter and configure appropriately.
    Essentially, my objective in setting up a trigger to start this unzip process is due to the BPEL process before that outputs or writes the .zip folder to the same directory that I want to poll and/or trigger via a start.txt file.  I can get this process to work with a webservice connecting to the BPEL process and by using a Java Embedded in BPEL file, which in turns calls the package/ class that has the java code needed to unzip.
    For some reason whenever I try to use a file adapter instead of the native web service that gets created (as mentioned above) it doesn't work.  It seems to build or compile just fine however, I am getting errors when I try to deploy.
    Note:  The Java code contains all the paths where the zip file is to be taken from and extracted to.  So because this is in the code I don't need the file adapter to handle this.  I just want to use the file adapter so that I can trigger the process via start.txt or something of that nature.
    Thanks to anyone that has any suggestions.
    Kind Regards,
    Kevin
    Errors when attempting to deploy are as follows:
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] HTTP error code returned [500]
    [04:12:54 PM] Error message from server:
    There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: BPELProcess1 to service engine: implementation.bpel, for composite: Job2_UnZip: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "H:\Oracle\Middleware\user_projects\domains\Dev_Acorde\servers\soa_server1\dc\soa_d78eb301-314c-422a-a748-bcfe7d0906e8"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of BPELProcess1
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    [04:12:54 PM] Check server log for more details.
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] ####  Deployment incomplete.  ####
    [04:12:54 PM] Error deploying archive file:/C:/JDeveloper/mywork/Job2_UnZip/Job2_UnZip/deploy/sca_Job2_UnZip_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Just wanted to provide a screenshot of the BPEL file as supporting documentation to better illustrate my issue.
    Thanks so much,
    Kevin

  • Java Embedding bug in SOA Suite 11g BPEL??

    I am beginning to wonder if there is a 'bug' in the SOA Suite 11g, BPEL, Java Embedding activity? Need some help as soon as possible – does the Java Embedding activity work in SOA Suite 11g?
    Have tried the following on Jdev 11.1.1.1 and Jdev 11.1.1.3 – get the same error message (see below for error message).
    Thanks for any help - Casey
    I created a simple composite app by:
    1.     Created a Composite with BPEL Process
    2.     Created a BPEL variable by the name of Variable and a Simple Type of string      ({http://www.w3.org/2001/XMLSchema}string)
    3.     Added an Assign activity (Assign_1) and assigned the value of “Test Var” to the variable Variable using a Copy operation.
    4.     Then, after the assign activity, added a Java Embedding activity (Java_Embedding_1) with Java Version set to 1.5 and the following code:
    +try{+*
    String var;*
    var=(String)getVariableData(Variable);*
    System.out.println(var);*
    +}  // end try+
    +catch(Exception ex){+*
    System.out.println(ex.getMessage());*
    +}// end catch+
    Compiled and got the following error message:
    Error(23,34): Failed to compile bpel generated classes.*
    failure to compile the generated BPEL classes for BPEL process "BPELProcess1" of composite "default/Project1!1.0"*
    The class path setting is incorrect.*
    Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.*
    Code for the BPEL component is:
    +<?xml version = "1.0" encoding = "UTF-8" ?>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    Oracle JDeveloper BPEL Designer
    Created: Tue Nov 09 13:01:49 CST 2010
    Author:
    Purpose: Asynchronous BPEL Process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<process name="BPELProcess1"+
    targetNamespace="http://xmlns.oracle.com/TestgetVariable_jws/Project1/BPELProcess1"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:client="http://xmlns.oracle.com/TestgetVariable_jws/Project1/BPELProcess1"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/TestgetVariable/Project1/FileW"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    PARTNERLINKS
    List of services participating in this BPEL process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<partnerLinks>+
    +<!--+
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    +<partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>+
    +</partnerLinks>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    VARIABLES
    List of messages and XML documents used within this BPEL process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<variables>+
    +<!-- Reference to the message passed as input during initiation -->+
    +<variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>+
    +<!-- Reference to the message that will be sent back to the requester during callback -->+
    +<variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>+
    +<variable name="Variable" type="xsd:string"/>+
    +</variables>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<sequence name="main">+
    +<!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->+
    +<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>+
    +<!--+
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    +<assign name="Assign_1">+
    +<copy>+
    +<from expression='"test var"'/>+
    +<to variable="Variable"/>+
    +</copy>+
    +</assign>+
    +<bpelx:exec name="Java_Embedding_1" version="1.5" language="java">+
    +<![CDATA[/*Write your java code below e.g.+
    +     System.out.println("Hello, World");+
    +*/+
    +try{+
      +String var;+
      +var=(String)getVariableData(Variable);+
      +System.out.println(var);+
    +} // end try+
    +catch(Exception ex){+
    System.out.println(ex.getMessage());
    +}// end catch]]>+
    +</bpelx:exec>+
    +<invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>+
    +</sequence>+
    +</process>+

    Java Embedding bug in SOA Suite 11g BPEL??

  • Throwing Exception in java embedding to BPEL

    Hi,
    My requirement is that all exceptions needs to be thrown to BPEL so that the BPEL exception handler can handle it.I am using some classes through BPEL's java embedding. So any exception in them, i wud like to be propagated to BPEL. The Exception is thrown to the java embedding activity but i am not able to throw it to BPEL after that. I have to catch and handle it there itself, else the BPEL gives a compilation error.
    Can anybody please gimme a sol for this problem
    Thanks
    Ashish

    Hi,
    My requirement is that all exceptions needs to be thrown to BPEL so that the BPEL exception handler can handle it.I am using some classes through BPEL's java embedding. So any exception in them, i wud like to be propagated to BPEL. The Exception is thrown to the java embedding activity but i am not able to throw it to BPEL after that. I have to catch and handle it there itself, else the BPEL gives a compilation error.
    Can anybody please gimme a sol for this problem
    Thanks
    Ashish

Maybe you are looking for

  • How do I... Set up an entirely seperate iTunes library for my kids?

    I would like to set up an entirely separate iTunes library for my kids on the pc which currently has one iTunes library and everything we own collectively in it. There are some items not suitable for children (explicit music lyrics, "MA" or "R' movie

  • Having issues with calculations multiplying a field by 20.

    I am trying to find a correct formula that takes my field 'Quantity7' and multiplies it by 20. I have tried different forms and it always gives me an answer of 1. Quantity7 is the sum of quantities 1-6, is that where the issue is? I am so lost!

  • Reg. JSF Spring Integration issue.

    Hi All, I am using JSF for the front end and using the Spring Core, DAO and AOP for the BO and DAO layers. When i try to inject the Objects using the DI to the JSF, i am getting the following error and the objects are not getting set from the Spring.

  • Accessing default database

    i've just recently downloaded the trial version for Oracle8i Lite. The installation was successful, but when I load up SQL PLus 8.0, I am unable to access a sample database. I was told to use the username : SCOTT and psswd: TIGER , but I get a messag

  • Adobe Acrobat 11 stürzt ab, wenn mehre Dateien geöffnet sind

    Hallo, ich benutze Adobe Acrobat 11 Pro auf einem Mac Book Air mit OS X Yosemite 10.10. Sobald ich mehre PDF's gleichzeitig offen habe, stürzt Adobe ab. Ich habe das Programm schon einmal deinstalliert und neu raufgespielt, aber das Problem besteht w