How can I convert string to xml in CEP

I made a simple CEP process that reads from a queue. The CEP has the following components:
1 input adapter named MktEvtInputadapter.
2 channel MktEvntInchannel
3. a MktEvntProcessorprocessor processor.
4. a MktEvntOutChannel output.
5. a MarketEventBean bean.

code for MarketEvent.java:
package com.bea.wlevs.example.algotrading.event;

public class MarketEvent {}

Private Sub Long;
symbol of the private channel;
price Double private;
volume of Long private;
private Long latencyTimestamp;
private string text;

/**
* @return the latencyTimestamp
*/
{} public Long getLatencyTimestamp()
Return latencyTimestamp;
}
/**
@param latencyTimestamp the latencyTimestamp to
*/
{} public void setLatencyTimestamp (Long latencyTimestamp)
this.latencyTimestamp = latencyTimestamp;
}
/**
* the timestamp @return
*/
{} public Long geteventTimeStamp()
return Sub;
}
/**
@param timestamp the timestamp to set
*/
{} public void seteventTimeStamp (Long Sub)
this.eventTimeStamp = Sub;
}
/**
* @return the symbol
*/
public String getSymbol() {}
return the symbol;
}
/**
@param symbol the symbol to define
*/
{} public void setSymbol (symbol of the chain)
This.Symbol = symbol;
}
/**
* @return the price
*/
{} public Double getPrice()
return of the price;
}
/**
@param price TBD
*/
{} public void setPrice (Double rate)
This.Price = price;
}
/**
* @return the volume
*/
{} public Long getVolume()
return of volume;
}
/**
@param volume the volume to set
*/
{} public void setVolume (Long volume)
This.volume = volume;
}
public void setString_1 (String text) {}
This.Text = text;
TODO self-generating method stub

}
public String getString_1() {}
TODO self-generating method stub
return (text);
}

}

Code for MarketEventBean:
package com.bea.wlevs.example.algotrading;

import com.bea.wlevs.ede.api.StreamSink;
import com.bea.wlevs.example.algotrading.event.MarketEvent;


/ public class MarketEventBean implements StreamSink {}
{} public void onInsertEvent (event object)
If (event instanceof MarketEvent) {}
MarketEvent marketEvent = (MarketEvent) event;

System.out.println ("msg:" + marketEvent.getString_1 ());
}
}

}

I put an xml doc in my queue for entry:
<? XML version = "1.0" encoding = "UTF-8"? >
< MarketEvent >
< sub > 201100501 < / sub >
< symbol > ABCD < / symbol >
< price > 258474.56 < / price >
< volume > 4657892 < / volume >
< latencyTimestamp > 201100501 < / latencyTimestamp >
< / MarketEvent >

My class MarketEventBean will print the msg as string. Now, I have to convert it to xml format to get the value of individual items.
How can I do?

I think you need to do this:

Events.Add (obj);

in this way, you add the event unmarshaled flow rather than just a string of text

Tags: Fusion Middleware

