Message Mapping: Map value from the first element in a context in target el

Hi experts,
I have a problem with a message mapping in XI. I hope you can help me. At first I will give you a source and a target structure. Then I will explain the problem.
<u>Source structure:</u>
<E1EDP01>
   <E1EDPT1>
      <TDID> ... </TDID>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
   </E1EDPT1>
</E1EDP01>
The structure can contain more than one E1EDP01-Elements, more than one E1EDPT1-Elements and more than one E1EDPT2-Elements.
<u>target structure:</u>
<LineItem>
   <vendmemo> ... </vendmemo>
</LineItem>
For every E1EDP01-Element my mapping creates one LineItem-Element in the target structure. To fill the element <vendmemo> the mapping should do the following steps:
The mapping should search in E1EDP01 for a E1EDPT1 with the TDID = Z505. And from this E1EDPT1-Element (with the TDID=Z505) the mapping should take the value <TDLINE> from the first E1EDPT2-Element in the context of the E1EDPT1-Element (the E1EDPT1 with the TDID=Z505) and put this value in <vendmemo>.
The mapping should do this action for every E1EDP01 -> so for every LineItem.
I tried it with UDF but I didn't found a solution. Can anybody help me?
best regards
Christopher

Hello experts,
i was wrong ... my mapping isn't still working. I had created a test instance. and only for this test instance the mapping (see above) works.
Can anybody help me? I'm trying the whole day but I can't find a solution. Here a second description of my problem:
<u>Source Structure:</u>
<E1EDP01>
   <E1EDPT1>
      <TDID> ... </TDID>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
   </E1EDPT1>
</E1EDP01>
<E1EDP01>
   <E1EDPT1>
      <TDID> ... </TDID>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
      <E1EDPT2>
         <TDLINE> ... </TDLINE>
      </E1EDPT2>
   </E1EDPT1>
</E1EDP01>
<u>Target Structure:</u>
<LineItem>
   <vendmemo> ... </vendmemo>
</LineItem>
<LineItem>
   <vendmemo> ... </vendmemo>
</LineItem>
<u>Description of my Problem:</u>
For each E1EDP01 in the source structure the mapping creates one LineItem in the target structure.
The element "vendmemo" should be created in any case ... also if it will be empty.
To fill the element "vendmemo" the mapping should search in E1EDP01 for a E1EDPT1 with the TDID=Z505. If there is an element E1EDPT1 with the TDID=Z505, the mapping should write the TDLINE from the first E1EDPT2 (under the element E1EDPT1 with the TDID=Z505) in the target field "vendmemo".
The Problem is that TDLINE an TDID are not in the same context. I tried it with setting the context of both to E1EDP01. But it was not working ... have you any idea oder suggestion?
Thank you very much
best regards
Christopher

