Adapter with provider  csvgen and processor. - Complex Event Processing

Hello.
I have strange problem with CEP Adapter, when I use csvgen as a provider I can't use CQL queries.
Let's say my csv data file looks like that :
S1 , SSSSSSSSSSSSSS
S2 , SSSdSSSSSSSSSS
S3 , SSzzzSSSSSSSSSS
I decided to load data with load-generator utility and I found strange issue. / Please note that I don't have problem with bulding simple EPN network or launching sample codes ( Hello World , FX.. ) with other providers /.
     <wlevs:event-type-repository>
          <wlevs:event-type type-name="QueryType">
                <wlevs:class>com.bea.wlevs.loadballance.QueryType</wlevs:class>
          </wlevs:event-type>
     </wlevs:event-type-repository>
     
    <wlevs:adapter id="queryAdapter" provider="csvgen">
         <wlevs:instance-property name="port" value="9011" />
             <wlevs:instance-property name="eventTypeName" value="QueryType"/>
             <wlevs:instance-property name="eventPropertyNames" value="client,query"/>
             
             <wlevs:listener ref="queryInputChannel" />
                      
    </wlevs:adapter>
   
    <wlevs:channel id="queryInputChannel" event-type="QueryType" advertise="true">
         <wlevs:listener ref="filterQuery" />
    <!--  <wlevs:source ref="queryAdapter"/>-->     
    </wlevs:channel>
   
    <wlevs:processor id="filterQuery"></wlevs:processor>
When I use only two components ( Adapter -> Channel ) I can see tracked values from csv file on output console.
I don't think You need my comment to that :
SEVERE: register stream queryInputChannel(cTimeStamp bigint, client char(256), queryHashCode int>>, quer<<y char(256), latencyTimestamp bigint) is system timestamped
generic syntax error. The syntax expects  name, supports, incremental, computation, use, instance, STRING, T_UPPER_LETTER token
<2009-09-03 01:33:51 CEST> <Error> <CQLProcessor> <BEA-000000> <Failed to create proxy for channel [queryInputChannel] in the CQL processor [filterQuery].>
<2009-09-03 01:33:51 CEST> <Error> <CQLProcessor> <BEA-000000> <Failed to create channel [queryInputChannel] = generic syntax error. The syntax expects  name, supports, incremental, computation, use, instance, STRING, T_UPPER_LETTER token>
<2009-09-03 01:33:51 CEST> <Error> <Deployment> <BEA-2045016> <The application context "csv_read" could not be started. Could not initialize component "queryInputChannel": Failed to create channel [queryInputChannel] = generic syntax error. The syntax expects  name, supports, incremental, computation, use, instance, STRING, T_UPPER_LETTER token>
<2009-09-03 01:33:51 CEST> <Notice> <Server> <BEA-2046000> <Server STARTED> Thanks, 

Looks like you have a property named "query" on the event named "QueryType". The error indicates that "query" is being treated as a reserved word; although it fair to say the message should be more clear.
The reason you don't see this with just adapter->channel is that its the validation (and error) are triggered when wiring up the processor; i.e. when the EPN includes channel->processor.
Can you rename the property to something other than "query" and give it a try?
Thanks 

Thank You user753516 ;) it was reserved word ;)
Anyway I have one more question, connected with neural/natural networks.
Is there any possibilty to create in midleware natural network model, based on 11g data mining libraries? I want to use one of models based only on java, but if there is possibilty to use Naive Bayse or SVM from Oracle, I'll change it.
Thanks,
R.
Edited by: user2013287 on 2009-09-03 06:14 

Thanks for the question. Right now the declarative support for neural networks is not there - you can however model neural networks in Oracle DB and cache the compact representation in a local or distributed cache. Use java code in CEP either via user defined functions or in output bean to score against the model. Declarative support for NN, SVM etc, will surface in a future release. 

Thank You.
I belive that it's not good to use DW's resources in middleware. ;)
I guess You will see me here with new issues soon ;)
gn8.
R.
Edited by: user2013287 on 2009-09-03 13:35

Related

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.

OCEP JMS Adapter implement InboundMessageConverter issue

