Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <mule xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:db="http://www.mulesoft.org/schema/mule/db"
  4. xmlns:file="http://www.mulesoft.org/schema/mule/file"
  5. xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"
  6. xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
  7. xmlns:spring="http://www.springframework.org/schema/beans"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:schemaLocation="http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
  10. http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
  11. http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
  12. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
  13. http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
  14. http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd">
  15. <db:generic-config name="Generic_Database_Configuration1" url="jdbc:db2://faadbcdd0017:60004/MATIUT:user=mat_adm;password=q1w2e3r4;" driverClassName="com.ibm.db2.jcc.DB2Driver" doc:name="Generic Database Configuration"/>
  16. <file:connector name="File" outputPattern="Carfax.csv" writeToDirectory="C:optCCMOutputIUT" autoDelete="false" outputAppend="true" streaming="true" validateConnections="true" doc:name="File"/>
  17. <file:connector name="File1" outputPattern="sample.txt" readFromDirectory="C:optCCM" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
  18. <batch:job name="batch2Batch">
  19. <batch:input>
  20. <logger message="Startr>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" level="INFO" doc:name="Logger"/>
  21. <foreach doc:name="For Each">
  22. <db:select config-ref="Generic_Database_Configuration1" doc:name="Database">
  23. <db:parameterized-query><![CDATA[select MSG_ID,TEMPL_ID,MSG_DATA,EMAIL_CHNL_IND,PUSH_CHNL_IND, INSERT_TMSP,UID FROM IUT.message_master WHERE INSERT_TMSP between
  24. (CURRENT TIMESTAMP- HOUR (CURRENT TIMESTAMP) HOURS- MINUTE(CURRENT TIMESTAMP) MINUTES- SECOND(CURRENT TIMESTAMP) SECONDS
  25. - MICROSECOND(CURRENT TIMESTAMP) MICROSECONDS) and ((CURRENT TIMESTAMP- HOUR (CURRENT TIMESTAMP) HOURS
  26. - MINUTE(CURRENT TIMESTAMP) MINUTES- SECOND(CURRENT TIMESTAMP) SECONDS- MICROSECOND(CURRENT TIMESTAMP) MICROSECONDS) + 1 DAY)
  27. and SOURCE_SYS='CSS' and ONLINE_BATCH_IND IN('Y','E') AND APPL_PROCESS_IND = 'N' with UR]]></db:parameterized-query>
  28. </db:select>
  29. </foreach>
  30. <logger message="#[payload]" level="INFO" doc:name="Logger"/>
  31. </batch:input>
  32. <batch:process-records>
  33. <batch:step name="Batch_Step">
  34. <component class="com.mule.object.transformer.Mapper" doc:name="Java"/>
  35. <dw:transform-message metadata:id="9bd2e755-065a-4208-95cf-1277f5643ee9" doc:name="Transform Message">
  36. <dw:input-payload mimeType="application/java"/>
  37. <dw:set-payload><![CDATA[%dw 1.0
  38. %output application/csv separator = "|" , header = false , ignoreEmptyLine = true
  39. ---
  40. [{
  41. Timestamp: payload.timeStamp,
  42. NotificationType: payload.notificationType,
  43. UID: payload.UID,
  44. Name: payload.messageData.firstName,
  45. MiddleName: payload.messageData.middleName,
  46. LastName: payload.messageData.lastName,
  47. Email: payload.messageData.email,
  48. HHNumber: payload.messageData.cssDataRequest.householdNumber,
  49. PolicyNumber: payload.messageData.cssDataRequest.policyContractNumber,
  50. SentDate: payload.messageData.cssDataRequest.sendDate,
  51. PinNumber: payload.messageData.cssDataRequest.pin,
  52. AOR: payload.messageData.cssDataRequest.agentOfRecord
  53.  
  54. }]]]></dw:set-payload>
  55. </dw:transform-message>
  56. <file:outbound-endpoint path="C:optCCMOutputIUT" connector-ref="File" responseTimeout="10000" doc:name="File"/>
  57. </batch:step>
  58. </batch:process-records>
  59. <batch:on-complete>
  60. <logger message="Batch2 Completed" level="INFO" doc:name="Logger"/>
  61. </batch:on-complete>
  62. </batch:job>
  63.  
  64.  
  65. </mule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement