Can inherited events be used with only one processor? - Complex Event Processing

Hi friends!
The question is quite simple: I have one parent event and several events which inherit from the first one. Every inherited event has its own properties and also the inherited properties (which have public visibility in the parent class so that the inheritance is automatic). I pass events to the CEP processor but it only works with the parent class and doesn't with the child ones. I mean, I'm using only one processor and only one CQL sentence.
Is it neccesary to configure one processor for every inherited event?
Thanks! 

Hi again!
I have also tried using two processors, but it doesn't work neither. I'm using the same adapter for all events and the interface InboundMessageConverter which implements "convert" method for processing messages from queues. It works if I return the parent class but doesn't if I return any of the childs using inheritance mechanism.
What is happening?
Thanks! 

Hi,
Can you include the EPN and the queries you are using?
Thanks 

Hi friend!
Here you are:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xmlns:jdbc="http://www.oracle.com/ns/ocep/jdbc"
xmlns:spatial="http://www.oracle.com/ns/ocep/spatial"
xmlns:application="http://www.bea.com/ns/wlevs/config/application"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd
http://www.oracle.com/ns/ocep/jdbc
http://www.oracle.com/ns/ocep/jdbc/ocep-jdbc.xsd
http://www.oracle.com/ns/ocep/spatial
http://www.oracle.com/ns/ocep/spatial/ocep-spatial.xsd
http://www.bea.com/ns/wlevs/config/application
http://www.bea.com/ns/wlevs/config/application/wlevs_application_config.xsd">
     <bean id="myConverter" class="com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter"/>
     <wlevs:adapter id="jmsInbound" provider="jms-inbound">
          <wlevs:listener ref="mesEventsChannel" />
          <wlevs:listener ref="inputPetitionChannel" />
          <wlevs:instance-property name="converterBean"
               ref="myConverter" />
     </wlevs:adapter>
<wlevs:event-type-repository>
<wlevs:event-type type-name="MeSEvent">
<wlevs:class>com.bea.wlevs.event.example.mesevents.MeSEvent</wlevs:class>
</wlevs:event-type>
<wlevs:event-type type-name="InputPetition">
<wlevs:class>com.bea.wlevs.event.example.mesevents.InputPetition</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
<wlevs:channel id="mesEventsChannel" event-type="MeSEvent" advertise="true">
<wlevs:listener ref="mesEventsProcessor"/>
</wlevs:channel>
<wlevs:channel id="inputPetitionChannel" event-type="InputPetition" advertise="true">
<wlevs:listener ref="mesEventsProcessor"/>
</wlevs:channel>
<!-- The default processor for OCEP 11.0.0.0 is CQL -->
<wlevs:processor id="mesEventsProcessor" />
<wlevs:channel id="mesEventsOutputChannel" event-type="MeSEvent" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.mesevents.MeSEventsBean"/>
</wlevs:listener>
<wlevs:source ref="mesEventsProcessor"/>
</wlevs:channel>
<wlevs:channel id="inputPetitionOutputChannel" event-type="InputPetition" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.mesevents.MeSEventsBean"/>
</wlevs:listener>
<wlevs:source ref="mesEventsProcessor"/>
</wlevs:channel>
</beans>
It says the following:
As you can see there are two input channels which are both connected to the JMS adapter as well as only one processor which is connected to the input channels and to the output channels. It is supposed that each event goes through each input and output channel but it fails and says the following:
Channels mesEventsOutputChannel and inputPetitionOutputChannel from the same query must have the same event type.
InputPetition is MeSEvent's child. It inherits all MeSEvent's preperties.
Does anybody know what is happening?
Thanks! 

Hi,
You have two issues from my understanding:
1) it's not proper to use a single source to send events in multiple types.
2) if you want to get a particular query's result, you need to use <selector/> for the channel's configuration.
To fix the problem you currently have, you can add the following configuration at META-INF/wlevs/config.xml(or other file names)
<channel>
<name>mesEventOutputChannel</name>
<selector>mesEventQuery</selector>
</channel>
<channel>
<name>inputPetitionOutputChannel</name>
<selector>inputPetitionEventQuery</selector>
</channel>
I suppose you defined two queries, mesEventQuery used mesEventChannel while inputPetitionEventQuery uses inputPetitionChannel 