Similar Messages

  • How to get a value from the previous element (XSLT/XPATH gurus ahoy!)

    Hi All,
    I am building an RTF template for a "letter of reference"-report. Sometimes there are several rows in the data, that need to be printed as one. This is due to consecutive temporary contracts, which will be printed out as one period of service.
    Here's a simplified data example to illustrate the problem.
    <ROW>
    <START_DATE>01-01-1980</START_DATE>
    <END_DATE>01-01-1988</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-1988</START_DATE>
    <END_DATE>01-01-1990</END_DATE>
    </ROW>
    <ROW>
    <START_DATE>01-01-2000</START_DATE>
    <END_DATE>01-01-2005</END_DATE>
    </ROW>
    With the data above, I should print two lines:
    01-01-1980 - 01-01-1990
    01-01-2000 - 01-01-2005
    I need to compare START_DATE of an element (except for the first one) with the END_DATE of the previous element, to find out whether to print the END_DATE for that element or not. How can I get that value from the previous element?
    Thanks & Regards, Matilda

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • Getting a field value from the first page on the second page in HTML

    I have a 2 page form I'm presenting in HTML to the user. The first page they select an action, enter a USERID and click the next page button. (The button executes "xfa.host.pageDown();" on the click action at the server)
    On the initialize of the second page I try to get the value of the USERID field from the first page and create a SQL statement to open my data connection. The issue I have is that I cannot get the value of the USERID field. This code works cause if I hardcode a valid value the query works. I tried to work around this by putting the same field on page 2, but it still did not work but the field was populated with displayed. I only assume the data is not populated at the time the initialize is invoked.
    Here is my code on the initialize..
    xfa.sourceSet.nodes.item(0).resolveNode("#command.query").commandType = "text"
    xfa.sourceSet.nodes.item(0).resolveNode("#command.query").select.nodes.item(0).value = "Select * from TABLE where userid = '" + xfa.form.resolveNode("form1.Page1.txt_EmployeeLogin").rawValue + "'"
    xfa.sourceSet.DataConnetion.open()
    Any help is greatly appreciated.
    THANKS!!

    Hi Steve,
    If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
    Jared

  • Grand total level of the percentage column giving value from the first row of column

    Hi Guys,
    I have a requirement like to show the percentage value which the calculation of two columns , in the grand total level .
    I think it can be achievaable by giving the aggregation rule for that column as Server complex Aggregate .
    eg.
    Fiscal Year  Department  subdepartment   Total cost     Sub Department cost     % cost
    2011           Edu             Books                 500              50                               10
    2011           Edu             Note Book           200            100                                50
    2011           Edu             Furniture             300             30                                 10
    2011            Edu                                      1000           180                              18
    Grand Total
    Ideally it should come like as above ..but the problem with me that ,it showing correct value for  all the rows ,but at the grand total level it's taking the value of % cost from the first row . like below..
    2011           Edu                                   1000                  180                         10
    Grand Total  
    I have calculated the % cost column in the answer itself  as (Sub Department cost /Total Cost )
    where the
    Aggregation rule for the columns given are
    Total Cost - Sum  ,Sub Dep Cost -  Sum, % Cost - Server Complex Aggregate
    So plz suggest me any Idea to achieve this ..Thanks in advance.

    Give the agg. as avg for % field.
    Best of Luck,
    Kashi

  • ArrayList drops the first element

    I hate asking for help, but this has me confused.
    I have a code that outputs the elements of an arraylist as text strings to a file. For some reason, the first element of the ArrayList gets dropped, but every other element after gets saved to text perfectly.
    public void writeOut(ArrayList a)throws IOException{
        String[] out=new  String[a.size()];
        for(int i=0;i<out.length;i++){
            out=a.get(i).toString();
    System.out.println("" + out[i]); //test line to see if element has been moved
    I have also tried:
    public void writeOut(ArrayList a)throws IOException{
        String[] out=new  String[a.size()];
        for(int i=0;i<out.length;i++){
            out=(String)a.get(i);
    System.out.println("" + out[i]); //test line to see if element has been moved
    The code is straight forward, the best I can tell...so what am I overlooking? I am assuming that my array needs to be primed or something first. I suppose I could make the array one bigger and put some bogus value in the first element...That doesn't really seem the right way to do it though.

    I didn't notice it either until I tried to pass it an ArrayList with only one string....I must be having a problem where the ArrayList is being created then.
    And that is exactly where the problem was... :sigh:
    Thanks for checking that for me.

  • Mapping values from the payload in the standard error message in PI 7.31

    Hi,
    I am working on files that are very large and when such a file fails with some error ,it becomes very difficult to track exactly for which record it is failing.
    For example if the file has 6000 records and the problem is at 641st record,it takes a lot of time to identify which is the 641st record even with Notepad++.
    One of the ways this can be taken care is if we can add any unique value from the record say "employee id" and add it in the error  that we receive in the alert message.
    Please let me know if any one has handled a similar situation or implemented any other solution to reduce delays in error analysis.

    Hi Indrajit,
    Thanks for your response.
    We have a dual stack installation but we have developed the Interface using only java stack.
    In this case if we use SALERT_CREATE and define container variables in ALRTCATDEF,will it work?
    Also the source xsd for all the Interfaces is same ,so we were thinking when a message fails at say Record[50],then we can take the 50th employee id and display it in the alert.
    Do you have an idea if this is possible?
    Nitin

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

  • Creating XML from XSD, Only create The First Element

    Hi,
    I create a XML File from a xsd schema by this way:
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setNamespaceAware(true);
              factory.setValidating(true);
                   factory.setAttribute(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
                   factory.setAttribute(JAXP_SCHEMA_SOURCE, new File(MY_SCHEMA));   
                    DocumentBuilder documentBuilder =factory.newDocumentBuilder();
              documentBuilder.setErrorHandler(new SimpleDOMHandler());
              Document parse = documentBuilder.parse(new File(MY_XML));The first lines of the schema:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         targetNamespace="http://gencat.net/scsp/esquemes/peticion"
         elementFormDefault="qualified" attributeFormDefault="unqualified"
         id="Peticio" xmlns:p="http://gencat.net/scsp/esquemes/peticion">
         <xs:element name="Apellido1">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:maxLength value="40" />
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:element name="Apellido2">
            .............................The problem is that the created document only have the first element "Apellido1". I dont know if it is a wrong xsd, or i'm using a bad way to do it.
    Thanks a lot, and apologize for my english

    Hi,
    Is it possible to create and populate XML from an XSD
    without knowing what the XSD elements are beforehand
    (all the examples appear to know what the input XSD
    will be, and therefore know what the set and get
    methods should be called)? I think it is possible--you would have to recompile each time (unless you can dynamically recompile, which would be neat), but using the classes getMethod() function, you can list all the methods. You would then have to do some tricky logic to determine which of the getMethods you want (for example NOT getClass()), and you can basically call them in sequence. You also need to worry about handling lists & recursively call xxxType classes.
    I'm experimenting with this, and it can get a little frustrating because there are a lot of odd cases to handle (for example, while setting the elements of a list, you need to actually get the list & add elements to it), but I think it's possible.
    >
    Can a user browse for an xsd to input, and the java
    will dynamically create the get methods, and be able
    to create instances and populate variables before
    converting to XML?
    What I'm puzzled about is where you'd get the data to populate the variables? Perhaps a database, or a bean? If you just want to make a test xml file, then it doesn't matter, but with real data, I think you'd still have to change how you actually get the variables you want to populate the xml file with, right? In other words, if your schema changed, the parameters you're passing to the set methods would change as well.
    Maybe we'll see some more packages in the future to make this task easier.

  • I have 2 phones on my iTunes account, why are text messages showing on the second phone when sent from the first

    I have 2 phones on my iTunes account, why are text messages showing on the second phone when sent from the first phone?

    it's meant to work like that
    so if you receive a message on your iphone you also get it on your ipad or ipod touch
    to avoid it use separate appleID for each device
    or turn off imessage on 1 or both devices in their settings
    but that will not fix the issue that 2 devices using the same appleID will never be able to facetime eachother
    the appleID is a unique handle for 1 user only

  • Getting Tag and value from the selected Xml element value

    Hi All,
    I have an xml file which i import to the Indesign CS3 .From the structure view , i drag and drop the root node on to the page. Now i select an xml value from the page. Now i need to get the element tag and value from the selected value.
    For example
    File Name : sample1.xml
    <Root>
    <employeeName> A</employeeName>
    <employeeEmail>[email protected]</employeeEmail>
    </Root>
    Now i import this sample.xml in my indesign CS3 and from the structure view i drag the Root  tag and drop it on the page.Now the values of the element tag are displayed.
    Now i select "[email protected]" from the page and i have a menu "Get Selected XML" on clicking which  i should get element tag with value.(i.e <employeeEmail>[email protected]</employeeEmail>)
    How to go about it.?
    Thanks
    Sakthi

    Hi Steve,
    If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
    Jared

  • Does coherence cache the value from the cache?

    Hi, I have the question about if the coherence caches the value from the cache? I believe it does from my test, just want to get the confirmation.
    I like to use an example to describe my question. For example:
    If (key1, value1) are in the cache1, (value1 is an object),
    for the first time, if cache1.get(key1), coherence will deserialize value1 and return. But if in the same JVM, when cache1.get(key1) is invoked again, coherence will return value1, which I believe is cached by coherence in the current JVM, and return; instead of deserializing and return it. Is that right?
    I am asking this question because I found a problem in our project when use coherence. As the above example, if I use value1 = cache1.get(key1), and in our project, value1 object has a set method to change one of its internal attributes, and this method was indeed invoked after value1 get from cache1. Then in another class, value2 = cache1.get(key1) is called again, and I found out that value2's attribute will have the modified value, even cache1.put(key1, value1) is never invoked in the first place.
    Of course, this kind of behavior matches the java.util.Map. But coherence cache is a cluster/distributed environment. In the above example, if on another data node, value3 = cache1.get(key1) will get the original attribute value in value3, since the deserialize object will always get the original value, unless the new value is put in explicitly by cache1.put(key1, value1).
    In this case, should cache1.get(key1) always return a clone object make more sense?
    Thanks

    You observation is correct. More specifically for cache topologies which include an in-process cache Coherence may return the same object reference for repeated get requests on the same key. I say "may" because for any variety of reasons we may also have to retrieve a fresh copy from a remote cache server. When possible we will return existing objects for performance reasons avoiding costly things like network hops, and de-serialization. Any modifications made to an object returned from the cache will not be made automatically available to other cluster members. Additionally if these modifications are made concurrently with another thread performing a cache.put() on the same value could result in a corrupt cached value if your serialization methods are not thread-safe. Best practice dictates that unless you are sure that you are using a cache topology which does not include an in-process cache that you treat the values returned from the cache as immutable, and instead deep clone() it before making any modifications.
    The distributed-scheme and remote-scheme are the only types of caches which do not include in-process caching, and thus always return "mutation safe" values. The most common in-process cache topology is near-scheme, but others include replicated-scheme, optimistic-scheme, local-scheme, and the programatically created ContinuousQueryCache.
    thanks,
    mark

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • Is it possible to bind the first element in a collection in a datagrid?

    I have a datagrid and I need to bind a property in the first element of the collection of my datasource object. By the momento I am using a converter:
    <DataGridTextColumn Header="MyValue" Binding="{Binding Converter={StaticResource myConverter}}"/>
    But I would like to avoid the need to use a converter, so I have tried this:
    <DataGridTextColumn Header="MyValue" Binding="{Binding MyCollectionProperty.ElementAt(0).MyValue}"/>
    Is there any way to do it?

    You cannot call ElementAt(i) from the XAML because it is a method.
    MyCollectionProperty[0] will certainly get you the first value of the MyCollectionProperty collection provided that the type has an indexer.
    If you want to be able to this without using a converter you must change the type of the property from ICollection<T> to for example IList<T>.
    You could create a wrapper property (potentially in a partial class definition) and bind to this one:
    //old property:
    public ICollection<YourType> MyCollectionProperty {
    get;
    set;
    //new wrapper:
    public IList<YourType> MyCollectionPropertyWrapper {
    get {
    return new List<YourType>(this.MyCollectionProperty);
    <DataGridTextColumn Header="MyValue" Binding="{Binding MyCollectionPropertyWrapper[0].MyValue}"/>
    ICollections are not very XAML friendly and you cannot bind to the first item of an ICollection using an indexer or ElementAt(0) or any other direct way.
    Please remember to mark all helpful posts as answer to close your threads.

  • How to get multiple values from the list

    I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
    <%     // clicked on Select District Button
    Vector vselectedDistrict = new Vector();
    Vector vdistrictID = new Vector();
    String tmpSelectDistrict = "";
    tmpSelectDistrict = request.getParameter("bSelectDistrict");
    if(tmpSelectDistrict != null)
         // get multiple values from the list
         String[] selectedDistrict = request.getParameterValues("usrTDistrict");
         vselectedDistrict.clear();
         vdistrictID.clear();
         if((selectedDistrict != null) && (selectedDistrict.length != 0))
                             for(int i=0;i<selectedDistrict.length;i++)
                   vselectedDistrict.addElement(selectedDistrict);           
              vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
              for(int i=0;i<vdistrictID.size();i++)
                   out.println("district = " + selectedDistrict[i]);                         out.println("district ID= " + vdistrictID.get(i).toString());
    %>
    // get vdistrict from the database here......
    <select name="usrTDistrict" size="5" multiple>
    <%     for(int i = 0; i< vdistrict.size(); i++)
    %>
         <option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
    <%
    %>          
    </select>
    <input type="submit" name="bSelectDistrict" value="Select District">
    Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
    what I got is this error message:
    org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    So where is going wrong and what the message means?. Any help very much appreciated. Thanks

    These are just guesses that might hopefully steer you in directions you haven't looked in yet.
    I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
    Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
    expects a Vector as its second parameter? And returns a Vector?
    I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector?

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

Maybe you are looking for