Similar Questions

  • How can I convert text to XML format in plain text?

    Oracle 11 g 2: 11.2.0.4.0

    I have data that is parsed from XML and saved in a table as a field of type VARCHAR.

    The text is formatted as follows:

    &amp;lt;span style=&amp;quot;font-family:'Times New Roman','serif'; font-size:12pt&amp;quot;&amp;gt;24 PC'S &amp;amp;quot;6 x 4up arrays&amp;amp;quot; =&amp;amp;nbsp; MAX FOR MIN QTY AT INDICATED LOT CHARGE &amp;lt;/span&amp;gt;&amp;lt;br&amp;gt; Material currently in stock


    I need to remove the formatting and convert the text to this:

    24 PC'S 6 x 4up arrays MAX FOR MIN QTY AT INDICATED LOT CHARGE Material currently in stock


    Is there an existing function in SQL or PL/SQL that will decode the formatting?

    Thank you

    -Johnnie

    This text is a string of HTML to the doubling actually escape sequence, because it contains a
    tag.

    Therefore, you must:

    -unescape any coded entities twice

    -replace the
    tag with a character LF - optional step depends on how you want to manage

    -remove all tags (using a regular expression)

    -eliminate the remaining entities

    This query will do:

    SQL> select utl_i18n.unescape_reference(
      2          regexp_replace(
      3            replace(
      4              dbms_xmlgen.convert(dbms_xmlgen.convert(str, 1), 1)
      5            , '
    ' 6 , chr(10) 7 ) 8 , '<[^>]+>' 9 ) 10 ) 11 from sample_data ; UTL_I18N.UNESCAPE_REFERENCE(RE -------------------------------------------------------------------------------- 24 PC'S "6 x 4up arrays" = MAX FOR MIN QTY AT INDICATED LOT CHARGE Material currently in stock
  • How can I convert String type to a Type of BinaryEntry?

    We must differentiate between the keys that come to the custom editor Erase method. So, we have added ' | ' at the end of the key as below

    key = "a"; Actual key which is cached

    If (//some condition)
    {
    newKey = "a" | newKey to differntiate
    getCache () .remove (newKey);
    }
    on the other
    getCache () .remove (key);

    Now, the call comes to our custom editor Erase method. Here, we must perform a different operation of the key which has ' | ' in there. So, we have added below code in the custom Erase method.

    public void clear (BinaryEntry binEntry)
    {
    Key of type string = (String) binEntry.getKey ();
    If (Key.Contains("|"))
    {
    You will need to do a DB here. Then,
    now, the key is "a |" We need to eliminate the "|" symbol and call the Delete method to delete the current key ('a') of the cache. So we added code below

    Replace string newKey = (nom_domaine_dns) ("|", "");

    Here, the problem is, key is of type String. But Erase method can take only BinaryEntry type. So, we tried this

    binEntry = (BinaryEntry) (binEntry.getContext () .getKeyToInternalConverter () .convert (key));

    Super.Erase (binEntry); but it dint work. The entry is not deleted from the Cache.

    How to convert key to type the string to BinaryEntry?

    }
    on the other
    {
    Super.Erase (binEntry);
    }
    }


    Can anyone suggest?

    Hello

    Yes, JK is right! I forgot that the remove() will remove the entry from the BackingMap. Another alternative would be to use the EP below:

    public class EP2 extends AbstractProcessor implements Serializable{
         private boolean isSynthetic;
    
         public EP2(boolean bln){
              this.isSynthetic=bln;
         }
         @Override
         public Object process(Entry entry) {
              BinaryEntry binEntry = (BinaryEntry) entry;
              if (isSynthetic){
                   //Synthetic Remove                    
    
                   // This is a bug and should evict entry and not call erase
                   //binEntry.remove(isSynthetic);   
    
                   //Alternative solution is to expire with a minimum delay of 1 ms
                   //This will call the store method so make a check of the original and new value and do nothing if they are same to avoid DB update
                            binEntry.expire(1);
    
              }else{
                   //Will hit the cache store
                   entry.remove(isSynthetic);
              }
              return null;
         }
    }
    

    Client side, make a call to delete as below:

    cache.invoke(key, new EP2(true)); // coherence eviction only
    
    cache.invoke(key, new EP2(false)); // for invoking erase()
    

    I hope this helps!

    See you soon,.
    NJ

  • How can I convert strings in class names?

    I have a number of movieclips export for Actionscript. I would like to create new instances of them in my class of documents based on names in an XML file. My problem is that the names in the XML file are strings. This makes me end up basically coding:
    var a = new Symbol01 "()" ""
    where I want to create a new instance of Symbol01. Is there a way to convert the string to a class name, so that it indicates
    var a = new Symbol01()

    :

  • How can I get the original xml code to a webservice called...

    I use WL 10.3.

    I created a WebService using WSDL as a starting point. The Web service is running as it should, but now I want to go back to the original XML that was passed in.

    I tried to collect the data to a string using JAXB, but he complains that there is no notation for @XmlRootElement - so, who does not work.

    I also tried to access the original data by injecting the WebServiceContext, but this value is always zero (not sure why that doesn't work)...


    Is someone can you PLEASE tell me how can I get the original XML code?

    You can use managers to this end, for example,

    package server.handlers;
    
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.ws.LogicalMessage;
    import javax.xml.ws.handler.LogicalHandler;
    import javax.xml.ws.handler.LogicalMessageContext;
    import javax.xml.ws.handler.MessageContext;
    
    public class ServiceLogicalHandler implements LogicalHandler {
    
        public boolean handleMessage(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICAL - DIRECTION IS OUTBOUND");
            } else {
                System.out.println("LOGICAL - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public boolean handleFault(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICALFAULT - DIRECTION IS OUTBOUND");
    
                LogicalMessage message = context.getMessage();
                Source payload = message.getPayload();
                try {
                    Transformer transformer = TransformerFactory.newInstance().newTransformer();
                    transformer.transform(payload, new StreamResult(System.out));
                } catch (TransformerException ex) {
                    ex.printStackTrace();
                }
            } else {
                System.out.println("LOGICALFAULT - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public void close(MessageContext context) {
        }
    }
    

    More information on managers can be found here: http://www.javaworld.com/javaworld/jw-02-2007/jw-02-handler.html

  • How can I convert my friends to the Game Center on Facebook?

    With the new iOS for my iPod & iPad, I lost all my friends Game Center.  I have two games that I play as I would like.  How can I convert my friends to the Game Center for Facebook friends?

    You do not have. They have two different systems. What you need to do is to start on. For example, if your game has a forum or support page, they may have a way for people to communicate to a friend. Or if they have a facebook page, they probably have a system for "I want to make friends."

    It is now up to the games themselves to put in place the means to a friend using iMessage. You will need to wait for your game to do.

  • How can I convert a page typed into an editable text file

    How can I convert a page typed in an edible text file? I have a 50 page typed (on a typewriter ;-) document I want to convert (scan?) in a format so that I can then open the file in a text editing application (Word?) and edit.

    How is the most effective (and least expensive) way to do it?

    Thank you

    HAL

    < re-titled by host >

    "Edible text file?" You hear as he print on rice paper, so you can serve it up like at dinner side dish? You want someone to eat their words

    I think that the last two multifunction printers, I bought came with some kind of OCR characters (OCR) software as part of the sweeping package.  I guess that's not the greatest.

  • How can I convert an incoming call read only an attachment so I can change it?

    How can I convert an incoming call reads only attachment so that I can change it? Save in Word does not it, and find research peut t.

    So, the problem seems to be that attachments are stored as files read-only by Thunderbird and an application it can open without editing privileges, so you cannot change the. Read-only mode was chosen because these files are kept in a temporary location. For example, if you modify and save the back, they are deleted when Thunderbird is closed, so losing your changes. The idea is to force to save you to a different location. You should be able to do it, then open it from that location with full editing capabilities.

    For a permanent change in this behavior, go in the [tools >] Options > advanced > general tab and click on Config Editor there. After you confirm the warning, copy - paste browser.helperApps.deleteTempFileOnExit into the search bar and switch false to true by double clicking on it. Now, saved attachments are created with read/write permissions, but is more removed when Thunderbird is closed (i.e., stored in % AppData%\Local\Temp).

  • How can I convert profiles Configfree 5.90.07 ConfigFree 7.2.16?

    How can I convert profiles Configfree 5.90.07 ConfigFree 7.2.16?

    I had on my old NB (M115-S3144) 40 ConfigFree profiles...
    I intend to 'import' in my new NB (M305-S4835) but it does not recognize!

    What can I do?

    Thank you...

    Hello

    I think that this is not possible because you tried to import from another model of laptop.
    I m not very well, but maybe that's a reason why it doesn't work because the ConfigFree software is different.

    Seems you have to re-create these profiles on the laptop Satellite M305.

    Best regards

  • When I download programs from the internet, they appear just in the form of collections of files TextEditor. How can I convert them into a program.

    When I download programs from the internet, they appear just in the form of collections of files TextEditor. How can I convert them into a program.

    What kind of programs? When you download from? How do download you them?

  • I have Pages version 5.6.1. How can I convert a document that I create in this version to an older version (Maverick) of Pages? I created documents in version 5.6.1 and I need for my colleague to open documents, but it has the ol

    I have Pages version 5.6.1. How can I convert a document that I create in this version to an older version (Maverick) of Pages? I created documents in version 5.6.1 and I need for my colleague to be able to open the documents, but it has the old version. I already clicked on 'option' and select 'duplicate' to get the prompt "save under". However, when I do this it does not to choose another version.

    To create a document that can be opened with previous versions of Pages, open the document in Pages, and go to the menu file (in the menu bar)-> export as-> Pages ' 09. Save the file and send it to your friend, if she can open it without any problem.

  • How can I convert 2400 (0 x 960) in 60 and 9 where 9 and 60 the fourth and fifth elements of an array?

    How can I convert 2400 (0 x 960) in 60 and 9 where 9 and 60 the fourth and fifth elements of an array of 8 elements?

    Thank you.

    Simplified version.

  • How can I convert my microsoft money version 5 to run on my mac

    How can I convert my microsoft money version 5 to run on my mac

    Hello

    Check in the Microsoft Money Forum.

    Microsoft Money - Forum
    http://social.Microsoft.com/forums/en/money/threads

    Microsoft Money Solution Center - suggests alternatives
    http://support.Microsoft.com/mny

    What is Microsoft Money Plus sunset
    http://support.Microsoft.com/kb/2118008

    BING - microsoft money replacement
    http://www.bing.com/search?q=Microsoft+Money+replacement&go=&QS=n&SK=&SC=7-27&form=QBLH

    Google - microsoft money replacement
    http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=microsoft+money+replacement&pbx=1&oq=microsoft+money+replacement&aq=f&aqi=g4&aql=&gs_sm=e&gs_upl=9978l11972l2l12926l12l1l0l0l0l0l467l467l4-1l1l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=dcc84c4c7dd2e143&biw=1024&bih=681

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How can I convert table 1 d in a 2D array.

    I have a table 1 d I want to get into an Excel template.  How can I convert a 2D table so I can enter Excel Table.vi easy?

    Be sure to check the correct operation. Solution-Marc adds another row of zeros and I don't know if this is desirable here. (See also)

  • How can I convert video content of film in DVD - VR format on a DVD-R

    DVD-video format

    How can I convert video content of film in DVD - VR format on the DVD-R disc in DVD-video format on the DVD-R disc?

    I need to know the software (s) to perform this conversion. My computer's DVD player (R/RW). TX.

    Google found the following software... maybe only he
    worth to try.

    They offer a fully-functional trial version for 30 days:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Extractor from DVD - VR
    http://www.MedioStream.com/products/index_dvdvrextractor.html

    If you try it... Let us know the resukt.

Maybe you are looking for

  • password storage

    Hi all Weird question that happened a few weeks back. On a few sites I just save my password in firefox as not really worried for the security being the site it is. in any case, I noticed a few weeks ago the storage of the password no longer works on

  • No your text Message or all - iOS iPhone display 6 9.2

    With this problem in the last few days since upgraded to ios 9.2.1. Do not receive notifications for text message at all, while the screen is locked or unlocked. Messages will be sitting inside without even showing on the home screen if there is no u

  • lack of music to iCloud iTunes 12.3.3.17

    Hi guys,. I just upgraded my itunes to the latest version (12.3.3.17) and since I did, most of my music to iCloud library is missing, particularly content that I got from Apple's music. I see songs and albums I bought long ago on the iTunes store, bu

  • Error message c19a0035

    Hello I get the error message c19a0035 for my printer HP Photosmart C7280. There is also a message that there is something wrong with the printing system How can I get this problem resolved? Jim

  • Sound and Audio drivers for my 412TU CQ40 laptop

    Hello Can anyone suggest me where I can download the audio drivers and sound for my laptop.