Thanks!
It has apparently worked. As you say, it appears to be not very proper to receive more than one event type from the same source so I guess I have to implement two queues (each one for each event), don't have?
I have also tried to run a JOIN between both events as follows but it doesn't work neither:
select m.mesMessage, m.origin, i.mesMessage from mesEventsChannel as m, inputPetitionChannel as i where m.mesMessage=i.mesMessage
The compiler says in my mother language something like a not linked flow is not allowed. What does it mean?
Thanks! 

I have achieved the compiler not to show any error with the JOIN sentence that follows, but it doesn't work (I think it's because no output channel is listening):
<query id="joinQuery">
<!-- RSTREAM (select m.mesMessage, m.origin, i.mesMessage from mesEventsChannel as m, inputPetitionChannel as i where m.mesMessage=i.mesMessage) -->
select m.mesMessage, m.origin, i.mesMessage from mesEventsChannel as m, inputPetitionChannel as i where m.mesMessage=i.mesMessage
</query>
I have set both streams as relations in the EPN configuration file setting the parameter is-relation to true.
Also, if I change channels' tags and include the query, the compiler shows an error. As I understand following the official CEP documentation, this query would insert both event types in both output channels when the condition is fulfilled.
The compiler does not show any error setting channels as follows:
<channel>
     <name>mesEventsOutputChannel</name>
     <selector>mesEventsQuery joinQuery</selector>
</channel>
<channel>
     <name>inputPetitionOutputChannel</name>
     <selector>inputPetitionEventQuery</selector>
</channel>
<channel>
     <name>inputPetitionOutputChannel2</name>
     <selector>inputPetitionEventQuery2</selector>
</channel>
In this way, the compiler shows an error which I write at the end:
<channel>
     <name>mesEventsOutputChannel</name>
     <selector>mesEventsQuery joinQuery</selector>
</channel>
<channel>
     <name>inputPetitionOutputChannel</name>
     <selector>inputPetitionEventQuery joinQuery</selector>
</channel>
<channel>
     <name>inputPetitionOutputChannel2</name>
     <selector>inputPetitionEventQuery2</selector>
</channel>
The stage "inputPetitionOutputChannel" is improperly connected to other EPN elements. This problem
will prevent queries for this processor configuration element from being validated. Channels
inputPetitionOutputChannel and mesEventsOutputChannel from the same query must have the same
event type
What happens?
Thanks! 

What I exactly mean is how to send both events types from a single join query to two different output channels. Shall I use "selector" tag? I have tried it but the compiler doesn't allow me to do it.
Thanks! 

Nobody? 

If there is a single query, then there is only one set of attributes so you should be able to use the same event-type on both downstream channels. It looks like you want one to be set to the event-type of one channel to the parent and the other listening channel to be the event-type of the child. If your single join query, is outputting the values of the child you won't be able to use the parent event-type on the subsequent listening channel. You'll get a compiler error because there is no way to set one of the output attributes. You'll need to use a separate query that only outputs the attributes of the parent event-type. Also, you may not need to worry about having two queries. The server optimizes them to run together (within the same processor); they don't run sequentially separately. 

Thanks friend, but my question refereed to a general situation in which I have a JOIN query and I want to send each set of events of each event type to each output channel to be used in the bean. I'm not able to send each set of events to a different output channel because the compiler doesn't allow me to do it, neither only one set of events to one output channel (ignoring the others), because when I run the application on the server, the join query doesn't work. 

Hi,
Can you post the exact compiler error and the query that is not working?
Thanks
Alex 

Here you are:
In the congig.xml:
select i.mesMessage, o.mesMessage from inputPetitionChannel as i, outputPetitionChannel as o where i.mesMessage="InputPetition" and o.mesMessage="OutputPetition"
<channel>
     <name>joinChannelInputPetition</name>
     <selector>joinQuery</selector>
</channel>
In the context.xml:
<wlevs:channel id="joinChannelInputPetition" event-type="InputPetition" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.mesevents.MeSEventsBean"/>
</wlevs:listener>
<wlevs:source ref="mesEventsProcessor"/>
</wlevs:channel>
----------------------
InputPetition events doesn't go through joinChannelInputPetition, why? And, how can I use OutputPetition events from this query?
Thanks! 

I have not achieved it yet. I'll ask it again simplier:
I need to execute a join CQL query between two input channles and send each event type through each output channel.
I also need to execute an avg CQL query and send the result (I guess a double) through another output channel. I need to know how to configure an output channel to send a double through it. I mean I need a double to be sent (instead of an event) through an output channel and I don't know how to configure it, I haven't seen how to do it in the official documentation.
Does anybody know how to do both?
Thanks! 

1) For your query , "select m.mesMessage, m.origin, i.mesMessage from mesEventsChannel as m, inputPetitionChannel as i where m.mesMessage=i.mesMessage"
You are trying to JOIN 2 unbounded streams (mesEventsChannel , inputPetitionChannel ) which is not allowed. You will need to use a WINDOW over the each Stream for a meaningful JOIN
2) "l. I need to know how to configure an output channel to send a double through it. I mean I need a double to be sent (instead of an event) through an output channel and I don't know how to configure "
How about creating an event-type with exactly 1 double attribute

Related

How can I select events from two different channels?

Hi everybody, I have another question! :)
When processing events in config.xml, using a CQL sentence, Eclipse compiler doesn't allow me to select more than one event.
I paste here my app.context.xml and my config.xml:
app.context.xml:
<wlevs:event-type-repository>
<wlevs:event-type type-name="HorseEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.HorseEvent</wlevs:class>
</wlevs:event-type>
<wlevs:event-type type-name="GunmanEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.GunmanEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
<!-- Adapter can be created from a local class, without having to go through a adapter factory -->
<wlevs:adapter id="sevenhorsesAdapter" class="com.bea.wlevs.adapter.example.sevenhorses.SevenHorsesAdapter" >
<wlevs:instance-property name="messageHorse" value="I am the horse number: "/>
<wlevs:instance-property name="messageGunman" value="I am the gunman number: "/>
</wlevs:adapter>
<wlevs:channel id="horseInputChannel" event-type="HorseEvent" >
<wlevs:listener ref="sevenhorsesProcessor"/>
<wlevs:source ref="sevenhorsesAdapter"/>
</wlevs:channel>
<wlevs:channel id="gunmanInputChannel" event-type="GunmanEvent" >
<wlevs:listener ref="sevenhorsesProcessor"/>
<wlevs:source ref="sevenhorsesAdapter"/>
</wlevs:channel>
<!-- The default processor for OCEP 11.0.0.0 is CQL -->
<wlevs:processor id="sevenhorsesProcessor" />
<wlevs:channel id="horseOutputChannel" event-type="HorseEvent" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.sevenhorses.SevenHorsesBean"/>
</wlevs:listener>
<wlevs:source ref="sevenhorsesProcessor"/>
</wlevs:channel>
<wlevs:channel id="gunmanOutputChannel" event-type="GunmanEvent" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.sevenhorses.SevenHorsesBean"/>
</wlevs:listener>
<wlevs:source ref="sevenhorsesProcessor"/>
</wlevs:channel>
And here you are the two config.xml, I have tried two different ones and none of them runs.
The first one is:
<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>sevenhorsesProcessor</name>
<rules>
<query id="horsesRule">
<![CDATA[ select * from horseInputChannel
        ]]>
</query>
<query id="gunmansRule">
<![CDATA[ select * from gunmanInputChannel
        ]]>
</query>
</rules>
</processor>
</n1:config>
As you can see, I use here TWO CQL sentences from the two channels that are defined in app.context.xml.
The other one is:
<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>sevenhorsesProcessor</name>
<rules>
<query id="horsesRule">
<![CDATA[ select * from horseInputChannel, gunmanInputChannel
        ]]>
