1
votes

What exactly is the operation scope in Property mediators in WSO2 esb?
Though I have read the standard documentation on this at https://docs.wso2.com/display/ESB490/Property+Mediator . But there is not much information on the operation scope. It just says
Operation: This scope is used to retrieve a property in the operation context level.

I am using this scope to access one property set inside an iterator mediator outside the iterator. It worked well. The code is

   <sequence key="Main">
        <iterate xmlns:ns="http://org.apache.synapse/xsd" expression="//source_record_details/source_record" sequential="true">
              <target sequence="Loop"></target>
           </iterate>
           <sequence key="OutsideLoop"></sequence>
</sequence>


In the sequence named Loop, I am setting property X with scope operation and I am able to access the value of X in the sequence OutsideLoop. But if I change the scope to default, I do not get the value of X.
Though this works for me, I am looking for some explanation on this. I hope that the operation scope is still local to the current execution of the proxy and is thread safe.

1

1 Answers

2
votes

According to the WSO2 Documentation, You can retrieve a property in the operation context level from the operation scope.

The properties within iterated/cloned message with the operation scope are preserved in the in sequence even if you have configured your API resources to be sent through the fault sequence when faults exist.

A given property with the operation scope only exists in a single request and can be accessed by a single resource. The properties in this scope are passed to the error handler when the FORCE_ERROR_ON_SOAP_FAULT property is set to true