Assigning values to element part of a variable

Hello,
I have a BPEL process which has a variable declared thusly:
    <variable name="myMessageVariable" element="ns1:MyMessage"/>The MyMessage type is declared by an XSD file which is used as part of a WSDL definition which an adapter then uses to connect to an external service:
    <xsd:element name="MyMessage" type="tns:MyMessageType" />
    <xsd:complexType name="MyMessageType">
        <xsd:sequence>
            <xsd:element name="ErrorString" type="xsd:string" />
            <xsd:element name="ErrorReason" type="xsd:string" />
        </xsd:sequence>
    </xsd:complexType>I am trying to assign a value to one of the element parts of the variable via an assignment:
        <assign name="Assign1">
          <copy>
            <from>ora:getFaultAsString()</from>
            <to>$myMessageVariable.ErrorString</to>
          </copy>
        </assign>... but I am getting the following error:
Error(81): Variable "myMessageVariable"  must not specify part "ErrorString" because its type is not a WSDL messageCan anyone indicate the correct syntax for doing so, please?
Many thanks in advance for any assistance.
Edited by: ZeroZeroZeroOne on Apr 25, 2013 9:22 PM

Looks like your wsdl is not defining the message properly for the operation. I have pasted you an example of wsdl and xsd here.
WSDL File:
+<?xml version="1.0" encoding="UTF-8"?>+
+<wsdl:definitions name="BPELDVM"+
targetNamespace="http://xmlns.oracle.com/PIMtoRPASAmendment/BPELDVM/BPELDVM"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/PIMtoRPASAmendment/BPELDVM/BPELDVM"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
+     <wsdl:types>+
+          <schema xmlns="http://www.w3.org/2001/XMLSchema">+
+               <import namespace="http://xmlns.oracle.com/PIMtoRPASAmendment/BPELDVM/BPELDVM" schemaLocation="xsd/BPELDVM.xsd" />+
+          </schema>+
+     </wsdl:types>+
+     <wsdl:message name="BPELDVMRequestMessage">+
+     <wsdl:part name="payload" element="client:process"/>+
+     </wsdl:message>+
+     <wsdl:message name="BPELDVMResponseMessage">+
+          <wsdl:part name="payload" element="client:processResponse"/>+
+     </wsdl:message>+
+     +
+     <!-- portType implemented by the BPELDVM BPEL process -->+
+     <wsdl:portType name="BPELDVM">+
+          <wsdl:operation name="process">+
+               <wsdl:input message="client:BPELDVMRequestMessage" />+
+               <wsdl:output message="client:BPELDVMResponseMessage"/>+
+          </wsdl:operation>+
+     </wsdl:portType>+
+     <plnk:partnerLinkType name="BPELDVM">+
+     <plnk:role name="BPELDVMProvider">+
+               <plnk:portType name="client:BPELDVM"/>+
+          </plnk:role>+
+     </plnk:partnerLinkType>+
+</wsdl:definitions>+
XSD File:
+<?xml version="1.0" encoding="UTF-8"?>+
+<schema attributeFormDefault="unqualified"+
+     elementFormDefault="qualified"+
+     targetNamespace="http://xmlns.oracle.com/PIMtoRPASAmendment/BPELDVM/BPELDVM"+
+     xmlns="http://www.w3.org/2001/XMLSchema">+
+     <element name="process">+
+          <complexType>+
+               <sequence>+
+                    <element name="input" type="string"/>+
+               </sequence>+
+          </complexType>+
+     </element>+
+     <element name="processResponse">+
+          <complexType>+
+               <sequence>+
+                    <element name="result" type="string"/>+
+               </sequence>+
+          </complexType>+
+     </element>+
+</schema>+
Let us know if you still having problem with that. Otherwise you can share your wsdl and schema file here.
Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question.
Thanks,
Vijay

Similar Messages

  • Assigning value to array type variable in a loop

    Hi
    I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
    My copy operation in assign activity looks like this-
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters"/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    </copy>
    It is inside a while loop activity.
    PS *()* are square brackets
    But it is erroring out at run time.
    Does anybody has an alternate idea to assign value to an array type?.
    i have seen that while extracting value from an array type variable it works fine
    A similar kind of operation is shown below.
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters"/>
    </copy>
    Thanks
    Ayush
    Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AM

    Hi Ayush
    I suppose you are getting some error like "source node returns multiple elements".
    In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
    Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
    Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
    *<copy>*
    *<from variable="Var" part="InputParameters"*
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
    part="InputParameters"
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *</copy>*
    And the easiest way to do this is by the transform activity as said above.
    Regards
    Suryaveer
    Edited by: Suryaveer on Aug 15, 2009 11:19 PM

  • Cannot assign value to a Variable of Complex Type beyond index 1

    Hello:
    I have a variable defined as a complex type as followed. I tried to assign a value to each of the two elements but it only allows me to assign to the 'element#1.
    This statement that tries to assign a value into element#2 will not work, if I assign with '[1]' for the first element it will work:
    <copy> <---- THIS WORKS
    <from expression="'John'"/>
    <to variable="My_Variable"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[1]/ns9:pname"/>
    </copy>
    <copy> <---- THIS DOES NOT WORK
    <from expression="'John'"/>
    <to variable="My_Variable"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item[2]/ns9:pname"/>
    </copy>
    Is there something wrong with my definition below that allows only element#1 to be refererenced but not element#2???? Am I missing some kind of initialization that is needed to initialize both elements????
    Here are my message and Complex Type definitions:
    <variable name="My_Variable" messageType="ns8:args_out_msg"/>
    <message name="args_out_msg">
    <part name="My_Collection" element="db:My_Collection"/>
    </message>
    <element name="My_Collection">
    <complexType>
    <sequence>
    <element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="Collection_Type">
    <sequence>
    <element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="Collection_Type_Struct">
    <sequence>
    <element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="25"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    The error msg it gives me is as followed:
    [2010/09/04 00:47:59] Error in <assign> expression: <to> value is empty at line "254". The XPath expression : "" returns zero node, when applied to document shown below:less
    oracle.xml.parser.v2.XMLElement@1fa7874
    [2010/09/04 00:47:59] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.less
    -<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    -<part name="summary">
    <summary>
    XPath query string returns zero node.
    According to BPEL4WS spec 1.1 section 14.3, The assign activity &lt;to&gt; part query should not return zero node.
    Please check the BPEL source at line number "254" and verify the &lt;to&gt; part xpath query.
    </summary>
    </part>
    </selectionFailure>
    Thanks
    Newbie

    Hello:
    Base on the suggestion to use 'append' instead of 'copy', I tried to define a 'singleNode' which is of type 'Collection_Type_Struct' so I can append this individual 'struct' into my array (i.e. as the 2nd. element of my array "/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"), but I am getting an error in defining this variable as:
    <variable name="singleNode" element="Collection_Type_Struct"/> <--- error
    Can someone tell me how should I define "singleNode" so I can put a value in it and then append this 'singleNode' into the array:
    <variable name="singleNode" element=" how to define this????"/>
    <assign>
    <copy>
    <frem expression="'Element2Value'"/>
    <to variable="singleNode"
    part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item/ns9:pname"/>
    </copy>
    </assign>
    <bpelx:assign>
    <bpelx:append>
    <from variable="singleNode" query="/ns9:My_Collection/ns9:Collection/ns9:Collection_Item"/>
    <to variable="My_Variable"
    "part="My_Collection"
    query="/ns9:My_Collection/ns9:Collection"/>
    </bpelx:append>
    </bpelx:assign>
    Again here is my definition in my .xsd file:
    <element name="My_Collection">
    <complexType>
    <sequence>
    <element name="Collection" type="db:Collection_Type" db:index="2" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="Ret" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="Collection_Type">
    <sequence>
    <element name="Collection_Item" type="db:Collection_Type_Struct" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    <complexType name="Collection_Type_Struct">
    <sequence>
    <element name="pname" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="25"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    Thanks for any help!!!!

  • How to assign value from one element to another ?

    Hi,
    I am stuck up in silly problem.
    I have an XML as string i have used parseEscapedXML() to convert it in to XML object Type. see following code.
    <assign name="Assign_3">
    <copy>
    <from expression="ora:parseEscapedXML(ora:getContentAsString(bpws:getVariableData('inputXML')))"/>
    <to variable="inputVariable" part="payload" query="/ns1:email"/>
    </copy>
    </assign>
    above is working fine. In Debug window i can see values in "/ns1:email/ns1:ovdTriggeredDate" but now i need to assign "/ns1:email/ns1:ovdTriggeredDate" to another variable. see following code for refrence.
    <assign name="Assign_2">
    <copy>
    <from expression="ora:getNodeValue(bpws:getVariableData('inputVariable','payload','/ns1:email/ns1:ovdTriggeredDate'))"/>
    <to variable="Variable_2"/>
    </copy>
    </assign>
    in above code "ovdTriggeredDate" is a string and "Variable_2" is also String.
    i dont know why above code is not working
    Can anybody help me in this?
    Thanks in Advance.
    Nimisha

    Hi,
    ovdTriggeredDate is type of an element which is of type string. and Variable_2 is also of type string variable.
    see following use case.i have xml as a string
    inputXML = <email><ovdTriggeredDate>16thFeb</ovdTriggeredDate></email>
    i need to convert string to XML object. now i am assigning this value to Schema.following is my schema.
    <xsd:element name="email">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="ovdTriggeredDate" type="xsd:string" minOccurs="1"/>
    </xsd:complexType>
    </xsd:sequence>
    </xsd:element>
    i am able to convert XML string to xml object. now i need only one variable of xml. so i am assigning "ovdTriggeredDate" to string variable "variable_2"
    but its giving me exception. any idea ?
    thanks,
    Nimisha

  • Assigning value to a variable in Script Component.

    I'm pretty new to SSIS development and need to figure out a problem with assigning a value to a user defined variable. I created a pretty simple package. It reads a flat file, extracts date from a header record and subsequently uses derived column component
    to reformat data to the desired output format. One of the columns (FileRunDate,
    string, length 8) in the derived component is defined as a string and in the expression I'm assigning it to a variable I set earlier in the script component -
    @[User::vRunTimeDate]. When the process runs, the output file gets generated, however FileRunDate reflects
    originally set varible's value. It seems that the variable assignment in the script task does not work, even though in the debug mode, I do see how the value is being set. The variable has an attribute of ReadWrite. Is it due to the fact that the value is
    being set in the same workflow?
    Any feedback is greatly appriciated.

    Unfortunately I'm unable to add a screenshot of the process, for some reason I get an error message when I try to do that. In a nutshell the entire workflow consist of flat file source component, following by a script component (this is where I read and
    assign the variable) 
        public override void PostExecute()
            IDTSVariables100 vars;
            base.PostExecute();
            // Set run date
            if (strRunDate != null)
                VariableDispenser variableDispenser = (VariableDispenser)this.VariableDispenser;
                variableDispenser.LockForWrite("User::vRunTimeDate");
                variableDispenser.GetVariables(out vars);
                // Set the variable
                vars["User::vRunTimeDate"].Value = strRunDate;
                //Unlock the variable 
                vars.Unlock();
                //Variables.vRunTimeDate = strRunDate;
    then goes conditional split ( filtering out unwanted records), which is connected to a derived column component (this is where one of the columns get assigned a variable's value), one more script component (this where I identify
    specific data element and do a replace command) and finally flat file destination.
    BTW, the article in the provided URL clearly states that variable won't reflect assigned value till the entire workflow has finished. If that's the case, then I think I know my
    answer. Is there is such a thing as putting execution of different steps in a different step, so anything executed subsequently will see that value?

  • Read XML in BPEL and assign values to variables

    Hello,
    I need to read an xml message in BPEL and assign variables created in BPEL the values of elements in XML message. Whats the best possible way to do this.

    When you say"*read an xml message*", is the xml coming as input message or you need to read from file ?
    If you want to read from file, you can make use of the below function.
    Returns the string value of an element defined by lookupXPath in a XML file (docURL) given its parent XPath (parentXPath), the key XPath (keyXPath) and the value of the key (key). Usage: oraext:lookup-xml(docURL as string, parentXPath as string, keyXPath as string, lookupXPath as string, key as string)
    Example: oraext:lookup-xml('file:/d:/country_data.xml', '/Countries/Country', 'Abbreviation', 'FullName', 'UK') returns the value of the element FullName child of /Countries/Country where Abbreviation = 'UK' in the file d:\country_data.xml
    Thanks,
    Vijay

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

  • Assigning value to variable in ODI

    Hi
    TotalCount(datatype is numeric)--->Action is (Latest value)
    And i want to assign value it by using following query
    select count(*) from Investment_ato
    i am writing this in a refresh tab
    And i am using this variable in another variable(var_account)
    but value of TotalCount variable is not coming in var_account
    so plz suggest regards the same
    thanks

    You can set the refreshing mode in the variable var_account and in the refreshing tab put the query as: select #TotalCount from dual.
    Hope it helps!

  • Assigning value to variable of type time

    Hi,
    I want to assign value '8:00:00' to a time variable (w_time like sy-uzeit).
    How do i do this? Do i need to do any casting?
    w_time = '8:00:00' didnt work.
    I am trying to use this in a customer exit.
    Thanks,
    Arun KK

    Gotcha!
    Thanks!!

  • Assigning Value to Variable in Sapscript

    Hi,
    To initialized value of the variable when I tried to assign 0 to variable (like in the following statement) it comes up with error 'Command Expected'.
    &RF140-ZALBT&= '0'.
    Please let me know where and what I am doing wrong in assigning value to a variable?
    Regards,
    Shabbar

    Hi,
    Still its not working. The statement I am writing is
    /: &NET& = &RF140-WRSHB& - &RF140-MSATZ&
    but the system gives error on that.
    NET is the local variable declared with Define statement and both the others are defined in print program.
    Even I tried
    /: &RF140-ZALBT& = &RF140-WRSHB& - &RF140-MSATZ&
    but still the same error.
    Any comments?
    Regards,
    Shabbar

  • Assign value to Object type variable

    CREATE OR REPLACE TYPE emp AS OBJECT (
    empid NUMBER,
    age NUMBER,
    dob date);
    CREATE OR REPLACE TYPE emp _tab AS TABLE OF emp;
    Pls hlep me assign value to the object type variable in loop..(assume there is 5 10 records in emp table)
    declare
    v_emp_tt emp _tab ;
    begin
    for i in (select empid ,age ,dob from emp ) Loop
    v_emp_tt := i.empid; --this is wrong pls help me correct it.
    end loop;
    end;
    thanks,

    I would keep the type/object naming convention distinct from the table name.
    In terms of assignment:
    CREATE OR REPLACE TYPE to_emp AS OBJECT
    (empid NUMBER,
    age NUMBER,
    dob date);
    CREATE OR REPLACE TYPE tt_emp AS TABLE OF emp;
    declare
    v_emp tt_emp;
    begin
    select to_emp_obj(emp_id, age, dob)
    bulk collect into v_emp
    from emp;
    end;

  • Assigning value to a variable.

    i have one doubt.
    we can assign value to a variable either in declaration section or in exectuion section.
    so please explain when and wherer should we assign value to a variable.
    thank you very much.

    I think the best way to look at it is...
    If you don't want your variable(s) to have default values that are NULL, assign a value in the declaration section, otherwise assign it where you feel like.
    If you take an example of:
    declare
      v_sum number := 0; -- default variable to 0
      cursor cur_test is
    begin
      for i in cur_test
      loop
        v_sum := 0; -- set variable to 0 before the loop
        loop
          exit when .. some condition ..
          v_sum := v_sum + ..
        end loop;
      end loop;
    end;
    /.. we have a need to set the variable v_sum to 0 before each iteration of the internal loop, so there's little point in having it defaulted to 0 in the declaration section, hence I wouldn't typically default it there and would typically have the code as..
    declare
      v_sum number; -- no point in defaulting it
      cursor cur_test is
    begin
      for i in cur_test
      loop
        v_sum := 0; -- set variable to 0 before the loop
        loop
          exit when .. some condition ..
          v_sum := v_sum + ..
        end loop;
      end loop;
    end;
    /It all depends on what you're doing and what seems the most logical or preferred option.
    Defaulting values in the declaration section can let you see clearly what the starting values are for things, but only if you really need to do it.

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

  • Urgent - Assign Value To Bounded Variables

    In My Application Module I Create View With Bound Variables in The Where Condition, I Create Manual JSP To List The Data From The View As Reports Done.
    Pls. Tell Me How & Where I Can Assign Value To The Bounded Values At Run Time
    Regards
    ABG

    If your datasource tag introduces a scripteable vairiable named 'ds' you can use a scriptlet as follows:
    <%
    ds.getRowSet().setWhereClauseParam(int index, Object value);
    %>
    the index is the parameter index, the value is the value of tha parameter. Please look at the BC4J runtime Javadoc for more information.

  • Using only part of a variable value

    I have a variable in my Flash that relates to a date. The
    variable values are always in the form of mmyy. Therefore a value
    of 0407 refers to April 2007, a value of 0505 refers to May 2005,
    and so on.
    I'm trying to figure out how to take the variable value and
    use only the first two digits to create a new variable with the
    value of the corresponding month.
    So for example, say the original variable is:
    issueDate = 0407
    I would like to find a way to have actionscript take the
    first two digits in the value (04) and create a new variable
    (issueMonth) with the value of the corresponding month (April). So
    the final result would be:
    issueMonth = "April"
    That way, if the value of the issueDate variable was 0405,
    0410, or 0420, the value of the new issueMonth variable would
    always just be April.
    The whole point of this is so that I can take that original
    variable and create dynamic text like this:
    confirmation.text = "Thank you for reading our" + issueMonth +
    "issue.";
    Any help would really be appreciated.

    If it's a string, then first you should look at the String
    class in Help.
    There you'll find that the slice method should do just what
    you need:
    var p = "0406";
    trace(p.slice(0,2));
    04
    trace(p.slice(2,4));
    06
    You can then use parseInt to turn those into numbers. And use
    the month
    number as an index into a months array:
    var p = "0406";
    var mos =
    ["January","February","March","April","May","June","July","August","September","October", "November","December"];
    var monthIndex = parseInt(p.slice(0,2)) - 1;
    trace(mos[monthIndex]);
    April
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

Maybe you are looking for