</query>
</rules>
</processor>
</n1:config>
I use here only ONE CQL sentence in which I try to get events from the two channels that are defined.
None of them works.
Can anybody help me?
Thank you! 
I have achieved to receive both messages from the two events I send, but without including the second event in any tag. Now, I cannot filter events with a CQL sentence using regular expressions.
Here you are the modified app.context.xml file:
<wlevs:event-type-repository>
<wlevs:event-type type-name="HorseEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.HorseEvent</wlevs:class>
</wlevs:event-type>
<wlevs:event-type type-name="GunmanEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.GunmanEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
<!-- Adapter can be created from a local class, without having to go through a adapter factory -->
<wlevs:adapter id="sevenhorsesAdapter" class="com.bea.wlevs.adapter.example.sevenhorses.SevenHorsesAdapter" >
<wlevs:instance-property name="messageHorse" value="I am the horse number: "/>
<wlevs:instance-property name="messageGunman" value="I am the gunman number: "/>
</wlevs:adapter>
<wlevs:channel id="horseInputChannel" event-type="HorseEvent">
<wlevs:listener ref="sevenhorsesProcessor"/>
<wlevs:source ref="sevenhorsesAdapter"/>
</wlevs:channel>
<!-- The default processor for OCEP 11.0.0.0 is CQL -->
<wlevs:processor id="sevenhorsesProcessor" />
<wlevs:channel id="horseOutputChannel" event-type="HorseEvent" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.sevenhorses.SevenHorsesBean"/>
</wlevs:listener>
<wlevs:source ref="sevenhorsesProcessor"/>
</wlevs:channel>
As you can see, GunmanEvent is not included in any tag, only the first one called event-type-repository, but it receive messages anyway.
And here you are the config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>sevenhorsesProcessor</name>
<rules>
<query id="horsesRule">
<![CDATA[ select * from horseInputChannel
        ]]>
