I am creating a simple Composite Application using WSO2 Integration Studio. What I am trying to do is use a switch mediator to route the incoming requests and get the response after that need to call 2 other endpoints and the JSON response coming through from those two endpoints (CarTyreEndpoint, CarEngineEndpoint) needs to aggregate and send to the client. So far everything works fine except this aggregator part. It is not working and even nothing is printing. Can anybody help me to solve this issue? Thanks in advance.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/cars" name="Cars"
xmlns="http://ws.apache.org/ns/synapse">
<resource methods="PUT" uri-template="/car">
<inSequence>
<property expression="$trp:Model" name="model" scope="default" type="STRING"/>
<switch source="get-property('model')">
<case regex="some|models|...">
<call>
<endpoint key="CarEndpoint"/>
</call>
</case>
<default>
<respond/>
</default>
</switch>
<property expression="json-eval($.CarEndpointResult.Car)" name="car" scope="default" type="STRING"/>
<header expression="get-property('car')" name="Car" scope="transport"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
<call>
<endpoint key="CarTyreEndpoint"/>
</call>
<call>
<endpoint key="CarEngineEndpoint"/>
</call>
<aggregate>
<completeCondition>
<messageCount max="-1" min="-1"/>
</completeCondition>
<onComplete aggregateElementType="root" expression="$body">
<log level="full">
<property expression="$body" name="Response Body"/>
</log>
<respond/>
</onComplete>
</aggregate>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>