How to do the multimapping in File to File Scenario

Hi All,
I am doing File to File scenario using Multimapping Concept.pls send the procedure how to do the Massege mapping using Multimapping.
I have a source structure like this.
<order header>
order no
order Description
</order header>
<Orderitem>
matno
description
Qty
UOM
</Orderitem>
i need output text file Like
Ono Oodesc OMatno Odes Oqty OUOM
1      02    123    Oil  2    L
1      02    789    Milk 4    L
How to do the multimapping for this.if any Advanced java functions needed pls send the code.
Thanks
Govindu.

Hello Govind,
Make the target str as below
<root>
<Row>
<OrderNo></OrderNo>
<OrderDesc></OrderDesc>
<Matno></Matno>,
<Desc></Desc>
<Qty></Qty>
<UOM></UOM>
</Row>
</root>
The mapping for elements
<Matno>,<Desc>,<Qty>,<UOM> is straight-forward. The node <Row> can be mapped to <OrderItem> node in source. For orderNo and OrderDesc you need to use advanced UDF (with entire queue cached) as below.
public void getOrderNo(String[] a,String[] b,ResultList result, Container container){
/Declare a vector to store unique Order Numbers  /Order Desc/
Vector vOno = new Vector();
     for (int i = 0;i<a.length;i++){
     if (a<i>.equals()ResultList.CC) continue;
     /Add distinct Order numbers to the vector/
     if(!vOno.contains(a<i>)) vOno.add(a<i>);
int headerCounter = 0;
String value = new String();
value = (String) vOno.get(headerCounter);
     for (int j = 0;j<b.length;j++){
     /When context changes, move to next order no/
     if (b[j].equals()ResultList.CC){
                   headerCounter++;
                   value = (String) vOno.get(headerCounter);
                  continue;
     /Repeat the current order number/Order Desc until a context change occurs/
     result.addValue(value);
The mapping for OrderNo can be like below:
Pass <Order No> from Header to the UDF as array a[] and <OrderItem> from Item as array b[]. Take the output of the function and make it SplitByValue the result of which can be passed to OrderNo. The context of both < Order No> and <OrderItem> has to be one level higher.
Similar mapping for OrderDesc can be made using the same UDF
I hope that resolves your problem.
Regards
Amit

Similar Messages

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How to check the resolution of a pdf file using Acrobat 9 pro?

    How to check the resolution of a pdf file using Acrobat 9 pro?

    PDF files don't have one resolution, but may have none or many different resolutions, one per image. You can check the maximum/minimum resoluion with preflight in Acrobat Pro, but not in Adobe Reader.

  • How to get the content in embed swf file in Swf Loader on run time

    How to get the content in embed swf file in Swf Loader on run time
    [Bindable]
    [Embed(source="assets/index.swf")]
       private var SWFSRC:Class;
    <mx:SWFLoader id="_swfloader" source="{SWFSRC}" />

    Hi Flex harUI,
    Throw the error.
    Access of undefined property content

  • How to read the content of ms-word file use pure java???

    how to read the content of ms-word file use pure java???

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to organize the import statements in FXML Files?

    Hello,
    I'm a user of NetBeans IDE and it can organize the import statements in *.java files. Now, I'm using JavaFX and editing the *.fxml files as well. I want to know how to organize the import statements in *.fxml files?
    Thanks a lot.

    You should use Scene Builder, it will make all these import statements for you.
    Moreover, it will greatly simplify the writing of your FXML files, since you only have to Drag&Drop JavaFX objects on the scene. Then, it automatically generates FXML files.

  • How to place the images in Indesign xml file by Javascript?

    How to place the images in Indesign xml file by Javascript?
    We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.

    Hi,
    You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
    If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
    var x = some XMLElement
    x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
    If already placed, then you have to get the associated pageItem, then place your file into it.
    pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
    Hope that helps,
    Loic
    http://www.loicaigon.com

  • How to setup the access privilege of flash file in Web Intelligence?

    How to setup the access privilege of flash file in Web Intelligence?   WEBI can set access privilege for single WEBI report file, but it seem cano not set access privilege for one flash file.

    Thank you Maksim,
    I did set the "selectionMode" to "Auto". I don't understand where In supply function I have to set lead selection of nested node to first element. Please elaborate on this. Are you talking about the context attribute bound to the second table? OR do I have to change the Importing parameters "Node" and "Parent_Element" of my supply function?
    Thanks for your time.

  • How to get the absolute path of a file from the local disk given the file n

    how to get the absolute path of a file from the local disk given the file name

    // will look for the file at the current working directory
    // this is wherever you start the Java application (cound be C: and your
    // application is located in C:/myapp, but the working dir is C:/
    File file = new File("README.txt"); 
    if (file != null && file.exists())
        String absolutePath = file.getAbsolutePath();

  • How to Extract the Highlight Text in PDF File

    Hi Scripters,
    i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
    regards
    baby

    Hi,
    Okay i'll try do best.
    thanks for your reply.
    Regards
    Baby

  • How to increase the speed of video (avi file) using labview

    How to increase the speed of video (.avi file) using labview? I have  tried this by skiping alternate frames. also I have used  minimum time delay.Is there  any other option for which i can go?
    please suggest me........... 

    Are you using NI Vision IMAQ AVI Read Frame or anther method to read the AVI file?
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • How to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    how to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    Let's say you have a zipped audio collection (audio.zip) containing mp3 files. And you are at a Terminal prompt.
    List the files in the zip archive
    unzip -l audio.zip (that is ell)
    Extract all mp3 audio files into a new home directory folder called mymusic
    unzip -d ~/mymusic audio.zip \*.mp3
    Variations of the above will depend the zip contents, and internal structure. If the zipped audio collection was gzipped, or someone used rar on it, then the extraction process will be different.

  • How to write the nodevalue back to xml file?

    Hi, Everybody:
    These are two packages I used. javax.xml.parsers.*,org.w3c.dom.*
    Now I use "setNodeValue("abc") to set the node value to "abc". But it is not really saved back into XML file. It only change the node value in memory.
    How to write the changes back to XML file? Thank you very much for your help.
    Michelle

    * Version : 1.00
    * File Purpose : Given the xml file loads into dom and recreate the file with the updated values.
    * Developer : Kashif Qasim : 25/july/04
    * Modify detail :
    import java.lang.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import org.w3c.dom.*;
    import org.apache.xerces.parsers.DOMParser;
    import org.apache.xerces.*;
    public class XMLWriter
    private String displayStrings[] = new String[5000];
    private int numberDisplayLines = 0;
    private Document document;
    //private final Node c;
    public synchronized void displayDocument(String uri,Vector UpdatedValues,String getTaskID)
    try {
    DOMParser parser = new DOMParser();
    parser.parse(uri);
    document = parser.getDocument();
    display(document, "",UpdatedValues);
    } catch (Exception e) {
    e.printStackTrace(System.err);
    ReadXmlConfig objReadXmlConfig = null;
    FileWriter filewriter = null;
    try {
    filewriter = new FileWriter(uri);
    for(int loopIndex = 0; loopIndex < numberDisplayLines; loopIndex++){
    filewriter.write(displayStrings[loopIndex].toCharArray());
    //System.out.println("displayStrings[loopIndex].toCharArray() "+displayStrings[loopIndex].toString());
    //filewriter.write("\n");
    filewriter.close();
    System.gc();
    objReadXmlConfig = new ReadXmlConfig();
    objReadXmlConfig.ITSLog("File updated for "+getTaskID+" succesfully, file is closed now ");
    } catch (IOException e) {
    System.err.println("Caught IOException: " + e.getMessage());
    objReadXmlConfig = new ReadXmlConfig();
    objReadXmlConfig.ITSErrorLog("File updated FAILED for "+getTaskID+". Reason for file error "+e.toString());
    }finally {
    if (filewriter != null) {
    System.out.println("Closing File");
    objReadXmlConfig =null;
    try{
    filewriter.close();
    }catch(IOException e){
    System.err.println("Caught IOException: " + e.getMessage());
    } else {
    System.out.println("File not open");
    private void display(Node node, String indent, Vector UpdtRecs)
    if (node == null) {
    return;
    int type = node.getNodeType();
    NodeList nodeList = document.getElementsByTagName("QueryParm");
    int TotalRecs = UpdtRecs.size();
    switch (type) {
    case Node.DOCUMENT_NODE: {
    displayStrings[numberDisplayLines] = indent;
    displayStrings[numberDisplayLines] +=
    "<?xml version=\"1.0\" encoding=\""+
    "UTF-8" + "\"?>";
    numberDisplayLines++;
    displayStrings[numberDisplayLines] += "\n";
    display(((Document)node).getDocumentElement(), "",UpdtRecs);
    break;
    case Node.ELEMENT_NODE: {
    if(node.getNodeName().equals("QueryParm")) {
    for(int i =0 ; i< nodeList.getLength() ; i++)
    Node nodeQry = nodeList.item(i);
    NamedNodeMap nnp = nodeQry.getAttributes();
    for(int j= 0 ; j < nnp.getLength() ; j++)
    Attr atr = (Attr) nnp.item(j);
    if(atr.getName().equalsIgnoreCase("value_"+(i+1)))
    //System.out.println(atr.getName() +" : " + atr.getNodeValue() );
    atr.setNodeValue(UpdtRecs.get(i).toString());
    displayStrings[numberDisplayLines] = indent;
    displayStrings[numberDisplayLines] += "<";
    displayStrings[numberDisplayLines] += node.getNodeName();
    int length = (node.getAttributes() != null) ?
    node.getAttributes().getLength() : 0;
    Attr attributes[] = new Attr[length];
    for (int loopIndex = 0; loopIndex < length; loopIndex++) {
    attributes[loopIndex] = (Attr)node.getAttributes().item(loopIndex);
    for (int loopIndex = 0; loopIndex < attributes.length; loopIndex++) {
    Attr attribute = attributes[loopIndex];
    displayStrings[numberDisplayLines] += " ";
    displayStrings[numberDisplayLines] += attribute.getNodeName();
    displayStrings[numberDisplayLines] += "=\"";
    displayStrings[numberDisplayLines] += attribute.getNodeValue();
    displayStrings[numberDisplayLines] += "\"";
    displayStrings[numberDisplayLines]+=">";
    numberDisplayLines++;
    NodeList childNodes = node.getChildNodes();
    if (childNodes != null) {
    length = childNodes.getLength();
    indent += " ";
    for (int loopIndex = 0; loopIndex < length; loopIndex++ ) {
    display(childNodes.item(loopIndex), indent,UpdtRecs);
    break;
    case Node.CDATA_SECTION_NODE: {
    displayStrings[numberDisplayLines] = "";
    displayStrings[numberDisplayLines] += "<![CDATA[";
    displayStrings[numberDisplayLines] += node.getNodeValue();
    displayStrings[numberDisplayLines] += "]]>";
    numberDisplayLines++;
    break;
    case Node.TEXT_NODE: {
    displayStrings[numberDisplayLines] = "";
    String newText = node.getNodeValue().trim();
    if(newText.indexOf("\n") < 0 && newText.length() > 0) {
    displayStrings[numberDisplayLines] += newText;
    displayStrings[numberDisplayLines] += "\n";
    numberDisplayLines++;
    break;
    case Node.PROCESSING_INSTRUCTION_NODE: {
    displayStrings[numberDisplayLines] = "";
    displayStrings[numberDisplayLines] += "<?";
    displayStrings[numberDisplayLines] += node.getNodeName();
    String text = node.getNodeValue();
    if (text != null && text.length() > 0) {
    displayStrings[numberDisplayLines] += text;
    displayStrings[numberDisplayLines] += "?>";
    displayStrings[numberDisplayLines] += "\n";
    numberDisplayLines++;
    break;
    if (type == Node.ELEMENT_NODE) {
    displayStrings[numberDisplayLines] = indent.substring(0,
    indent.length() - 4);
    displayStrings[numberDisplayLines] += "</";
    displayStrings[numberDisplayLines] += node.getNodeName();
    displayStrings[numberDisplayLines] += ">";
    displayStrings[numberDisplayLines] += "\n";
    numberDisplayLines++;
    indent += " ";
    public static void main(String args[])
    Vector xmlValue = new Vector();
    xmlValue.add(0,"Kashif");
    xmlValue.add(1,"Qasim");
    //displayDocument("NewMediation.xml",xmlValue);
    <?xml version="1.0" encoding="UTF-8"?>
    <Mediation>
    <Task1>
    <Source>
    <SourceDriver>com.microsoft.jdbc.sqlserver.SQLServerDriver</SourceDriver>
    <SourceConnection>jdbc:microsoft:sqlserver://10.2.1.58:1433;DatabaseName=MTCVB_HDS;</SourceConnection>
    <SourceUser>sa</SourceUser>
    <SourcePassword>sa</SourcePassword>
    <Table>
    <SourceTable>t_Agent</SourceTable>
    <SourceQuery><![CDATA[SELECT SkillTargetID,PersonID,PeripheralID,EnterpriseName,PeripheralNumber,Deleted,TemporaryAgent,AgentStateTrace,ChangeStamp FROM t_Agent where SkillTargetID > {value_1} order by SkillTargetID]]>
    </SourceQuery>
    <SourceParm BusinessRule="" ColumnName="SKILLTARGETID" ColumnNumber="1" DataType="Numeric" DefaultValue="0" Format="mm/dd/yyyy xx:xx:xx XX">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="PERSONID" ColumnNumber="2" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="PERIPHERALID" ColumnNumber="3" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="ENTERPRISENAME" ColumnNumber="4" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="PERIPHERALNUMBER" ColumnNumber="5" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="DELETED" ColumnNumber="6" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="TEMPORARYAGENT" ColumnNumber="7" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="AGENTSTATETRACE" ColumnNumber="8" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <SourceParm BusinessRule="" ColumnName="CHANGESTAMP" ColumnNumber="9" DataType="String" DefaultValue="" Format="">
    </SourceParm>
    <QueryParm FldName_1="SkillTargetID" FldType_1="Number" value_1="0">
    </QueryParm>
    </Table>
    </Source>
    </Task1>
    </Mediation>
    The QueryParm values are updated thru this code :)
    Hope it helps u ...

  • How to rename the SharePoint Document Library existing file name using Web service

    Hi,
    How to rename the SharePoint Document Library existing file name using SharePoint Web service.
    Is it possible. How could i do it?
    Thanks & Regards
    Poomani Sankaran

    Hi,
    Lists.UpdateListItems Method
    would be helpful for your requirement.
    Here is a blog with code demo for your reference:
    http://blogs.msdn.com/b/knowledgecast/archive/2009/05/20/moss-using-the-list-web-service-to-rename-a-file.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • How to add field to the header for FBL5N ALV report

    Hi,    I need to add fields to the customer line item display ALV report(FBL5N) header part.Right now there are four fields in the header like customer, company code, name and city, after that I need to add first name last name and phone no. Can any

  • How can I fix conflict with Thunderbird and my ISP (Shaw.ca) provided McAfee?

    When "Real-Time Scanning" is running, Thunderbird goes to "not responding" for a minute or so and CPU usage often goes to 100 %. If I turn off "Real-Time Scanning" TB seems to work okay, but I expect I am vulnerable to viruses. This problem has been

  • How can I get a line installed at an earlier date?

    Hi, I'm moving into a second home in Poole Dorset next week and despite giving plenty of notice (3 weeks), Open Reach are not offering to arrive in time to install a new phone line while I'm there.  The current date I have from them is 9th August but

  • Month end closing _ production parts local purchase

    Hi Experts, My client wants to closing the month and He wanted to know the possible  Errors may occur FI,,MM,PP side related to local procurement Please reply Thanks in advance Jerry Moderator: If everything is in order, then no errors are anticipate

  • Macbook Air IOS 10.9.2 infected

    Although I am a relatively experienced and conservative web surfer, my Macbook Air became infected with the virus that plays random audio streams in the background, rendering any audio application unusable.  Can anybody help me identify and disinfect