</query>
</rules>
</processor>
</n1:config>
If I change the select sentence for another one like "select message from horseInputChannel", it also works, but if I change it for "select messageHorse from horseInputChannel" it doesn't work, neither using regular expressions to filter events with the first one.
Does anybody know what is happening?
Thanks! 
Hi,
Please keep the following rules in mind for CEP processing.
1) The sender and receiver are decoupled. This means the sender does not know the receiver, and the receiver does not know the sender
2) Only one type of event is allowed for a channel. Processor is able to process multiple events
3) A channel is able to only receive events generated from specific CQL rule in processor, which is configured with "selector" tag
According to rule 1), the adapter would not know which which channel to be sent with HorseEvent, and which channel is to be sent with GuanmanEvent
According to rule2), the processor is able to deal with two events, and uses them in one CQL statement(join as in SQL)
According to rule3), you can use a selector in the output channel to let the channel only receive the interested events
Below is my suggestion:
1)
Adapter1(HorseEvent) -> Channel1(HorseEvent) -> Processor1(Rule1 for HorseEvent, Rule2 for GunmanEvent) -> Channe3(Select Rule1)
Adapter2(GunmanEvent -> Channel2(GunmanEvent -> -> Channel4(Select Rule2)
Or simply 2)
Adapter1(HorseEvent) -> Channel1(HorseEvent) -> Processor1(Rule1 for HorseEvent) -> Channe2(Select Rule1)
Adapter2(GunmanEvent) -> Channel3(GunmanEvent) -> Processor2(Rule2 for GunmanEvent) -> Channe4(Select Rule2) 
Thank you Junger!
OK, I knew the first and the third ones, and supposed the second. Well, I have achieved to pass both events to the output channel and then to the bean class without sending GunmanEvent through any channel as I said in my last message, I mean, only declaring it on the top of the xml configuration file.
How is it possible?
In the other hand, in the CQL sentence, I have the following:
select * from horseInputChannel
select message from horseInputChannel
I don't have any attribute called "message" anywhere, neither the adapter nor the xml configuration file nor in HorseEvent or GunmanEvent. Both of them work. Why?
Reading your tip, I assume it is not possible to send more than one event from only one adapter. I need to send two or more events from the same adapter. Is it possible?
Thank you! 
Hi,
Just to be clear: a channel is specified with a single event-type, but you can certainly send multiple events (i.e. batch) in a single call by using com.bea.wlevs.ede.api.BatchStreamSender.
Regarding your CQL question, perhaps you have a view that assigns the result of a event property to a property called 'message'?
Thanks, 
Thank you for your answer!
The forum has been down for many hours...
Well, the matter is that I cannot select any event attribute in the CQL sentence, only "*" (all) or "message", and I don't have any attribute called "message" in any class, just "messageHorse" and "messageGunman" in the event classes.
I have created another project with another event attributes and it happens the same, I can only select an attribute called "message" which doesn't exist anywhere.
Thank you! :-) 
Does anybody know anything about it?
Thanks! 
It is quite possible that something is set up incorrectly. Could you paste the contents of your spring config file and application configuration file with the CQL statement? 
Today is national holiday in my country and I'm not at work now, I'll do it tomorrow as soon as possible.
What do you mean with "spring config file" and "application configuration file"? Where are them exactly?
Thanks! 
Spring file is the one under META-INF/spring.
Application config file is the one under META-INF/wlevs. 
Spring file is AAPNAME.context.xml file? 
Hi! Here you are the files you required:
SevenHorses.context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="HorseEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.HorseEvent</wlevs:class>
<wlevs:properties>
<wlevs:property name="messageHorse" type="java.lang.String"></wlevs:property>
</wlevs:properties>
</wlevs:event-type>
<wlevs:event-type type-name="GunmanEvent">
<wlevs:class>com.bea.wlevs.event.example.sevenhorses.GunmanEvent</wlevs:class>
<wlevs:properties>
<wlevs:property name="messageGunman" type="java.lang.String"></wlevs:property>
</wlevs:properties>
</wlevs:event-type>
</wlevs:event-type-repository>
<!-- Adapter can be created from a local class, without having to go through a adapter factory -->
<wlevs:adapter id="sevenhorsesAdapter" class="com.bea.wlevs.adapter.example.sevenhorses.SevenHorsesAdapter" >
<wlevs:instance-property name="messageHorse" value="I am the horse number: "/>
<wlevs:instance-property name="messageGunman" value="I am the gunman number: "/>
</wlevs:adapter>
<wlevs:channel id="horsesInputChannel" event-type="HorseEvent">
<wlevs:listener ref="sevenhorsesProcessor"/>
<wlevs:source ref="sevenhorsesAdapter"/>
</wlevs:channel>
<wlevs:channel id="horsesInputChannel2" event-type="HorseEvent">
<wlevs:listener ref="sevenhorsesProcessor"/>
<wlevs:source ref="sevenhorsesAdapter"/>
</wlevs:channel>
<!-- The default processor for OCEP 11.0.0.0 is CQL -->
<wlevs:processor id="sevenhorsesProcessor" />
<wlevs:channel id="horseOutputChannel" event-type="HorseEvent" advertise="true">
<wlevs:listener>
<bean class="com.bea.wlevs.example.sevenhorses.SevenHorsesBean"/>
</wlevs:listener>
<wlevs:source ref="sevenhorsesProcessor"/>
</wlevs:channel>
</beans>
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>sevenhorsesProcessor</name>
<rules>
<query id="horsesRule">
<![CDATA[ select message from horsesInputChannel2 where message like "(gunman)"
        ]]>
</query>
</rules>
</processor>
</n1:config>
Thanks! 
Nobody? 
Your event definitions look wrong to me. You can only use Java-based or map-based events, you cannot combine the two. How are your event types defined in java? 
If you define a java event type by specifying the java class, you cannot also specify properties. The properties will be found automatically from the class based on the getters and setters. Your getters and setters on the class are probably for message, which is why only message property works in the CQL statement.

Shared Event Types Bundle + local event repository = Error in table source

Hi,
I'm using a CEP bundle for propagating shared event types to other deployed Applications. In one application, I am declaring an event type locally in the EPN
i.e.
<wlevs:event-type-repository>
          <wlevs:event-type type-name="someLocalEvent">
               <wlevs:properties>
                    <wlevs:property name="someProp1" type="char" length="256" />
                    <wlevs:property name="someProp2" type="char" length="256" />
               </wlevs:properties>
          </wlevs:event-type>
