SHARE
TWEET

Untitled

a guest Dec 13th, 2016 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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
  3. http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
  4. http://www.mulesoft.org/schema/mule/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
  5. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  6. http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd
  7. http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
  8.     <http:listener-config name="test-order-system-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
  9.     <apikit:config name="test-order-system-config" raml="test-order-system.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/>
  10.     <sfdc:config name="Salesforce" username="${sf.username}" password="${sf.password}" securityToken="${sf.token}" doc:name="Salesforce">
  11.         <sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
  12.     </sfdc:config>
  13.     <data-mapper:config name="Map_To_JSON" transformationGraphPath="map_to_json.grf" doc:name="Map_To_JSON"/>
  14.  
  15.     <flow name="test-order-system-main">
  16.         <http:listener config-ref="test-order-system-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
  17.         <apikit:router config-ref="test-order-system-config" doc:name="APIkit Router"/>
  18.         <exception-strategy ref="test-order-system-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
  19.     </flow>
  20.     <flow name="delete:/orders/order:test-order-system-config">
  21.         <set-payload value="{&#xA;  "createOrderRequest": {&#xA;    "success": true&#xA;  }&#xA;}" doc:name="Set Payload"/>
  22.     </flow>
  23.     <flow name="get:/orders:test-order-system-config">
  24.         <sfdc:query config-ref="Salesforce" query="SELECT EffectiveDate,Id,TotalAmount FROM Order" doc:name="Salesforce"/>
  25.         <logger message="#[org.apache.commons.collections.IteratorUtils.toList(payload)]" level="INFO" doc:name="Logger"/>
  26.         <data-mapper:transform config-ref="Map_To_JSON" doc:name="Map To JSON"/>
  27.         <byte-array-to-string-transformer mimeType="application/json" doc:name="Byte Array to String"/>
  28.  
  29.     </flow>
  30.     <flow name="post:/orders/order:test-order-system-config">
  31.         <set-payload value="{&#xA;  "createOrderResponse": {&#xA;    "orderId": "8a493ecd-e842-4ca2-b33b-a03aa9136673",&#xA;    "success": true&#xA;  }&#xA;}" doc:name="Set Payload"/>
  32.     </flow>
  33.     <apikit:mapping-exception-strategy name="test-order-system-apiKitGlobalExceptionMapping">
  34.         <apikit:mapping statusCode="404">
  35.             <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
  36.             <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  37.             <set-payload value="{ "message": "Resource not found" }" doc:name="Set Payload"/>
  38.         </apikit:mapping>
  39.         <apikit:mapping statusCode="405">
  40.             <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
  41.             <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  42.             <set-payload value="{ "message": "Method not allowed" }" doc:name="Set Payload"/>
  43.         </apikit:mapping>
  44.         <apikit:mapping statusCode="415">
  45.             <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
  46.             <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  47.             <set-payload value="{ "message": "Unsupported media type" }" doc:name="Set Payload"/>
  48.         </apikit:mapping>
  49.         <apikit:mapping statusCode="406">
  50.             <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
  51.             <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  52.             <set-payload value="{ "message": "Not acceptable" }" doc:name="Set Payload"/>
  53.         </apikit:mapping>
  54.         <apikit:mapping statusCode="400">
  55.             <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
  56.             <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  57.             <set-payload value="{ "message": "Bad request" }" doc:name="Set Payload"/>
  58.         </apikit:mapping>
  59.     </apikit:mapping-exception-strategy>
  60. </mule>
  61.    
  62. <?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">
  63. <Global>
  64. <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">
  65. <Record fieldDelimiter="," name="getOrdersResponse" recordDelimiter="n\|rn\|r" type="delimited">
  66. <Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
  67. <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
  68. <Field __index="0" __sourcePath="{}/object/getOrdersResponse/orderNumber" containerType="SINGLE" label="orderNumber" name="orderNumber" type="string"/>
  69. <Field __index="1" __sourcePath="{}/object/getOrdersResponse/orderDate" containerType="SINGLE" label="orderDate" name="orderDate" type="string"/>
  70. <Field __index="2" __sourcePath="{}/object/getOrdersResponse/clientOrderNumber" containerType="SINGLE" label="clientOrderNumber" name="clientOrderNumber" type="string"/>
  71. <Field __index="3" __sourcePath="{}/object/getOrdersResponse/customer/customerId" containerType="SINGLE" label="customerId" name="customerId" type="string"/>
  72. <Field __index="4" __sourcePath="{}/object/getOrdersResponse/customer/customerName" containerType="SINGLE" label="customerName" name="customerName" type="string"/>
  73. <Field __index="5" __sourcePath="{}/object/getOrdersResponse/customer/address/addressLine1" containerType="SINGLE" label="addressLine1" name="addressLine1" type="string"/>
  74. <Field __index="6" __sourcePath="{}/object/getOrdersResponse/customer/address/addressLine2" containerType="SINGLE" label="addressLine2" name="addressLine2" type="string"/>
  75. <Field __index="7" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCity" containerType="SINGLE" label="addressCity" name="addressCity" type="string"/>
  76. <Field __index="8" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCounty" containerType="SINGLE" label="addressCounty" name="addressCounty" type="string"/>
  77. <Field __index="9" __sourcePath="{}/object/getOrdersResponse/customer/address/addressPostcode" containerType="SINGLE" label="addressPostcode" name="addressPostcode" type="string"/>
  78. <Field __index="10" __sourcePath="{}/object/getOrdersResponse/customer/address/addressCountry" containerType="SINGLE" label="addressCountry" name="addressCountry" type="string"/>
  79. <Field __index="11" __sourcePath="{}/object/getOrdersResponse/customer/email" containerType="SINGLE" label="email" name="email" type="string"/>
  80. <Field __index="12" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/bank" containerType="SINGLE" label="bank" name="bank" type="string"/>
  81. <Field __index="13" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/cardNumber" containerType="SINGLE" label="cardNumber" name="cardNumber" type="integer"/>
  82. <Field __index="14" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/sortCode" containerType="SINGLE" label="sortCode" name="sortCode" type="string"/>
  83. <Field __index="15" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/cvv" containerType="SINGLE" label="cvv" name="cvv" type="integer"/>
  84. <Field __index="16" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressLine1" containerType="SINGLE" label="addressLine1" name="addressLine1_1" type="string"/>
  85. <Field __index="17" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressLine2" containerType="SINGLE" label="addressLine2" name="addressLine2_1" type="string"/>
  86. <Field __index="18" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressCity" containerType="SINGLE" label="addressCity" name="addressCity_1" type="string"/>
  87. <Field __index="19" __sourcePath="{}/object/getOrdersResponse/customer/paymentDetails/billingAddress/addressPostcode" containerType="SINGLE" label="addressPostcode" name="addressPostcode_1" type="string"/>
  88. <Field __index="24" __sourcePath="{}/object/getOrdersResponse/pricebookId" containerType="SINGLE" label="pricebookId" name="pricebookId" type="string"/>
  89. <Field __index="25" __sourcePath="{}/object/getOrdersResponse/orderTotal" containerType="SINGLE" label="orderTotal" name="orderTotal" type="number"/>
  90. </Record>
  91. </Metadata>
  92. <Metadata __index="0" __referenceCounter="1" __sourcePath="{}/mapMetadata" _dataStructure="SINGLE_DIMENSIONAL_COLLECTION" _id="__id" _type="Input" id="48a9ee52-ae9a-469b-bea2-ce5589e955b3">
  93. <Record fieldDelimiter="," name="mapMetadata" recordDelimiter="n\|rn\|r" type="delimited">
  94. <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
  95. <Field __index="0" __sourcePath="{}/mapMetadata/EffectiveDate" containerType="SINGLE" label="EffectiveDate" name="EffectiveDate" type="date"/>
  96. <Field __index="1" __sourcePath="{}/mapMetadata/Id" containerType="SINGLE" label="Id" name="Id" type="string"/>
  97. <Field __index="2" __sourcePath="{}/mapMetadata/TotalAmount" containerType="SINGLE" label="TotalAmount" name="TotalAmount" type="string"/>
  98. </Record>
  99. </Metadata>
  100. <Metadata __index="0" __referenceCounter="0" __sourcePath="{}/object" _dataStructure="OBJECT" _id="__id" _type="Output" id="e7c43187-f349-4c36-b674-3dbec6e275ef">
  101. <Record fieldDelimiter="," name="object" recordDelimiter="n\|rn\|r" type="delimited">
  102. <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
  103. </Record>
  104. </Metadata>
  105. <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">
  106. <Record fieldDelimiter="," name="orderLine" recordDelimiter="n\|rn\|r" type="delimited">
  107. <Field __artificialType="_parent_id" __systemManaged="true" name="__parent_id" type="string"/>
  108. <Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
  109. <Field __index="20" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/productId" containerType="SINGLE" label="productId" name="productId" type="string"/>
  110. <Field __index="21" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/productName" containerType="SINGLE" label="productName" name="productName" type="string"/>
  111. <Field __index="22" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/quantity" containerType="SINGLE" label="quantity" name="quantity" type="string"/>
  112. <Field __index="23" __sourcePath="{}/object/getOrdersResponse/orderLines/orderLine/unitPrice" containerType="SINGLE" label="unitPrice" name="unitPrice" type="number"/>
  113. </Record>
  114. </Metadata>
  115. <Dictionary>
  116. <Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
  117. <Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
  118. </Dictionary>
  119. </Global>
  120. <Phase number="0">
  121. <Node enabled="enabled" fileURL="dict:inputPayload" guiName="Map<k,v> READER" guiX="20" guiY="20" id="BEAN_READER0" type="BEAN_READER">
  122. <attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  123. <Context outPort="0" sequenceField="__id" xpath=".">
  124.   <Mapping cloverField="EffectiveDate" trim="true" xpath="EffectiveDate"/>
  125.   <Mapping cloverField="Id" trim="true" xpath="Id"/>
  126.   <Mapping cloverField="TotalAmount" trim="true" xpath="TotalAmount"/>
  127. </Context>
  128. ]]></attr>
  129. <attr name="_data_format"><![CDATA[MAP]]></attr>
  130. </Node>
  131. <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">
  132. <attr name="melScript"><![CDATA[//MEL
  133. //START -> DO NOT REMOVE
  134. output.__id = input.__id;
  135. output.__parent_id = input.__id;
  136. //END -> DO NOT REMOVE
  137. output.orderDate = date2str(input.EffectiveDate,"yyyy-mm-dd");
  138. output.orderNumber = input.Id;
  139. output.orderTotal = str2double(input.TotalAmount);]]></attr>
  140. </Node>
  141. <Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="JSON WRITER" guiX="900" guiY="20" id="JSON_WRITER0" type="JSON_WRITER">
  142. <attr name="__isJsonSchema"><![CDATA[false]]></attr>
  143. <attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
  144. <object xmlns:clover="http://www.cloveretl.com/ns/xmlmapping">
  145.   <clover:collection clover:name="getOrdersResponse">
  146.     <item clover:inPort="0">
  147.       <orderNumber>$0.orderNumber</orderNumber>
  148.       <orderDate>$0.orderDate</orderDate>
  149.       <clientOrderNumber>$0.clientOrderNumber</clientOrderNumber>
  150.       <customer>
  151.         <customerId>$0.customerId</customerId>
  152.         <customerName>$0.customerName</customerName>
  153.         <address>
  154.           <addressLine1>$0.addressLine1</addressLine1>
  155.           <addressLine2>$0.addressLine2</addressLine2>
  156.           <addressCity>$0.addressCity</addressCity>
  157.           <addressCounty>$0.addressCounty</addressCounty>
  158.           <addressPostcode>$0.addressPostcode</addressPostcode>
  159.           <addressCountry>$0.addressCountry</addressCountry>
  160.         </address>
  161.         <email>$0.email</email>
  162.         <paymentDetails>
  163.           <bank>$0.bank</bank>
  164.           <cardNumber>$0.cardNumber</cardNumber>
  165.           <sortCode>$0.sortCode</sortCode>
  166.           <cvv>$0.cvv</cvv>
  167.           <billingAddress>
  168.             <addressLine1>$0.addressLine1_1</addressLine1>
  169.             <addressLine2>$0.addressLine2_1</addressLine2>
  170.             <addressCity>$0.addressCity_1</addressCity>
  171.             <addressPostcode>$0.addressPostcode_1</addressPostcode>
  172.           </billingAddress>
  173.         </paymentDetails>
  174.       </customer>
  175.       <pricebookId>$0.pricebookId</pricebookId>
  176.       <orderTotal>$0.orderTotal</orderTotal>
  177.     </item>
  178.   </clover:collection>
  179. </object>]]></attr>
  180. <attr name="_data_format"><![CDATA[JSON]]></attr>
  181. <attr name="jsonSchemaURL"><![CDATA[C:/data/git/test-cloud/test-system/test-order-system/mappings/test-order-system-orders/getordersresponse.json]]></attr>
  182. </Node>
  183. <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"/>
  184. <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"/>
  185. </Phase>
  186. </Graph>
  187.    
  188. *******************************************************************************************************
  189. *            - - + APPLICATION + - -            *       - - + DOMAIN + - -       * - - + STATUS + - - *
  190. *******************************************************************************************************
  191. * test                                          * default                        * DEPLOYED           *
  192. *******************************************************************************************************
  193.  
  194. 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
  195. 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}]
  196.    
  197. {
  198.   "getOrdersResponse": []
  199. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top