Forum Stats

  • 3,855,354 Users
  • 2,264,499 Discussions
  • 7,905,977 Comments

Discussions

Complex Data Type: Java Data Cartridge

900697
900697 Member Posts: 50
edited Mar 13, 2012 11:40AM in Complex Event Processing
Hi,

I have defined a class test.Address (under src folder) and the event type as below:
<wlevs:event-type-repository>
<wlevs:event-type type-name="Student">
<wlevs:properties>
<wlevs:property name="name" type="char"/>
<wlevs:property name="address" type="Address"/>
</wlevs:properties>
</wlevs:event-type>
<wlevs:event-type type-name="Address">
<wlevs:class>test.Address</wlevs:class>
</wlevs:event-type>
</wlevs:event-type-repository>

But the line "<wlevs:property name="address" type="Address"/>" is giving below error:
The type "Address" is unknown. Property types in tuple property sets must be one of the native tuple types, a primitive type, a fully qualified class name, or an array type.

And query in processor also throws error.
Query:
<processor>
<name>CDSProcessor</name>
<rules>
<query id="ExampleQuery">
<![CDATA[
select name,address.street from channel [now]
]]>
</query>
</rules>
</processor>

Error: Invalid statement: "select name,>>address.street<< from channel [now]"
Description: Invalid symbolic expression: address.street
Cause: Probable causes are: There is no symbol named address, or Error while handling member
access to complex type. Field street of type test.Address not found., or Types address.street and
address not found when referencing constructor or static method..
Action: Verify symbols reference to valid variable name, attribute name, function name, complex type
name, method name, or field name.


Please help on how to use Java Data Cartridge or complex data struture in CEP.


Thanks,
Sri

Edited by: 897694 on Mar 12, 2012 3:29 AM

Edited by: 897694 on Mar 12, 2012 3:34 AM
Tagged:

Answers

  • 714235
    714235 Member Posts: 25
    Assuming your Address class's fully classified name is test.Address you need have following entry
    <wlevs:event-type type-name="Student">
    <wlevs:properties>
    <wlevs:property name="name" type="char"/>
    <wlevs:property name="address" type="test.Address"/>
    </wlevs:properties>
    </wlevs:event-type>

    also, you need to try this on PS5.
  • 900697
    900697 Member Posts: 50
    Thanks,

    But how to fetch class variables in CQL.

    Example test.Address has street, name and phone no.

    How to access street in CQL ?


    Regards,
    Sri
  • 714235
    714235 Member Posts: 25
    If you are using PS5 then you should be able to access address.street.

    Thanks,
  • 900697
    900697 Member Posts: 50
    Sorry. What is PS5? Can you please provide more information on PS5.


    Thanks,
    Sri
  • 714235
    714235 Member Posts: 25
    Sorry, about that. The feature you are trying to use is available in CEP 11gR1 PS5 release. Please try by the accessor method of street in CQL as

    <![CDATA[
    select name,address.getStreet() from channel [now]
    ]]>
    </query

    Thanks,
    Paddy
  • 900697
    900697 Member Posts: 50
    Hi Paddy,

    Thank you so much.

    I am able to use getter methods to compare values in WHERE clause of CQL.

    It still gives error in data list.
    Query:
    select name,address.getStreet() from channel
    where address.getStreet() = "AAA"
    Error:
    Event property [getStreet] defined in query [ExampleQuery] must exist in event type [Student].
    Consider using the expression 'getStreet AS ...' in the query.


    I am not able to find download of PS5 of CEP.
    Please provide me details of how and where i can download.


    Thanks,
    Sri
  • 665356
    665356 Member Posts: 271
    PS5 is OCEP 11.1.1.6
  • 900697
    900697 Member Posts: 50
    Thank you.

    I have installed 11.1.1.6 and its working fine.

    I have one more question.

    If i am using event type as below:
    <wlevs:event-type type-name="WellEventType">
    <wlevs:properties>
    <wlevs:property name="wellUid" type="char"/>
    <wlevs:property name="wellboreUid" type="char"/>
    <wlevs:property name="logUid" type="char"/>
    <wlevs:property name="Mdepth" type="com.bea.wlevs.WellEvent"/>
    <wlevs:property name="Vdepth" type="com.bea.wlevs.WellEvent"/>
    <wlevs:property name="Bit_Dist" type="com.bea.wlevs.WellEvent"/>
    </wlevs:properties>
    </wlevs:event-type>


    "com.bea.wlevs.WellEvent" has properties like xcordinate, ycordinate etc...


    and I am using JMS inbound adapter and converter for event type creation.

    Please provide info on How to set properties of Mdepth, Vdepth (xcordinate, ycordinate) in converter java class?


    Thanks,
    Sri
  • 714235
    714235 Member Posts: 25
    did you take a look at OCEP documentation?

    http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/jms.htm#i1021113

    Thanks,
  • 900697
    900697 Member Posts: 50
    Hi,

    Answer to my question, I have created a object of "WellEvent" in JMS inbound converter and set with required properties and then i used method "eventType.getProperty("Mdepth").setValue(event, WellEventObject);" to add property of Java Cartridge type to event type.

    Thanks Padmanabh.

    Regards,
    Sri
This discussion has been closed.