<wlevs:event-type-repository>And declare it as event type for table:
<wlevs:table id="table1" table-name="TABLE1" event-type="someLocalEvent" data-source="xeDs" />Now I am receiving this error:
<Unknown event type [someLocalEvent] associated to external data source [table1]> But if I put it in the shared event repository, it works as expected. What if the event type is not meant to be shared? Is it impossible to add new event types locally and aggregate it with shared events? 
Hi,
Can you confirm both 'someLocalEvent' and 'table1' are defined in the same application?
It might be good idea as well to make sure the event-type is defined before the table.
Best regards, 
yup it's in the same application. weird though, I started from scratch and it started to work. Must have been an error in other EPN components that screwed the event repository initialization.
Thanks anyway.

Complex Event types

Is it possible to model a complex event type in CEP? Foe example event type Class A has properties X:string Y: Int and z : ClasssB.
When i use class A i get an error saying this tool support only String, INteger, Float and Double as properties. ClassB is not a valid property. Does it mean all elements of an event type should be at same level? 
Hi,
We do support complex types in the event-type.
Could you copy/paste the actual error and your application assembly/configuration?
Note that there is a limitation only on the CSV adapter for simple types, perhaps that's what you running into?
Thanks 
Hi,
You are right. I have been using csvgen as Provider.
<wlevs:adapter id="abcAdapter" provider="csvgen">
<wlevs:instance-property name="port" value="9011"/>
....
</wlevs:adapter>
the exception i get is
: [Adapter:2041010]Event type DeviceMessage has a property of type class com.vod
afone.cosa.cmid.SensorData. This tool only supports String, Integer, Long, Float
, and Double properties.
commonj.work.WorkException: java.lang.RuntimeException: [Adapter:2041010]Event t
ype DeviceMessage has a property of type class com.xyz.abc.cmid.SensorData
. This tool only supports String, Integer, Long, Float, and Double properties.
I think i should use http provider. Let me try that. I have another question ill create a new post for that. 
Hi, I think most of the file based data sourcing tools do not support complex event. You use a processor to build the complex event. 
Hi,
thanks for your inputs. I am facing with a problem here. Any help is much appreciated.
I created a simple test project to try out httppubsub adapter. I have described what i tried out...
I created two channels 'mychannel' and 'myoutputchannel' thru CEP visualizer.
Create a CEP project with two HTTP Adapters and both end and one channel in between.
HTTPSubAdapter --------[Channel]----------HTTPPubAdapter
|----------------Outbean
HTTPSubAdapter Listens to mychannel
HTTPPubAdapter publishes to myoutputchannel.
OutputBean which listen to channel
I deployed the CEP project to server and posted a message in mychannel thru CEP visualizer.
the output i see in the console is
OutputBean:onEvent() + eventType=TestMessage object=TestMessage time=0 test=null isTotalOrderGuarantee=false
basically it comes out as NULL. Am I missing somthing here?
Adapter config file is given below.
<?xml version="1.0" encoding="UTF-8"?>
<wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application">
     <http-pub-sub-adapter>
          <name>testAdapter</name>
          <server-url>http://localhost:9002/pubsub</server-url>
          <channel>/mychannel</channel>
          <event-type>TestMessage</event-type>
          <user>wlevs</user>
          <password>wlevs</password>
     </http-pub-sub-adapter>
     <http-pub-sub-adapter>
          <name>testOutputAdapter</name>
          <server-context-path>/pubsub</server-context-path>
          <channel>/myoutputchannel</channel>
          
     </http-pub-sub-adapter>
</wlevs:config>
EPN context file is given below.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="TestMessage">
     <wlevs:properties>
<wlevs:property name="test" type="java.lang.String"/>
</wlevs:properties>
</wlevs:event-type>
</wlevs:event-type-repository>
     <wlevs:adapter id="testAdapter" provider="httpsub">
          <wlevs:listener ref="channel" />
     </wlevs:adapter>
     <wlevs:channel id="channel" event-type="TestMessage"
          advertise="true" >
          <wlevs:listener ref="testOutputAdapter" />
          <wlevs:listener ref="bean" />
     </wlevs:channel>
     <wlevs:adapter id="testOutputAdapter" provider="httppub">
     
     </wlevs:adapter>
     <bean id="bean" class="com.testing.output.OutputBean" autowire="default">
     </bean>
