Embedded Java Code - How to retrieve multivalue payload value

I'm working in my SOA-Composite which is used with OIM and our approval process. Here is an example of the payload data:
>
<ns2:RequesterDetails>
<ns2:FirstName>System</ns2:FirstName>
<ns2:MiddleName/>
<ns2:LastName>Administrator</ns2:LastName>
<ns2:Login>XELSYSADM</ns2:Login>
<ns2:DisplayName>System Administrator</ns2:DisplayName>
<ns2:ManagerLogin/>
<ns2:OrganizationName>Xellerate Users</ns2:OrganizationName>
<ns2:Email>[email protected]</ns2:Email>
<ns2:StartDate/>
<ns2:EndDate/>
<ns2:Status>Active</ns2:Status>
<ns2:XellerateType>End-User Administrator</ns2:XellerateType>
<ns2:UserType>Full-Time</ns2:UserType>
<ns2:Role>SYSTEM ADMINISTRATORS</ns2:Role>
<ns2:Role>Test Role 1</ns2:Role>
<ns2:Role>Test Role 2</ns2:Role>
</ns2:RequesterDetails>
>
I am able to retrieve single values with code like this:
>
//Retrieve Requester Login
Object requesterXMLElem = getVariableData("inputVariable", "payload","/ns3:process/ns4:RequesterDetails/ns4:Login");
String requesterLogin = ((oracle.xml.parser.v2.XMLElement)requesterXMLElem).getText();
>
How do i retrieve the multivalue Role values and not just a single entry?
Thanks,
Kevin

I see what i missed with the doube slash, i thought you had a typo and assumed i used it. If i use the following:
//Retrieve Requester Roles
Object requesterRolesXMLElem = getVariableData("inputVariable", "payload","/ns3:process/ns4:RequesterDetails//ns4:Role");
System.out.println("Requester Roles Type[" + requesterRolesXMLElem.getClass() + "]");
int requesterRolesCount = ((oracle.xml.parser.v2.XMLElement)requesterRolesXMLElem).getAttributes().getLength();
System.out.println("Requester Roles Length[" + requesterRolesCount + "]");
String requesterRole = ((oracle.xml.parser.v2.XMLElement)requesterRolesXMLElem).getText();
System.out.println("Requester Roles[" + requesterRole + "]");
I get the following output:
Requester Roles Type[class oracle.xml.parser.v2.XMLElement]
Requester Roles Length[0]
Requester Roles[SYSTEM ADMINISTRATORS]
I am not seeing how to loop through each if the type is class oracle.xml.parser.v2.XMLElement
Thanks,
Kevin

