WSO2CEP 3.0.0中的事件构建器XML映射

时间:2013-12-16 10:09:22

标签: wso2

可以说,名为inputStream的流定义了属性name:string,surname:string,address:string。对于此流,如果事件构建器的定义如下,

<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>

当我发送像''John','Lennon','Liverpool'这样的输入时,我希望inputStream是['John','Lennon','Liverpool'],但结果流是['列侬','约翰','利物浦']。原因是属性的值按照构建器定义中的映射顺序添加到流中。

因此,定义中的<to>标记变得毫无意义(xpathForSurname评估时的值未映射到surname,而是name)。这是一个错误还是故意这样做?

1 个答案:

答案 0 :(得分:1)

是的,这似乎是CEP 3.0.0中的一个错误,将在未来版本中修复。我创建了一个JIRA,其中包含您在CEP-640中提供的信息。

目前,解决方法是让输入流直接通过事件构建器直接进行,而无需重新排序属性并对执行计划级别的排序进行任何操作。希望这种解决方法对您有用。