</beans>
cheers. 
This may be because of the issue and workaround described in the this thread - Re: Http subscriber adapter related problem 
thanks Manju ill try that.

Change dynamic propertie with MBean

Hello,
I have implemented a MBean config instead of using properties file as It allows me to change the value during runtime, without restarting the server.
For that, i used the org.springframework.jmx.export.MBeanExporter and register this bean into my spring config file.
<bean id="ConfigJMX" class="xyz.mbean.ConfigImpl">
<property name="fileName" value="/tmp/toto.txt"/>
</bean>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<property name="beans">
<map>
<entry key="xyz:name=MyConfig" value-ref="ConfigJMX"/>
</map>
</property>
</bean>
I have added the following library In the MANIFEST under runtime classpath.
I have added the following JARs to satisfy classpath issue (I don't know if it is the right way of doing with CEP ?)
- lib/org.springframework.spring-context_2.5.6.jar
- lib/org.springframework.spring-core_2.5.6.jar
- lib/org.springframework.spring-aop_2.5.6.jar
Compilation is fine, but during the deployment, i have the following exception:
../..
Caused By: org.springframework.beans.FatalBeanException: Could not create service reference; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.IntroductionInfo is not visible from class loader
     at com.bea.wlevs.spring.support.ServiceInjectionBeanPostProcessor.postProcessPropertyValues(ServiceInjectionBeanPostProcessor.java:128)
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:998)
../..
Seems that cep engine refuse to 'register' thoses libraries.
Could you provide the right way of dealing with this issue ?
Or
Do we have a better mecanism to implement what i'm trying to do in CEP (loading and changing properties value during runtime without restarting the server)?
Regards,
chenda 
Hello,
I managed to made it works.
1/ Remove the jars in the lib folders
*lib/org.springframework.spring-context_2.5.6.jar
*lib/org.springframework.spring-core_2.5.6.jar
*lib/org.springframework.spring-aop_2.5.6.jar
Theses exist from CEP installation.
2/ Open META-INF, dependencies tabs, and add the complaining missing package during deployment
../..
org.springframework.jmx.export;version="2.5.6"
... (more)
../..
3/ Reference the EPN.xml, as following
     <wlevs:adapter id="FileReaderAdapter"
          class="com.oracle.fr.ocs.cep.filereaderconfigdyn.adapter.FileReaderAdapter">
          <wlevs:instance-property name="configMBean" ref="configJMX"/>
          <wlevs:listener ref="inputFileReaderChannel" />          
     </wlevs:adapter>
Then you are able to change dynamically through JConsole, the value define in your MBean and it works like a charm.
We can probably use "ConfigurationPropertyPlaceholderConfigurer" class to achive the same goal and this is probably a better integration with CEP mecanism (if properties are writable at runtime).
http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/overview.htm#CEGGDFEI
For the moment, i'm not able to made it work (yet) ;-)
Regards,
chenda 
Using "ConfigurationPropertyPlaceholderConfigurer" class is pretty easy
http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/overview.htm#CEGGDFEI
1/ Create a properties file in your CEP eclipse project : properties/app.properties
2/ Add to your EPN
     <bean id="configPropertyBean"
          class="com.bea.wlevs.spring.support.ConfigurationPropertyPlaceholderConfigurer">
          <property name="location" value="properties/app.properties"/>          
     </bean>
     <wlevs:adapter id="FileReaderAdapter"
          class="com.oracle.fr.ocs.cep.filereader.adapter.FileReaderAdapter">
          <wlevs:instance-property name="fileName" value="${cep.app.filename}"/>
          <wlevs:listener ref="inputFileReaderChannel" />
     </wlevs:adapter>
where properties/app.properties contains
cep.app.filename=/home/oracle/poesie.txt
The class ConfigurationPropertyPlaceholderConfigurer does all the job for you. Then you can reference this bean to acces the property.
However, this solution does not give me the possibility to dynamically change the values define in properties file via JConsole.
I was not able to see the properties in JConsole/MBean panel.
Regards,
chenda

