Advertisement
uniblab

Untitled

Nov 16th, 2017
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.82 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <WorkOrder xmlns="http://Icod.Wod" xsi:schemaLocation="http://Icod.Wod \\jgsm-sql01\D$\Icod.Wod\schema0.xsd"
  3.     xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.     jobName="SalesForce Data Pull"
  5.     emailTo="Timothy J. Bruce &lt;none@example.com&gt;"
  6. >
  7.     <steps>
  8.         <fileImport connectionStringName="SalesForce" updateBatchSize="20" tableName="SF_DataLoad_ErrorLog" namespace="dbo">
  9.             <columnMapping>
  10.                 <map from="%wod:FileName%" to="FileName" />
  11.                 <map from="Error" to="Error" />
  12.                 <map from="Id" to="Id" />
  13.                 <map from="CONTACTID" to="ContactId" />
  14.                 <map from="EMPLID__C" to="EmplId" />
  15.                 <map from="NETID__C" to="NetId" />
  16.             </columnMapping>
  17.             <source xsi:type="delimitedFile" path="\\jgsm-sql01\D$\SF_Downloads\Errors" name="*.Error.txt" fieldSeperator="44" />
  18.         </fileImport>
  19.         <dbCommand connectionStringName="SalesForce" commandType="Text" commandText="delete from dbo.SF_DataLoad_ErrorLog where dbo.TrimToNull( [Error] ) is null" />
  20.  
  21.         <fileOperation xsi:type="mkDir" path="\\jgsm-sql01\D$\SF_Downloads\Errors\Archive\%wod:DateTime{yyyy}%\%wod:DateTime{MM}%" />
  22.         <fileExport connectionStringName="SalesForce"
  23.                 commandText="select WhenLoaded, [FileName], Count( [Error] ) as ErrorCount from dbo.SF_DataLoad_ErrorLog where ( ( [Error] is not null ) and ( WhenLoaded = Cast( GetDate() as date ) ) ) group by [FileName], [WhenLoaded]"
  24.         >
  25.             <destination xsi:type="delimitedFile" path="\\jgsm-sql01\D$\SF_Downloads\Errors\Archive\%wod:DateTime{yyyy}%\%wod:DateTime{MM}%" name="ErrorSummary.csv" fieldSeperator="44" writeIfEmpty="false" >
  26.                 <columns>
  27.                     <column name="WhenLoaded" formatString="{0:d}" />
  28.                 </columns>
  29.             </destination>
  30.         </fileExport>
  31.         <email
  32.             subject="%wod:JobName%: error summary"
  33.             sendIfEmpty="false"
  34.             to="%wod:EmailTo%"
  35.         >
  36.             <attachments>
  37.                 <attach path="\\jgsm-sql01\D$\SF_Downloads\Errors\Archive\%wod:DateTime{yyyy}%\%wod:DateTime{MM}%" name="ErrorSummary.csv" />
  38.             </attachments>
  39.         </email>
  40.         <fileOperation xsi:type="deleteFile" path="\\jgsm-sql01\D$\SF_Downloads\Errors\Archive\%wod:DateTime{yyyy}%\%wod:DateTime{MM}%" name="ErrorSummary.csv" />
  41.  
  42.         <fileOperation xsi:type="mkZip" path="\\jgsm-sql01\D$\SF_Downloads\Errors\Archive\%wod:DateTime{yyyy}%\%wod:DateTime{MM}%" name="%wod:DateTime{yyyy-MM-dd}%T%wod:DateTime{HHmmss}%.zip" truncateEntryName="true" writeIfEmpty="false">
  43.             <sources>
  44.                 <source path="\\jgsm-sql01\D$\SF_Downloads" name="debug.log" />
  45.                 <source path="\\jgsm-sql01\D$\SF_Downloads\Errors" name="*.Error.txt" />
  46.             </sources>
  47.         </fileOperation>
  48.  
  49.         <fileOperation xsi:type="deleteFile" path="\\jgsm-sql01\D$\SF_Downloads\Errors" name="*.Error.txt"/>
  50.         <fileOperation xsi:type="deleteFile" path="\\jgsm-sql01\D$\SF_Downloads" name="debug.log" />
  51.  
  52.     </steps>
  53. </WorkOrder>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement