iargin
iargin

Reputation: 818

Event builder XML mapping in WSO2CEP 3.0.0

Lets say, a stream named inputStream is defined with attributes name:string, surname:string, address:string. For this stream, if an event builder is defined like the following,

<property>
    <from xpath="xpathForSurname"/>
    <to default="NULL" name="surname" type="string"/>
</property>
<property>
    <from xpath="xpathForName"/>
    <to default="NULL" name="name" type="string"/>
</property>
<property>
    <from xpath="xpathForAddress"/>
    <to default="NULL" name="address" type="string"/>
</property>

When I send an input like ('John', 'Lennon', 'Liverpool') I expect inputStream to be ['John', 'Lennon', 'Liverpool'], but the result stream is ['Lennon', 'John', 'Liverpool']. The reason is that values of the attributes are added to stream following the mapping sequence in builder definition.

Therefore, <to> tags in definition becomes pointless (the value upon xpathForSurname evaluation is not mapped to surname but name). Is this a bug or is it done on purpose?

Upvotes: 0

Views: 72

Answers (1)

lasantha
lasantha

Reputation: 686

Yes, this seems to be a bug in CEP 3.0.0 and will be fixed in a future release. I have created a JIRA with the information you provided in CEP-640.

For now, the workaround would be to let the input stream come directly as it is via the event builder without reordering the attributes and doing any manipulations to the ordering at the level of execution plans. Hope this workaround will work for you.

Upvotes: 1

Related Questions