Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
- http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
- http://www.mulesoft.org/schema/mule/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
- http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd
- http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
- <http:listener-config name="test-order-system-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
- <apikit:config name="test-order-system-config" raml="test-order-system.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/>
- <sfdc:config name="Salesforce" username="${sf.username}" password="${sf.password}" securityToken="${sf.token}" doc:name="Salesforce">
- <sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
- </sfdc:config>
- <data-mapper:config name="Map_To_JSON" transformationGraphPath="map_to_json.grf" doc:name="Map_To_JSON"/>
- <flow name="test-order-system-main">
- <http:listener config-ref="test-order-system-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
- <apikit:router config-ref="test-order-system-config" doc:name="APIkit Router"/>
- <exception-strategy ref="test-order-system-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
- </flow>
- <flow name="delete:/orders/order:test-order-system-config">
- <set-payload value="{
 "createOrderRequest": {
 "success": true
 }
}" doc:name="Set Payload"/>
- </flow>
- <flow name="get:/orders:test-order-system-config">
- <sfdc:query config-ref="Salesforce" query="SELECT EffectiveDate,Id,TotalAmount FROM Order" doc:name="Salesforce"/>
- <logger message="#[org.apache.commons.collections.IteratorUtils.toList(payload)]" level="INFO" doc:name="Logger"/>
- <data-mapper:transform config-ref="Map_To_JSON" doc:name="Map To JSON"/>
- <byte-array-to-string-transformer mimeType="application/json" doc:name="Byte Array to String"/>
- </flow>
- <flow name="post:/orders/order:test-order-system-config">
- <set-payload value="{
 "createOrderResponse": {
 "orderId": "8a493ecd-e842-4ca2-b33b-a03aa9136673",
 "success": true
 }
}" doc:name="Set Payload"/>
- </flow>
- <apikit:mapping-exception-strategy name="test-order-system-apiKitGlobalExceptionMapping">
- <apikit:mapping statusCode="404">
- <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Resource not found" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="405">
- <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Method not allowed" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="415">
- <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Unsupported media type" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="406">
- <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Not acceptable" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="400">
- <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Bad request" }" doc:name="Set Payload"/>
- </apikit:mapping>
- </apikit:mapping-exception-strategy>
- </mule>
- <?xml version="1.0" encoding="UTF-8"?><Graph __version="3.5.0" author="paul.smith" created="Tue Dec 13 11:57:04 GMT 2016" description="Map To JSON" guiVersion="3.4.4.P" id="1481630718872" licenseCode="Unlicensed" licenseType="Unknown" modified="Tue Dec 13 11:57:04 GMT 2016" modifiedBy="paul.smith" name="Map_To_JSON" revision="1.0" showComponentDetails="false">
- <Global>
- <Metadata __index="0" __referenceCounter="1" __sourcePath="{}/object/getOrdersResponse" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="e7c43187-f349-4c36-b674-3dbec6e275ef" _parent_id="__parent_id" _type="Output" id="42e8bd0c-d375-4868-bf20-d798c97eddb0">
- <Record fieldDelimiter="," name="getOrdersResponse" recordDelimiter="n\|rn\|r" type="delimited">
- <Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
- <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
- <Field __index="0" __sourcePath="{}/object/getOrdersResponse/orderNumber" containerType="SINGLE" label="orderNumber" name="orderNumber" type="string"/>
- <Field __index="1" __sourcePath="{}/object/getOrdersResponse/orderDate" containerType="SINGLE" label="orderDate" name="orderDate" type="string"/>
- <Field __index="2" __sourcePath="{}/object/getOrdersResponse/clientOrderNumber" containerType="SINGLE" label="clientOrderNumber" name="clientOrderNumber" type="string"/>
- <Field __index="3" __sourcePath="{}/object/getOrdersResponse/customer/customerId" containerType="SINGLE" label="customerId" name="customerId" type="string"/>
- <Field __index="4" __sourcePath="{}/object/getOrdersResponse/customer/customerName" containerType="SINGLE" label="customerName" name="customerName" type="string"/>
- <Field __index="5" __sourcePath="{}/object/getOrdersResponse/customer/address/addressLine1" containerType="SINGLE" label="addressLine1" name="addressLine1" type="string"/>
- <Field __index="6" __sourcePath="{}/object/getOrdersResponse/customer/address/addressLine2" containerType="SINGLE" label="addressLine2" name="addressLine2" type="string"/>
- <Field __index="7" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCity" containerType="SINGLE" label="addressCity" name="addressCity" type="string"/>
- <Field __index="8" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCounty" containerType="SINGLE" label="addressCounty" name="addressCounty" type="string"/>
- <Field __index="9" __sourcePath="{}/object/getOrdersResponse/customer/address/addressPostcode" containerType="SINGLE" label="addressPostcode" name="addressPostcode" type="string"/>
- <Field __index="10" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCountry" containerType="SINGLE" label="addressCountry" name="addressCountry" type="string"/>
- <Field __index="11" __sourcePath="{}/object/getOrdersResponse/customer/email" containerType="SINGLE" label="email" name="email" type="string"/>
- <Field __index="12" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/bank" containerType="SINGLE" label="bank" name="bank" type="string"/>
- <Field __index="13" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/cardNumber" containerType="SINGLE" label="cardNumber" name="cardNumber" type="integer"/>
- <Field __index="14" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/sortCode" containerType="SINGLE" label="sortCode" name="sortCode" type="string"/>
- <Field __index="15" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/cvv" containerType="SINGLE" label="cvv" name="cvv" type="integer"/>
- <Field __index="16" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressLine1" containerType="SINGLE" label="addressLine1" name="addressLine1_1" type="string"/>
- <Field __index="17" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressLine2" containerType="SINGLE" label="addressLine2" name="addressLine2_1" type="string"/>
- <Field __index="18" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressCity" containerType="SINGLE" label="addressCity" name="addressCity_1" type="string"/>
- <Field __index="19" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressPostcode" containerType="SINGLE" label="addressPostcode" name="addressPostcode_1" type="string"/>
- <Field __index="24" __sourcePath="{}/object/getOrdersResponse/pricebookId" containerType="SINGLE" label="pricebookId" name="pricebookId" type="string"/>
- <Field __index="25" __sourcePath="{}/object/getOrdersResponse/orderTotal" containerType="SINGLE" label="orderTotal" name="orderTotal" type="number"/>
- </Record>
- </Metadata>
- <Metadata __index="0" __referenceCounter="1" __sourcePath="{}/mapMetadata" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _type="Input" id="48a9ee52-ae9a-469b-bea2-ce5589e955b3">
- <Record fieldDelimiter="," name="mapMetadata" recordDelimiter="n\|rn\|r" type="delimited">
- <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
- <Field __index="0" __sourcePath="{}/mapMetadata/EffectiveDate" containerType="SINGLE" label="EffectiveDate" name="EffectiveDate" type="date"/>
- <Field __index="1" __sourcePath="{}/mapMetadata/Id" containerType="SINGLE" label="Id" name="Id" type="string"/>
- <Field __index="2" __sourcePath="{}/mapMetadata/TotalAmount" containerType="SINGLE" label="TotalAmount" name="TotalAmount" type="string"/>
- </Record>
- </Metadata>
- <Metadata __index="0" __referenceCounter="0" __sourcePath="{}/object" _dataStructure="OBJECT" _id="__id" _type="Output" id="e7c43187-f349-4c36-b674-3dbec6e275ef">
- <Record fieldDelimiter="," name="object" recordDelimiter="n\|rn\|r" type="delimited">
- <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
- </Record>
- </Metadata>
- <Metadata __index="20" __referenceCounter="0" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _metadataParentId="42e8bd0c-d375-4868-bf20-d798c97eddb0" _parent_id="__parent_id" _type="Output" id="5fa8ef1f-d1bc-4e70-b558-753789a5324a">
- <Record fieldDelimiter="," name="orderLine" recordDelimiter="n\|rn\|r" type="delimited">
- <Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
- <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
- <Field __index="20" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/productId" containerType="SINGLE" label="productId" name="productId" type="string"/>
- <Field __index="21" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/productName" containerType="SINGLE" label="productName" name="productName" type="string"/>
- <Field __index="22" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/quantity" containerType="SINGLE" label="quantity" name="quantity" type="string"/>
- <Field __index="23" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/unitPrice" containerType="SINGLE" label="unitPrice" name="unitPrice" type="number"/>
- </Record>
- </Metadata>
- <Dictionary>
- <Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
- <Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
- </Dictionary>
- </Global>
- <Phase number="0">
- <Node enabled="enabled" fileURL="dict:inputPayload" guiName="Map<k,v> READER" guiX="20" guiY="20" id="BEAN_READER0" type="BEAN_READER">
- <attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <Context outPort="0" sequenceField="__id" xpath=".">
- <Mapping cloverField="EffectiveDate" trim="true" xpath="EffectiveDate"/>
- <Mapping cloverField="Id" trim="true" xpath="Id"/>
- <Mapping cloverField="TotalAmount" trim="true" xpath="TotalAmount"/>
- </Context>
- ]]></attr>
- <attr name="_data_format"><![CDATA[MAP]]></attr>
- </Node>
- <Node enabled="enabled" guiName="Foreach 'mapMetadata' -> 'getOrdersResponse'" guiX="460" guiY="20" id="FOREACH_MAP_METADATA_GET_ORDERS_RESPONSE" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
- <attr name="melScript"><![CDATA[//MEL
- //START -> DO NOT REMOVE
- output.__id = input.__id;
- output.__parent_id = input.__id;
- //END -> DO NOT REMOVE
- output.orderDate = date2str(input.EffectiveDate,"yyyy-mm-dd");
- output.orderNumber = input.Id;
- output.orderTotal = str2double(input.TotalAmount);]]></attr>
- </Node>
- <Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="JSON WRITER" guiX="900" guiY="20" id="JSON_WRITER0" type="JSON_WRITER">
- <attr name="__isJsonSchema"><![CDATA[false]]></attr>
- <attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
- <object xmlns:clover="http://www.cloveretl.com/ns/xmlmapping">
- <clover:collection clover:name="getOrdersResponse">
- <item clover:inPort="0">
- <orderNumber>$0.orderNumber</orderNumber>
- <orderDate>$0.orderDate</orderDate>
- <clientOrderNumber>$0.clientOrderNumber</clientOrderNumber>
- <customer>
- <customerId>$0.customerId</customerId>
- <customerName>$0.customerName</customerName>
- <address>
- <addressLine1>$0.addressLine1</addressLine1>
- <addressLine2>$0.addressLine2</addressLine2>
- <addressCity>$0.addressCity</addressCity>
- <addressCounty>$0.addressCounty</addressCounty>
- <addressPostcode>$0.addressPostcode</addressPostcode>
- <addressCountry>$0.addressCountry</addressCountry>
- </address>
- <email>$0.email</email>
- <paymentDetails>
- <bank>$0.bank</bank>
- <cardNumber>$0.cardNumber</cardNumber>
- <sortCode>$0.sortCode</sortCode>
- <cvv>$0.cvv</cvv>
- <billingAddress>
- <addressLine1>$0.addressLine1_1</addressLine1>
- <addressLine2>$0.addressLine2_1</addressLine2>
- <addressCity>$0.addressCity_1</addressCity>
- <addressPostcode>$0.addressPostcode_1</addressPostcode>
- </billingAddress>
- </paymentDetails>
- </customer>
- <pricebookId>$0.pricebookId</pricebookId>
- <orderTotal>$0.orderTotal</orderTotal>
- </item>
- </clover:collection>
- </object>]]></attr>
- <attr name="_data_format"><![CDATA[JSON]]></attr>
- <attr name="jsonSchemaURL"><![CDATA[C:/data/git/test-cloud/test-system/test-order-system/mappings/test-order-system-orders/getordersresponse.json]]></attr>
- </Node>
- <Edge debugMode="true" fromNode="BEAN_READER0:0" guiBendpoints="" id="Edge0" inPort="Port 0 (in)" metadata="48a9ee52-ae9a-469b-bea2-ce5589e955b3" outPort="Port 0 (out)" toNode="FOREACH_MAP_METADATA_GET_ORDERS_RESPONSE:0"/>
- <Edge debugMode="true" fromNode="FOREACH_MAP_METADATA_GET_ORDERS_RESPONSE:0" guiBendpoints="" id="Edge1" inPort="Port 0 (in)" metadata="42e8bd0c-d375-4868-bf20-d798c97eddb0" outPort="Port 0 (out)" toNode="JSON_WRITER0:0"/>
- </Phase>
- </Graph>
- *******************************************************************************************************
- * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
- *******************************************************************************************************
- * test * default * DEPLOYED *
- *******************************************************************************************************
- WARN 2016-12-13 12:16:55,221 [[test].test-order-system-httpListenerConfig.worker.01] org.mule.modules.salesforce.config.AbstractConfig: API version 37.0 is lower than the recommended 38.0 version
- INFO 2016-12-13 12:16:59,946 [[test].test-order-system-httpListenerConfig.worker.01] org.mule.api.processor.LoggerMessageProcessor: [{Id=80124000006A6duAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6rUAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A7O7AAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A647AAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5rcAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xqAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zpAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zuAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A7NKAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6tuAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6wMAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5uqAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xLAAS, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5wcAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xuAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dLAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6cWAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6UYAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dzAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6biAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5rmAAC, TotalAmount=74.99, type=Order, EffectiveDate=2016-12-12}, {Id=80124000006A6TFAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A65AAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6TyAAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dVAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A4OMAA0, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6SlAAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zzAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}]
- {
- "getOrdersResponse": []
- }
Add Comment
Please, Sign In to add comment