How to set values to bpel variables from Java

I have a java class to create files and populate some contents into it. On success it returnes "File Created"
I used the following code to achieve it :-
WriteFiles objWriteFiles=new WriteFiles();
String para=((oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/client:FileTestProcessRequest/client:HO_ORG_ID")).getFirstChild().getNodeValue();
String result=objWriteFiles.writeHeaderInfo(para);
(writeHeaderInfo is a method in my java class)
addAuditTrailEntry(result);
I works fine..Now I want to assign this reult value to a bpel variable .. I tried doin it like below:-
setVariableData("outputVariable","payload","/client:FileTestProcessResponse/client:result" , result)
but its not working...I get a fault ...
Can anyone help me out...
Thanks,
Githa.R.S

In this example :
   <!-- Invoke the EmployeeStatus Java class instead of web service -->
   <bpelx:exec name="invokeJavaExec" language="java" version="1.4">
      <![CDATA[
         EmployeeStatus e = new EmployeeStatus();
            String firstName = ((Element)getVariableData(
                             "EmployeeTravelStatusRequest", "employee",
                             "/employee/FirstName")).getNodeValue();
            String lastName = ((Element)getVariableData(
                               "EmployeeTravelStatusRequest", "employee",
                               "/employee/LastName")).getNodeValue();
            String empStatus = e.getTravelStatus(firstName, lastName);
            addAuditTrailEntry("Employee status is: " + empStatus);
            setVariableData("EmployeeTravelStatusResponse", "travelClass",
                         "/travelClass", empStatus);
      ]]>
   </bpelx:exec>they dont use namespaces in the xpath-expression, can you try that ?

Similar Messages

  • How to set genericObject in a TaskInstance from java

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

  • XSL-How to get value of a variable from inside loop-- to the outside loop?

    Pls help
    hi im currently working on this xsl file..
    This works on generating a txt file,my problem right now is
    ' how can i get the value of a variable generated from the inside forloop,
    i have to get the total,sum value of this variables after performing the loop
    ***this is the for loop
    <xsl:for-each select="OutboundPayment">
    <xsl:variable name='id' select='generate-id(OutboundPayment)'/>
    <xsl:sort select="PaymentNumber/CheckNumber" data-type="text" />
    <xsl:variable name='PValue' select='format-number(100*PaymentAmount/Value,"0000000000000")'/>
    <xsl:value-of select='$id'/>
    <xsl:text>D</xsl:text>
    <xsl:value-of select='$DDate'/>
    <xsl:value-of select='$Batch'/>
    <xsl:text>3</xsl:text>
    <xsl:value-of select='format-number(PaymentNumber/PaymentReferenceNumber,"0000000000")'/>
    <xsl:value-of select='format-number(PayeeBankAccount/BankAccountNumber,"0000000000")'/>
    <xsl:value-of select='substring(Payee/Name,1,20)'/>
    <xsl:value-of select='$PValue'/>
    <xsl:variable name='Addend' select='concat($DDate,substring($DAcct,5,5),$Batch)'/>
    <xsl:variable name="LHash">
    <xsl:call-template name="GetHash">
    <xsl:with-param name="A1" select="$PValue" />
    <xsl:with-param name="A2" select="$Addend" />
    </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="concat('[',$LHash,']')" />
    <!--LHash*i have to get the total amount of this one from the outside loop /---->
    <xsl:call-template name='NewLine'/>
    </xsl:for-each>
    <!--I have to put in here the total value of that LHash/---->
    <!--This is the template on how to get the value of that variable in the inside loop/---->
    <xsl:template name="GetHash">
    <xsl:param name='A1'/>
    <xsl:param name='A2'/>
    <xsl:variable name='TwoSum' select='format-number($A1+$A2,"000000000000000")'/>
    <xsl:variable name='Weight' select='317191314191112'/>
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="15"/>
    <xsl:with-param name="Sum" select="$TwoSum"/>
    <xsl:with-param name="Wgt" select="$Weight"/>
    <xsl:with-param name="Tot" select="0"/>
    </xsl:call-template>
    </xsl:template>
    <xsl:template name='WDigit'>
    <xsl:param name='Cnt'/>
    <xsl:param name='Sum'/>
    <xsl:param name='Wgt'/>
    <xsl:param name='Tot'/>
    <xsl:choose>
    <xsl:when test="$Cnt > 0">
    <xsl:variable name='Multip' select='substring($Wgt,$Cnt,1)'/>
    <xsl:variable name='Factor' select='substring($Sum,$Cnt,1)'/>
    <xsl:variable name='Prduct' select='$Multip$Factor'/>
    <!--xsl:value-of select="concat($Tot,'[',$Cnt,']')"/-->
    <!--xsl:value-of select="concat($Multip,'x',$Factor,'=',$Prduct)"/-->
    <!--xsl:call-template name='NewLine'/-->
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="$Cnt - 1"/>
    <xsl:with-param name="Sum" select="$Sum"/>
    <xsl:with-param name="Wgt" select="$Wgt"/>
    <xsl:with-param name="Tot" select="$Tot+$Prduct"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variable name="Rem" select="$Tot mod 11"/>
    <xsl:variable name="Chk" select="11 - $Rem"/>
    <xsl:value-of select="format-number(concat($Tot,$Chk),'00000')"/>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:template name='GetTotal'>
    </xsl:template>
    Thanks in advance for those who are willing to help.
    -Leighya

    It would have helped if you had posted your code as CODE but as it is, I could hardly read it. My guess about what you are asking is, if you want a template to return a value, just write that value to the result stream inside the template.
    If that wasn't what you were asking, then please post your code in a readable format.

  • How to set values in a JSP from DTO

    My requirement is to print matrix report of students and their subject markets
    Student Name | Sub1 Sub 2 ...........
    Std Name1
    Std Name 2
    That is printing subject names horizontally and student names vertically.
    <c:forEach items="${dto.subList}" var="item" varStatus="count">
              td><c:out value="${item.sub_name}"/> </td>
    </c:forEach>
    <tr>
    <c:forEach items="${dto.StudentsList}" var="item" varStatus="count">
    <c:set value="${count.count}" var="totalstudents"/>
    <tr class="odd">
         <td><c:out value="${item.student_name}"/> </td>
    <c:forEach items="${dto.subList}" var="item" varStatus="count">
         <c:set value="${dto.marksList}" var="item"/>
          </td>
    </c:forEach>     
    </tr></c:forEach>
    i have done upto this part. wat i need is for each student it needs to check sub1 and soon and put that marks in that sub place

    public DTO GenerateMatrixReport(DTO params) throws DAOException
         DTO resultDto = new DTO();
    int totalstudents = new Integer(params.get("totalstudents").toString()).intValue();
    int totalsubjects = new Integer(params.get("totalsubjects").toString()).intValue();
         for(int i=1;i<=totalstudents;i++)
              List list = new ArrayList();
         for(int j=1;j<=totalsubjects;j++)
                   list = new ArrayList();
         list.add(params.get("email"+i));
                   list.add(params.get("subject_name"+j));
                   list.add(changeDateToDBFormat((String)params.get("start_date")));
                             list.add(changeDateToDBFormat((String)params.get("end_date")));
                             DTO tempDto = super.get("SQL QUERY",list);
                             if(null != tempDto.getDataList());
                                  List l1=new ArrayList();
                                  l1 = tempDto.getDataList();
                                  if(l1 != null)
                                       for(int k=0;k<l1.size();k++)
                                            Map m =(Map)l1.get(k);
                                            m.put("marks",""+new Double(m.get("marks").toString()).doubleValue());
                                            tempList.add(m);
                                  else
                                       System.out.println(0);
                   resultDto.put("ubjectList",getAllSujectNames());
                   resultDto.put("studentsList",getAllStudents());
                   resultDto.put("marksList",tempList);
                   return resultDto;
              public Collection getAllSujectNames() throws DAOException
                   Collection list = new ArrayList();
                   DTO resultDto = super.get(Utility.getSQL("getallsubjectnames"),new ArrayList());
                   if(null != resultDto.getDataList())
                        List tempList = resultDto.getDataList();
                        for(int i=0;i<tempList.size();i++)
                             Map m = (Map)tempList.get(i);
                             m.put("subject_name",m.get("subject_name"));
                             list.add(m);
                   return list;
              public Collection getAllStudents() throws DAOException
                   Collection list = new ArrayList();
                   DTO resultDto = super.get(Utility.getSQL("getallstudents"),new ArrayList());
                   if(null != resultDto.getDataList())
                        List tempList = resultDto.getDataList();
                        for(int i=0;i<tempList.size();i++)
                             Map m = (Map)tempList.get(i);
                             m.put("student_name", m.get("first_name") + " " + m.get("last_name"));
                             m.put("email",m.get("email"));
                             list.add(m);
                   return list;
    These are the methods iam using ,can u set me the solution to print the values in matrix format

  • How to set values to unniverse prompts through java

    Hi
    I am using JAVA -BOSDK to access reports from infoview. I have a problem when any universe level prompt is present in the report. I am able to retrieve it through java when i say documentInstance.getPrompts() and when i set values to this prompt by Prompt.enterValues(String[] parameters) and then either save the report or saveAs another report , my new values dont get applied to the prompt. Only previous values get applied to the prompt. I checked doing prompt.getPreviousValues and prompt.getCurrentValues but when i save the doc then new values are not set.
    here is a part of code iam using: the filterlist contains the ConditionFilterDataItems objects which contain the operands,operator and queryObjectName .I have added multiple prompt.getPrevious and current values for debug purpose.
    private static void applyValuesToUniversePrompt( final DocumentInstance doc, final List filterList )
            final DataProviders dps = doc.getDataProviders() ;
            final DataProvider dataProvider = dps.getItem( 0 ) ;
            final Query query = dataProvider.getQuery() ;
            Prompts newPrompts = doc.getPrompts();
            Prompt newprompt = newPrompts.getItem( 0 );
            newprompt.getPreviousValues();
            newprompt.getCurrentValues();
            final ConditionContainer conditioncont = (OMConditionContainer) query.getCondition() ;
            ConditionFilterDataItem conditionFilterDataItem = null ;
            final Map promptMap = generateInstanceMap( doc ) ;
            //Prompt [] promptArr ;
            for( int i = 0 ; i < filterList.size() ; i++ )
                conditionFilterDataItem = (ConditionFilterDataItem) filterList.get( i ) ;
                final String [] operands = conditionFilterDataItem.getFilterOperand() ;
                PromptsImpl univPrompts = (PromptsImpl)doc.getPrompts();
                Prompt [] promptArr = new Prompt[univPrompts.getCount()];
                for(int k= 0;k< univPrompts.getCount();k++)
                     promptArr[k] =(Prompt) univPrompts.getItem( k );
                if(univPrompts.getCount()==0)
                    promptArr=null;
              if(promptArr!=null)
                for( int j = 0 ; j < promptArr.length ; j++ )
                    final Prompt prompt = promptArr [j] ;
                    final String promptName = prompt.getName() ;
                    final Prompt currentPrompt = (Prompt) promptMap.get( promptName ) ;
                    if( operands [j] != null )
                        currentPrompt.getPreviousValues();
                        currentPrompt.getCurrentValues();
                        currentPrompt.removeValues( currentPrompt.getPreviousValues() );
                        currentPrompt.enterValues( convertStringToArray( operands [j] ) ) ;
                        currentPrompt.getPreviousValues();
                        currentPrompt.getCurrentValues();
                        doc.setPrompts();
                        newPrompts = doc.getPrompts();
                        newprompt = newPrompts.getItem( 0 );
                        newprompt.getPreviousValues();
                        newprompt.getCurrentValues();
            //doc.setPrompts() ;
            doc.refresh();
            doc.save();
            newPrompts = doc.getPrompts();
            newprompt = newPrompts.getItem( 0 );
            newprompt.getPreviousValues();
            newprompt.getCurrentValues();
           // dataProvider.runQuery() ;
            doc.refresh();
            doc.saveAs( "universePrompt2",7148,null,null ) ;
             doc.closeDocument() ;
    private static Map generateInstanceMap( final DocumentInstance document )
            final Map promptMap = new HashMap() ;
            final Prompts prompts = document.getPrompts() ;
            int count ;
            if( prompts != null )
                count = prompts.getCount() ;
                for( int i = 0 ; i < count ; i++ )
                    final Prompt prompt = prompts.getItem( i ) ;
                    promptMap.put( prompt.getName(), prompt ) ;
            return promptMap ;

    Hi Shruti,
    Can U kindly refer this [thread|BusinessObjects Enterprise Java Software Development Kit (SDK) ??; and reply back.
    Would appreciate your efforts !!!

  • How to set value of application item using Java script.

    I have created a textbox on page 0, on chnage of textbox i want to set the value of application item.
    How to write the code to set & get value of application item.
    Thanks,
    -Amit

    Hello Amit
    This would be a great place to start...
    JavaScript
    Alternatively, APEX 4.0 will make this sort of task declarative.
    Kind regards
    Simon Gadd

  • How to call a BPEL process from Java ?

    How can I call a BPEL process from Java?
    The Java client should be outside of the PEL engine.
    Does someone have a piece of sample code for
    a "Hello world" java-to-bpel call (+ java client src)?

    http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial7-InvokingBPELProcesses.pdf

  • How to set value to dimension1,2,3 column in AP Invoice?

    Dear All,
    I have a problem when creating AP Invoice using SAP B1 2005 B DI/API. The problem is when i can not find dimension1, dimension2, and dimension3 properties in oDraft.Lines. (oDraft is my variable for object  oPurchaseInvoices).
    How to set value to dimension1,2,3 column in AP Invoice using DI/API ?
    Regards,
    Herfin J.

    Hi! Yatsea,
    I am working with 2007B, In the order reference of B1WS, I found only CostingCode and COGSCostingCode provided:
    OrdersService.DocumentDocumentLine.CostingCode() As String
    OrdersService.DocumentDocumentLine.COGSCostingCode() As String
    Where are the rest 4 dimensions for both of them?
    Plus, I also got the XML from DI server, with only one CostingCode exposed.
    Thanks
    Constantine

  • How to set value on MRU insert Tabular Form

    This post refers to the forum article found How to set value on MRU insert Tabular Form
    I have included the problem and proposed solution below. My problem follows
    Problem
    Hi,
    I am using a Tabular Form. I used the wizard and it created all of the items (Cancel, Submit, Add, Multidelete buttons, etc.). I have a table that is like an FK table. For instance, we could have a customer table, and then a customer address table. Each customer could have multiple addresses. In the address table, the first ID column is the customer ID. So in using the tabular form for the addresses, I need to make the first column the same when I insert. But when I choose add row, everything works fine except it tries to insert a null into customer id. The uniqueness of the row is determined by customer ID and address string.
    Any time I make it to this screen, all new rows will have the same ID with I have in a variable that I can reference from the page called :P0_ITM_CUST_ID.
    How do I set the first value for all inserts? My guess is I need to do this in Computations. I'm also guessing I need to do this with a replace statement. I'm just not sure how to reference the first column of the new row.
    Thanks!
    Tim
    Solution
    The way to do this is by using the "Default" value for that Column. Go to
    Home>Application Builder>Application xxx>Page yyy>Report Attributes>Column Attributes
    Set the default value for newly added rows as in
    http://img237.imageshack.us/img237/5758/screenshot012di2.jpg
    Hope this helps.
    Un-resolved problem
    have also tried to do this but the fields I see are not the same.
    Please see screenshot=http://krisjones.freewebspace.com/apex.JPG
    I am using the Oracle hosted environment, so 2.2.1.
    To my knowledge I have done the same as the user in the first post. Am I doing something incorrectly or should I have created the tabular form differently?
    Many thanks. Kris

    Kristian - You see a different version of the form depending on whether the selected column is the primary key column or not.
    Scott

  • How to set value in combox by code

    how to set value in combox by code

    Dear
    You can use the following code to set the values in combobox by a query
       strQuery = "select ItemCode,ItemName  from OITM"
            oRecSet = Me.SBO_Company.GetBusinessObject(BoObjectTypes.BoRecordset)
            oRecSet.DoQuery(strQuery)
                 oCombo = Me.oForm.Items.Item(encontrolName.colEmpType).Specific
            If oRecset.Fields.Count > 0 Then
                While oRecset.EoF = False
                    oCombo.ValidValues.Add(oRecset.Fields.Item(0).Value, oRecset.Fields.Item(1).Value)
                    oRecset.MoveNext()
                End While
            End If
    Regards
    Rupinder

  • How to set value for trim and bleed using jsx script?

    I have tried using bleedoffsetRect but somehow it is not working. Can anybody please help me on how to set value for trim and bleed using jsx script? Any example will be highly appreciated.
    Following is the code I am trying with:
    var _saveName = new File ( root_path +_strFileName+".pdf");
        var _saveOpts = new PDFSaveOptions();
        _saveOpts.printerResolution = 300; 
        var bleedarray = new Array();
         bleedarray[0] =9.00;
         bleedarray[1]=9.00;
         bleedarray[2]=9.00;
         bleedarray[3]=9.00;    
        _saveOpts.bleedOffsetRect = bleedarray;

    I would expect although I've not actually tried this for the bleed off set box to be larger than the artbaord and the first two values to be negative or 0…
    var bleedarray = new Array(-9,-9,artboard.width+9,artboard.height+9);
    Where 'artboard.width' & 'artboard.height' you will have calculated from your file. An Array(9,9,9,9); would not constitute any boxes bounds.

  • Assign value to ODI variable from Jython

    Hello Experts,
    I have a procedure where I'm using Jython code. I want to assign a value to an ODI project variable from a Jython function:
    Example:
    #COUNTER = len(v_jythonList) ---> being #COUNTER the ODI project variable and len() the jython function
    Now, i noticed that using ODI variables adds # sign which is use for comments in Jython code. Is there a way to assign values to ODI variables from Jython script?
    Please help!.
    Thanks.
    Pablo.

    Hi,
    Does this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Using HttpHeader to set value for session variables

    Hi,
    We want to set values for 2 session variables (USER and ROLEID) using HttpHeader in obiee 11g. Has anyone tried this? How can we achieve this?
    I found the below note on the forum for setting value for the USER session variable. how can we set the ROLEID session variable also? is it possible to set values for 2 variables?
    for setting the USER session variable,
    You should add this in $BI_HOME/bifoundation/web/display/authenticationschemas.xml:
    <SchemaKeyVariable source="httpHeader" nameInSource="Proxy-Remote-User" forceValue="SSO"/>
    <AuthenticationSchema name="SSO" displayName="Single Sign On" userID="IMPERSONATE" proxyUserID="NQ_SESSION.RUNAS" options="noLogoffUI noLogonUI">
    <RequestVariable source="httpHeader" type="auth" nameInSource="Proxy-Remote-User" biVariableName="IMPERSONATE" options="required"/>
    </AuthenticationSchema>
    Please suggest.
    Thanks.

    I think maybe your SnmpValue type or value is not corrent.
    1.3.6.1.4.1.7064.201.1.200.100.0 is Enum control type
    when I use
    SnmpValue val = new SnmpString("0");
    It doesn't work, but when I use
    SnmpValue val = new SnmpInt(0);
    It works. I think the JDMK should give some warning message when the type is not correct. :)
    The code is following:
    final SnmpVarBindList setList = new SnmpVarBindList(" set varbind list ");
    SnmpOid oid = new SnmpOid("1.3.6.1.4.1.7064.201.1.200.100.0");
    SnmpValue val = new SnmpInt(0);
    SnmpVarBind valueBind = new SnmpVarBind(oid, val);
    setList.addVarBind( valueBind );
    SnmpRequest setRequest = session.snmpSetRequest(null, setList);

  • How to set value for radio button in sap crm survey suite

    Hi ,
    I created a survey in CRM Service, in which I added a question with answer as '10 Selection Button Group ('radio button'). And answer has 11 answer options (which means 11 radio buttions). Now when we test the survey, the value for the radio buttons is appearing like 'id_0050569b03091ee480a29d8ee61e953c'. But i want to set a specific value for each radion button (from 1 to 11). So, how to set value for radio button in sap crm survey suite???.
    Thanks & Regards,
    Seshu

    Hi,
    I found solution myself. Click on Goto -> Editing Mode -> Expert Mode. Now you can set value for radio button.
    Regards,
    Seshu

  • Setting windows environment variables from Java program

    Is there any way to set environment variables from Java program in Windows? Any help is appreciated.
    Here is my situation:
    I need to decrypt an encrypted Oracle user password in a batch file which will be used while running a sql script with sqlplus. I was planning to have bat file which will call a Java program decrypt the password and set it as an env variable in windows which will be available while calling sqlplus.
    thanks

    Runtime.exec has a lot of overloadings. Two of them
    allows you to specify the environment variables.
    exec
    public Process exec(String[] cmdarray,
    String[] envp,
    File dir)
    throws IOExceptionExecutes the specified command and
    arguments in a separate process with the specified
    environment and working directory.
    cmdarray - array containing the command to call and
    its arguments.
    envp - array of strings, each element of which has
    environment variable settings in format name=value.
    dir - the working directory of the subprocess, or null
    if the subprocess should inherit the working directory
    of the current process.
    I had this sample program:
    public class SetVarExample {
    public static void main (String[] args) throws Exception {
         String[] cmd_env= new String[] {"password="+"ABCD","Path=C:\\Sun\\AppServer\\jdk\\bin"};
         String cmd = "cmd /c SET ";
         Runtime.getRuntime().exec(cmd,cmd_env);
    System.out.println( "Finish ...." );
    I tried it in a command prompt. But looks like when the program exits, it's a whole new process and so it does not retain the env variables set in the java program.
    Any suggestions? Am I doing it worng?
    thanks

Maybe you are looking for

  • Why does Firefox always block any link I try to open going to a web page when I don't have pop up blocker on?

    Why does Firefox always block any link I try to open going to a web page when I don't have pop up blocker on? First off they are not even pop ups....your crap blocks everything and don't save user names &/or passwords when you have it checked. Also i

  • Can't update iPhoto because of wrong Apple ID?

    I have a client that just purchased iphoto for the iphone. Now his mac says he can't update the iphoto 9.1.5 on it because he's logged in with the wrong apple account? Anyone see this or have ideas? He's running a MacBook Pro with OS X.7.3. The exact

  • Can't open up acrobat XI standard.

    after I downloaded acrobat XI standard, i ended up with 2 icons , one with looks like the usual acrobat icon but i can't get it to open up. the other looks like a file icon labeled acrobat XI but when I open this it goes a file page with . things tha

  • Game cannot be played

    I have Royal Solitare listed on my Ipod & in my library. When I try to select it, I am getting "game cannot be played. Go to iTunes and reinstall." How do I do this?

  • Global menu in mate-panel

    Did any of you guys manage to get global-menu working with mate-panel? Dunno if it's worth hustling. I'm using openbox, and all I want is to get gnome-panel functionality without the fancy crap.