Similar Messages

  • How to retrieve updated payload information from completed HumanTask

    after initiating the HumanTask , updating the payload object from java client api
    payload information set into task object.
    taskService.updateTaskOutcome(workflowContext, task, outcome) ;
    after this call the HumanTask will be Completed.
    Now i tried to get the Payload which was updated in earlier step.
    Task task=taskQueryService.getTaskDetailsByNumber(workflowContext, taskNumber);
    XMLElement payload =(XMLElement)task.getPayloadAsElement();
    in the payload, it only contains payload which was at the time of humanTask initiation .
    Can any one help me, how to retrieve the payload information after completing the HumanTask ?
    Thanks in Advance

    I think the below code can be used to update the payload in the HumanTask
    IWorkflowServiceClient wfSvc=WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT);
              //instantiate the TaskQueryService Object
              ITaskQueryService taskQuerySvc=wfSvc.getTaskQueryService();
              //instantiate the TaskService Object. it has the UpdateOutcome method
              ITaskService taskSvc=wfSvc.getTaskService();
              final String password="jcooper";
              final int taskNumber=123;
              try {
                   //get WorkflowContext
                   IWorkflowContext context=taskQuerySvc.authenticate("jcooper",password.toCharArray(), "jazn");
                   Task task=taskQuerySvc.getTaskDetailsByNumber(context, taskNumber);
                   Element element=task.getPayloadAsElement();
                   Element payloadNew=element.getOwnerDocument().createElementNS("http://xmlns.oracle.com/bpel/workflow/task", "payload");
                   JAXBContext jaxbContext=JAXBContext.newInstance("object.path");
                   Marshaller marshaller=jaxbContext.createMarshaller();
                   //new Object() is your Object which you want to update in Process payload
                   marshaller.marshal(new Object(), payloadNew);
                   task.setPayloadAsElement(payloadNew);
                   //update task payload
                   taskSvc.updateTaskOutcome(context, task, "APPROVE");
              } catch (WorkflowException e) {
                   e.printStackTrace();
              } catch (JAXBException e) {
                   e.printStackTrace();
              } catch (StaleObjectException e) {
                   e.printStackTrace();
    Edited by: user12267906 on Nov 28, 2009 7:43 AM

  • XPathFactory error in embedded Java code

    Hi,
    I'm getting the following error when executing embedded Java code which does an XPath expression. Does anyone know why this is happening? Thanks.
    [2006/03/13 17:55:22] "{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown. less
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>Operation failed!; nested exception is: java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</summary>
    </part>
    <part name="detail">
    <detail>java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</detail>
    </part>
    </bindingFault>

    Hi,
    Refer the URL :http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/AbstractTransformation.html
    regards,
    ganga

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • How to retrieve dynamic filter value submitted from control query to .....

    How to retrieve dynamic filter value submitted from control query to broadcast query.....
    I'm trying to change the hierarchy version determined by a userexit variable in the broadcast query.
    The Hierarchy Version should be dependent on the input filter delivered by the bursting query.
    But how do I catch the dynamic filter value which has been submitted by the bursting query,
    with other words:  where does the bursting query store it's out put while sequentially starting the broadcast query value by value?
    BTW: the filter value from the bursting query appears under "dynamic filter values" in the information of the broadcast query...
    Any thoughts are welcome!
    Edited by: Heinrich Krupp on Jun 24, 2009 1:25 PM

    Further information,
    Report is used via webi only, not Xcelsius or Dashboard.
    Report is consuming BI Web Services.
    Although we can pass in prompt values to BI Services, I couldn't find if we could pass a variable or dimension object into this field. Anyone knows?

  • Embedding Java Code(URGENT)

    Hello,
    I'm trying to do the following, I'm trying to embed Java code into my BPEL process, I have read the tutorial that explains how to embed a java code into BPEL(http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Training-Segment10.pdf) but unfortunately the tutorial discusses only how to call the Entity Bean but doesnt mention where in folders(directory) should the bean itself be placed, where are the imports.
    I'm going to start with a simple example, a class called Multiplier that has function square, Here is the code for the class:
    //Java Multiplier class
    public class Multiplier{
    public Multiplier(){}
    public int square(int x){
    return x*x; }
    this is code that will be placed in the EXEC(Java code snippet):
    //Java Code Snippet goes here...
    try{
    Object input= getVariableData
    ("input","payload","/JavaCode");
    String parser= input.toString();
    int in= Integer.parseInt(parser);
    Multiplier obj1= new Multiplier();
    int result= obj1.square(in);
    addAuditTrailEntry("The square of the input is:"+result);
    catch(Exception en){
    addAuditTrailEntry(en);
    Where should the multiplier class be located(in which folder in the ecplise)or how will the BPEL refer to it ?
    Shouldnt I import the Multiplier class in the EXEC(snippet) where should that line go?
    Thanks in advance
    Hussam Galal

    After going through the Forum I saw I question similar to mine, and I found out there's an example similar to what I am trying to do at C:\orabpel\samples\references\JavaExec
    I tried to make an example almost exactly like JavaExec and I edited my build.xml to be similar to build.xml of the example but I keep getting this error:
    BUILD FAILED: C:\eclipse-SDK-3.0-win32\eclipse\workspace\Calc\build.xml:28: ORABPEL-00017
    Java compilation failed.
    Failed to compile file(s) "Calc.bpel".
    Exception reported is: Calc.bpel:44: ';' expected.
    Multiplier mult= new Multiplier();
    ^
    1 error
    Please verify that file Calc.bpel is valid java file or if all required libraries are included in your classpath.
    classpath: C:\eclipse-SDK-3.0-win32\eclipse\startup.jar;C:\eclipse-SDK-3.0-win32\eclipse\startup.jar;C:\eclipse-SDK-3.0-win32\eclipse;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-ant.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-boot.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-common.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel-thirdparty.jar;c:\eclipse-SDK-3.0-win32\eclipse\plugins\bpelz_0.9.10\lib\orabpel.jar;C:\DOCUME~1\temp_ps\LOCALS~1\Temp\bpelc40446.tmp\BPEL-INF\classes
    Here's the java code in the EXEC(snippet):
    // Java code snippet goes here ...
    com.otn.samples.javaexec.Multiplier
    Multiplier mult= new Multiplier();
    Object obj1= getVariableData("input","payload","/Calc");
    String str= obj1.toString();
    int in= Integer.parseInt(str);
    int result= mult.square(in);
    addAuditTrailEntry("The result is: "+result);
    Finally here's the my build.xml:
    <?xml version="1.0"?>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Run cxant on this file to build, package and deploy the
    Calc BPEL process
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <project name="Calc" default="all" basedir=".">
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Name of the domain the generated BPEL suitcase will be deployed to
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <property name="deploy" value="default"/>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    What version number should be used to tag the generated BPEL archive?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <property name="rev" value="1.0"/>
         <target name="CompileJava">
         <mkdir dir="${basedir}/BPEL-INF/classes"/>
              <javac srcdir="${basedir}/src" destdir="${basedir}/BPEL-INF/classes"/>
         </target>
    <target name="Calc">
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    the bpelc task compiles and package BPEL processes into versioned BPEL
    archives (bpel_...jar). See the "Programming BPEL" guide for more
    information on the options of this task.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <bpelc home="${home}" rev="${rev}" deploy="${deploy}"/>
    </target>
    <target name="all" depends="CompileJava, Calc"/>
    </project>

  • ORABPEL-05250 - Deployment error after embedding java code

    hi i am getting the following error when deploying my composite i added embedded java and imported the necessary classes i think but if i take the embedded java out it deploys succsefully :
    [09:17:17 PM] Received HTTP response from the server, response code=500
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] HTTP error code returned [500]
    [09:17:17 PM] Error message from server:
    There was an error deploying the composite on SANDPIT_SOA: Error occurred during deployment of component: processGetPckFile to service engine: implementation.bpel, for composite: getPickFile: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "/u01/oracle/FSOAS/product/fmw/user_projects/domains/FSOAS_domain/servers/SANDPIT_SOA/dc/soa_e76b434b-6704-4820-b544-ad56277e0fd9"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of processGetPckFile
    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).
    [09:17:17 PM] Check server log for more details.
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] #### Deployment incomplete. ####
    [09:17:17 PM] Error deploying archive file:/C:/JDeveloper/mywork/pdfService/getPickFile/deploy/sca_getPickFile_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Hi
    some times this error comes if the Packages for using JAVA are not i mported into BPEL Weused to get same error but after importing the packages the error usually used to be solved please check whether if the class files which you are using are correctly imported or not
    ex
    <import location="java.util.Properties"
    importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.io.*"
    importType="http://schemas.oracle.com/bpel/extension/java"/>

  • URGENT : Need java code snippet to retrieve uniquemember values OID 11g API

    Hi All,
    We have a requirement to retrieve the uniquemember attribute values using OID 11g API. We are using labeleduri approach for dynamic groups and thus all the uniquemember values are created using dynamic groups.
    When we are trying to retrieve the uniquemember values using Java code snippet, it is not returning the values. The strange thing is: The uniquemember values created using dynamic groups are not visible in ODSM OID console or JExplorer tool. However those values are visible in LDAP Browser v2.8.1 tool.
    So can somebody throw light on this? Any pointers or sample code snippet to retrieve uniquemember values would be grateful.
    Thanks
    Mahendra.

    Hi All,
    We have a requirement to retrieve the uniquemember attribute values using OID 11g API. We are using labeleduri approach for dynamic groups and thus all the uniquemember values are created using dynamic groups.
    When we are trying to retrieve the uniquemember values using Java code snippet, it is not returning the values. The strange thing is: The uniquemember values created using dynamic groups are not visible in ODSM OID console or JExplorer tool. However those values are visible in LDAP Browser v2.8.1 tool.
    So can somebody throw light on this? Any pointers or sample code snippet to retrieve uniquemember values would be grateful.
    Thanks
    Mahendra.

  • In java code, how to obtain the input a user types in JTextArea

    In my java code, I have two JTextArea. When a user
    starts the GUI, there are two testareas showing up
    (by typing: java xxx). The user types in words and
    sentences in the first testarea, and how can I code
    the java program so that something can come out
    on the second testarea, with that something depends
    on what the words are.

    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class GUI extends JFrame{
        JTextArea jta1, jta2;
        public static void main(String args[]){
            GUI g = new GUI();
            g.addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent we){
                      System.exit(1);         
            g.setSize(400,300);
            g.setVisible(true);   
        public GUI(){
            JPanel p = new JPanel();
            p.setLayout(new FlowLayout());
            jta1 = new JTextArea(10,10);
            jta1.setLineWrap(true);
            jta1.addKeyListener(new KeyAdapter() {
                public void keyTyped(KeyEvent e) {
                    char c = e.getKeyChar();
                    jta2.append(String.valueOf(c));
            jta2 = new JTextArea(10,10);
            jta2.setLineWrap(true);
            p.add(jta1);
            p.add(jta2);
            getContentPane().add(p);
    } You can implement whatever logic you want inside the keyTyped method.

  • Embedded Java code with bpelx:exec

    When I embed Java code with bpelx:exec, I would like use classes packaged in a jar file. How do I ensure that the jar file is deployed with the suitcase? I tried adding the library to the JDeveloper project (right-click project, choose properties, libraries), but that did not work.

    Although the tooling does not expose this functionality yet, the bpel packaging and bpelc command line tool support the ability to put a library in BPEL-INF/lib and using it in the exec activity. You can also put classes in BPEL-INF/classes. Please look at:
    [ORACLE_HOME]\integration\orabpel\samples\references\JavaExec for more information.
    -Edwin

  • How to retrieving attributes old values from a OBJECT_CHANGED event

    Hi,
    I have installed Sun ONE Directory Server 5.2. I have registared Event Listener which implements both name space change and object change interfaces. After chaning some attribute value, i am able to get the new values of attributes using getNewBinging method. But when i call getOldBinding to get attributes, it is returning null. Can any one help me how to get the old values. This is very much urgent and we are trying to write custom connectors to synchronize the data in Sun ONE directory server with other directory servers like Oracle Internet Directory.
    I am new to Java and JNDI.
    It would be great help if any one can light me in this regard. Thanks in advance.
    Thanks & Regards
    Sreedhar

    I have been also working for the same issue. getOldBinding() does not return old attributes in case of ObjectChanged event. So far I did not find any solution. Does anyone know any solution?

  • How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g

    Hi Every One,
    Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
    Thanks

    shuttle's valuechangeevent would fire when you shuttle items back and forth.
        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
            if (list != null){
                for (int i=0; i<list.size(); i++) {
                    int l = list.size()-1;
                    val = list.get(l).toString(); //returns , delimited string
                    if (val != null){
                        val = val.replaceAll("[\\[\\]]", "");
                        StringTokenizer st = new StringTokenizer (val, ",");
                        int nto = st.countTokens ();
                        for (int j = 0; j < nto; j++)
                            String token = st.nextToken ();                     
                ..........

  • Newbie - How to retrieve a "Boolean" value in a jsp via jsf ?

    Is it possible to retrieve a Boolean value from a BBean from, from let's say a 'rendered' tag ?
    class BBean
    Boolean secure;
    public Boolean getSecure() {...}
    From the jsf:
    <h:outputText value="#{somebean.whatever}" rendered="#{BBean.? == false}" />
    How do I use the Boolean object in an expression like the one above ?
    Note: I've simplified the example above, but I cannot use a primitive boolean for this, the objects I use
    are generated with "Boolean"s and I have no control.
    Thanks in advance !
    Mark

    You should just use boolean instead of Boolean;
    class BBean
    boolean secure;
    public boolean getSecure() {...}
    <h:outputText value="#{somebean.whatever}" rendered="#{bBean.secure == false}" />

  • Need JAVA code to create OIM ITresource-connection values are in a csv file

    Hi,
    Could any one plz help me with the java code used / tested before to create OIM IT resource dynamically, for the reference. IT resource parameter (connection) values in a .csv file, where in I've multiple environments.
    Thanks,
    Ramesh
    Edited by: user13267745 on Aug 19, 2010 12:37 AM

    Hi Gregg,
    You can create one transformation from the DataStore to itself.  In the "Technical" rules group, set 0RECORDMODE = 'X' (before image) or 'R' (reverse).  Therefore, when you execute its corresponding DTP, all existing records shouldl be set to zero.
    Then, as a second step, you can execute the DTP which is related to the transformation between the DataStore and the DataSource, thus loading the new records.
    I hope this helps you.
    Regards,
    Maximiliano

  • How to Update BPEL Payload Values?

    Hi,
    Currently we are working on BPEL Process implemented using Jdeveloper,we want to update BPEL payload values for existing instance created on server.How can we update existing BPEL process Payload values?
    Snehal
    Edited by: 947450 on Sep 3, 2012 9:36 PM

    Hi Umesh,
    There are some fields like PageNumber,SerialNumber etc which are not reflected in EBS systems , these are there only for IPM Level and if we want to update that fields without disturbing EBS systems can we do that?Also these cannot be consider as metadata so that we cannot update it by using UCM.So in IPM level can we do such updation of this values?
    Thanks Snehal

Maybe you are looking for