如何访问在迭代器内部定义的迭代器外部的属性调解器? [英] How to access property mediator outside iterator which is defined inside iterator?

查看:16
本文介绍了如何访问在迭代器内部定义的迭代器外部的属性调解器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经树如下

<iterate xmlns:oag="http://www.openapplications.org/oagis/10" xmlns:fn="http://www.w3.org/2005/xpath-functions" continueParent="true" preservePayload="true" attachPath="//ProcessCredit/DataArea" expression="//ProcessCredit/DataArea/Credit sequential="true">
.....
 <property xmlns:ns="http://org.apache.synapse/xsd"
                        xmlns:oa="http://www.openapplications.org/oagis/10"
                        name="ChargeTransactionKey"
                        expression="concat(get-property('operation','ChargeTransactionKey'),//Extension/ValueText[@typeCode='Charge Transaction Key'],':')"
                        scope="operation"
                        type="STRING"
                        description="ChargeTransactionKey"/>
 ...........

</iterate >
<log level="full">
<property name="requestIdChargeTransactionKey"
                  expression="get-property('operation','ChargeTransactionKey')"/>
     </log>

但属性requestIdChargeTransactionKey"中的值为空,这意味着我无法捕获迭代器内部定义的属性.

but value in property "requestIdChargeTransactionKey" is null, it means I'm unable to capture the property which is defined inside iterator.

任何人都可以在语法方面提供帮助吗?

can anybody help on syntax?

推荐答案

iterate 中的中介作用于 MessageContext 的克隆.如果您继续父中介(将 continueParent 属性设置为 true),您将使用初始 MessageContext,因此您在 iterate 内设置的范围为默认"的所有属性都将丢失

The mediation inside iterate works with clones of MessageContext. If you continue parent mediation (set continueParent attribute to true), you work with the initial MessageContext and therefore all the properties you have set with scope 'default' inside iterate are lost

但是有一个名为操作"的范围用于在操作上下文级别检索属性,如果您在迭代中设置具有此范围的属性,则可以在父中介中获取它的值

But there is a scope named 'operation' used to retrieve a property in the operation context level and if you set a property with this scope inside iterate, you can get it's value in the parent mediation

内部迭代:

<property name="ChargeTransactionKey" value="xxx" scope="operation"/>

在家长调解中:

get-property('operation','ChargeTransactionKey')

这篇关于如何访问在迭代器内部定义的迭代器外部的属性调解器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