passing xml through bpel

Dear All, I am dealing with a scenario where i have to interact with some web service which entertain XML argument input and return XML output only,---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------example:- my BPEL's inputs and outputs corresponding webservice inputs and outputs are like.                           BPEL input and outputs --->>>                                                                                                                                                                                                                                               request  ---username type "string"                                                                                                                                                                                                                             ---password type "string"  output from my BPEL-->>                                                                                                                                                                                                                                                        response    ---status type=" string"                                                                                                                                                                                                                                                                                          ---code  type ="string"            webservice input and outputs inputXML  outputXML----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------the reference side have only one input  i.e input XML.. and also after successful login it should give out the response in such a format so that my BPEL can interact with that so until and unless i did not found a solution to convert my input to the BPEL (input xsd) to XML i will not able to do so .                                                                                          I have tried the following --  Using the XPath function-- ora:parseEscapedXML() to take an XML string and convert it to DOM format for processing in BPEL but getting Xpath error. Please Please help me out if you have any solutions.Thanks and RegardsKabir
Hi Kabir, What's the error message and how the inputXml and outputXml look like? Are they xml passed as strings? Cheers,Vlad
Hey Vlad, Thanks for your response  really appreciated  ..!!!! the error message which i am getting is ..... something like    "xpath root error :xpath exception....." # My BPEL input and output  XSD's are :--------------------------------------------------------------<xs:element name="AuthRequest"><xs:complexType><xs:sequence><xs:element name="userName" type="xs:string" minOccurs="0"/><xs:element name="passWord" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:element><xs:element name="AuthResponse"><xs:complexType><xs:sequence><xs:element name="status" type="xs:string"/><xs:element name="Code" type="xs:string"/></xs:sequence></xs:complexType></xs:element># request and response XML of the webservice which i am trying to call:-------------------------------------------------------------------------------------------------------request xml :-<?xml version="1.0" encoding="UTF-8"?><AuthRequest xmlns="http://xxxxxxxxxx..............."><username>xxxx</username><password>xxxx</password></AuthRequest> response xml :- <?xml version="1.0" encoding="UTF-8"?><AuthResponse xmlns="http://www.xxxxxxxxxx................."><status>xxxx</status><code>xxxx</code></AuthResponse>  #SecondlyTo escape the above deadlock we place a wrapper layer between both the service ....my services are running on weblogic and the service which i am trying to call is on glassfish ,with this approach we are Successfully hitting the service but not getting any response but instead getting error----- "error getting response;java.net.SocketTimeoutException:Read timed out"  to escape this i altered my weblogic em config as follows:-------------------------------------------------------------------------------------1     CLUSTER     --> YES2     #EM     SyncMaxWaitTime     --> 900     (default-45)3     #EM     Recovery Config > RecurringScheduleConfig > subsequent Trigger Delay     --> 900  (default-300)4     #EM     Recovery Config > StartUpSchedualeConfig > subsequent Trigger Delay     --> 900    (default-300)5     #Console     deployment>soa infra>EJB > BPEL Activity Manager Bean > Transaction Timeout     --> 1500  (default-300)6     #Console     deployment>soa infra>EJB > BPEL Delivery Bean > Transaction Timeout     --> 1500    (default-300)7     #Console     DataSource > SOADataSource-rac0 > XA Transaction Timeout      --> 600   (default-0)8     #Console     DataSource > SOADataSource-rac0 > XA Retry Interval      --> 60     (default-60)9     #Console     Domain --> Configuration --> JTA JTA Timeout Seconds     --> 3600       (default-30) ... even after all no luck yet....    please guide me me with your solutions....  Thanks and RegardsKabir
Hi Kabir, I'm afraid to say this is not looking very good... I don't know the requirements, but for the look of it I'd say you should consider some redesign... By now, focus on only one problem at a time... Isolate the problem, back it into a corner, once you fix it then you move to the next... "the service which i am trying to call is on glassfish"What type of service is that? Is it a SOAP service? Does it have a WSDL? If yes post the wsdl... Have you tried to call the service from SoapUI? If not, you should...Cheers,Vlad

Categories

Resources