Hello,
I'm new to OCEP. I have a JMS adapter receiving Weblogic JMS message. JMS Message is a TextMessage, so the default MapMessage can't convert it. I need to write my own converter which implement InboundMessageConvert. Eclipse compiles just fine, but when deploying into a runtime OCEP environment, I get an error saying that my custom converter class does not implement InboundMessageConverter which I did. Did anyone encounter this issue and how to get around it?
I also tried the sample code provided in Developer Guide and it doesn't work. My code bellow is a sample to by pass the deployment issue..
package com.converter;
import com.bea.wlevs.adapters.jms.api.InboundMessageConverter;
import com.bea.wlevs.adapters.jms.api.MessageConverterException;
import javax.jms.JMSException;
import javax.jms.Message;
import java.util.List;
public class MyMessageConverter
implements InboundMessageConverter
{
public MyMessageConverter(){
super();
}
public List convert(Message message) throws MessageConverterException, JMSException
{
return null;
}
}
--- error message when deploy to runtime environment ---
<Mar 22, 2010 10:30:57 AM PDT> <Error> <Deployment> <BEA-2045010> <The application context "FilteringEvent" could not be started: org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is java.lang.IllegalArgumentException: converter-bean com.converter.MyMessageConverter does not implement InboundMessageConverter
org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is java.lang.IllegalArgumentException: converter-bean com.converter.MyMessageConverter does not implement InboundMessageConverter
at com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)
at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)
at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:196)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) 
Hello, I found the solution to my problem. Thanks. 
May I know how did you overcome this error? I am unable to use converterBean with both JMS and HTTP?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HttpSubAdapter': Invocation of init method failed; nested exception is org.springframework.beans.FatalBeanException: Unable to set instance-property reference for bean HttpSubAdapter, property converterBean, exception was org.springframework.beans.TypeMismatchException: Failed to convert property value of type [converter.HttpSubConverter] to required type [com.bea.wlevs.adapters.httppubsub.api.InboundMessageConverter] for property 'converterBean'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [converter.HttpSubConverter] to required type [com.bea.wlevs.adapters.httppubsub.api.InboundMessageConverter] for property 'converterBean': no matching editors or conversion strategy found
Any idea?
Edited by: user8906186 on Dec 8, 2011 1:34 AM 
Hi friend,
Could you tell us where was the problem and how did yo solve it?
I have a similar problem.
Thank you! 
Please check your Manifest file. Ensure whether it has required jms library files of OCEP included under import package.
For eaxample : com.bea.wlevs.adapters.jms.api 
Hi,
I have included the following two lines into the Manifest file, but this action has not fixed the problem:
com.bea.wlevs.adapters.jms;version="11.1.1.4_0",
com.bea.wlevs.adapters.jms.api;version="11.1.1.4_0"
My EPN file is as shown:
<?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.jmsclient.JMSClient"/>
     <wlevs:adapter id="jmsInbound" provider="jms-inbound">
          <wlevs:instance-property name="converterBean" ref="myConverter"/>
     </wlevs:adapter>
     <application:jms-adapter>
<application:name>jmsInbound</application:name>
<application:jndi-provider-url>t3://localhost:9002</application:jndi-provider-url>
<application:destination-jndi-name>Queue1</application:destination-jndi-name>
<application:user>wlevs</application:user>
<application:password>123456</application:password>
<application:work-manager>JettyWorkManager</application:work-manager>
<application:concurrent-consumers>1</application:concurrent-consumers>
<application:session-transacted>false</application:session-transacted>
</application:jms-adapter>
<wlevs:event-type-repository>
...
The error showned by Eclipse is:
Multiple annotations found at this line:
     - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'application:jms-adapter'.
     - schema_reference.4: Failed to read schema document 'http://www.bea.com/ns/wlevs/config/application/
     wlevs_application_config.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the
     document is not <xsd:schema>.
Thanks!
Edited by: 899693 on 15-dic-2011 2:48 
The application config lives in a different file in a different location. You cannot combine it with the EPN definition. Please see some of the examples as to where it should live.
andy 
Thank you, but read:
The following sample EPN assembly file shows how to configure an inbound JMS adapter. The network is simple: the inbound JMS adapter called jmsInbound receives messages from the JMS queue configured in its component configuration file. The Spring bean myConverter converts the incoming JMS messages into event types, and then these events flow to the mySink event bean.
<?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_0_0_0.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="JMSEvent">
<wlevs:class>com.customer.JMSEvent</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>
<!-- Event bean that is an event sink -->
<wlevs:event-bean id="mySink"
class="com.customer.MySink"/>
<!-- Inbound JMS adapter with custom converter class; adapter sends events to mySink event bean-->
<bean id="myConverter" class="com.customer.MessageConverter"/>
<wlevs:adapter id="jmsInbound" provider="jms-inbound">
<wlevs:instance-property name="converterBean" ref="myConverter"/>
<wlevs:listener ref="mySink"/>
</wlevs:adapter>
</beans>
http://docs.oracle.com/cd/E15523_01/doc.1111/e14301/jms.htm
It is not clear in the official documentation what you say.
Regards. 
http://docs.oracle.com/cd/E17904_01/doc.1111/e14301/overview.htm#i1021649 
Thank you but it is too much cumbersome, I cannot see anything there talking about JMS configuration files. It does not specify what specific name you must give to the JMS configuration files nor where you have to put them.
Regards. 
You need to read up on component configuration and then the JMS docs will make more sense to you. You are not interpreting the JMS docs correctly because you do not understand the fundamentals of CEP configuration. The link I posted will help you understand. 
I have already read both docs. Think I have just started with this technology and everything is new for me.
I just think the documentation should be more complete and more disciplined than it is.
Thanks. 
It is said in the overview page:
"*You create a single file that contains configuration for all components in your application*, _or you can create separate files for each component; the choice depends on which is easier for you to manage._ "
http://docs.oracle.com/cd/E13213_01/wlevs/docs30/create_apps/overview.html#wp1021625
However, in JMS tutorial, it is said the following:
"*You configure the JMS adapters in their respective configuration files*, similar to how you configure other components in the event processing network, such as processors or streams. For general information about these configuration files, see Component Configuration Files. "
http://docs.oracle.com/cd/E13213_01/wlevs/docs30/create_apps/jms.html
Is it possible to configure JMS adapter in the EPN file or not? In the case it is not possible, what is the name of the file in which I must include <jms-adapter> tree and what folder?
Thanks! 
Some elements of the JMS adapter can be configured in the EPN, but you configure those elements using instance-property. It's probably easier to just put all the config in the component configuration file. The easiest way to do this is create a file META-INF/wlevs/config.xml in your application. You can then put all the component configuration in there. If you wish to have separate component configuration files then they must be named according to the names used in the EPN. This is all covered in the docs.
andy 
So if I understand you, jms-adapter tree can be set in the same file than processors and CQL queries?
Thanks.

Accessing a Cache From an Oracle CQL User-Defined Function

According to the docs ...
I am to use the following element to set the cache property in my bean...
<wlevs:property name="cache" ref="cache-id"/>
However, when I set it, the assembly does not validate.
If I use <property>, I get a NullPointerException on each request when my processor runs.
Using the same CQL code..
Without the <property> tag, the call to the user-defined function works (but I don't have the cache attribute set obviously).
Here is the excerpt from my assembly...
<bean id="cacheFunction" class="ou.cep.function.CacheFunction">
<property name="cache" ref="myCache"/>
</bean>
<!-- The default processor for OCEP 11.0.0.0 is CQL -->
<wlevs:processor id="myProcessor">
<wlevs:listener ref="CacheChannel"/>
<wlevs:function ref="cacheFunction" function-name="isValidID" exec-method="isValidID">
</wlevs:function>
</wlevs:processor>
To repeat, with the same CQL with the user-defined function call, if I remove the property element from the bean definition, I can call the function successfully (it just doesn't do what I need it to do). In this case, I am still using the ref=cacheFunction for the wlevs:function within the processor.
What am I doing wrong?
Edited by: fl0at on Oct 5, 2010 12:22 PM
Edited by: fl0at on Oct 5, 2010 12:28 PM 
The case is solved, not sure I could explain why, but...
This implementation of the user-defined function was a migration from an implementation using the same cache in the join. So, when I removed the cache reference in the source stream (where I am now executing a function that accesses the cache), the problem went away and everything is working.
I can explain further if there are questions.
If anyone has thoughts on this, please advise.
As always, thanks for the help.

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.

Can inherited events be used with only one processor?

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

Categories

Resources