Batch Script
Batch Script
Execution
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information.
Content
• Overview
• Request Structure
• Creating Batch Script
• Option Tag Child Elements
• Batch Script Example
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 2
Overview
Batch processing allows you to generate and execute script files that can perform mass
operations (such as delete, renew or expire policies) on policies, files or messages in the
EXAMPLE Data database in an unattended manner.
In Duckcreek we achieve this using predefined server request “BatchProcess.processRq” which
allow batch processing of Server requests
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 3
Request Structure
The request used to start batch processing where the batch script is passed in as part of the
request.
<BatchProcess.processRq>
<Query />
<PreExecute />
<Execute />
<PostExecute />
</BatchProcess.processRq>
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 4
Creating Batch Script
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 5
Option Tag Child Elements
<Option>
<Layout>
</Layout>
</Option>
Note: The SQL tag also has an optional attribute called ‘timeoutSeconds’, its
important mention this in case we are trying to run long running queries using batch
script
• Sql
Provides the sql string as well as the information for the database to query.
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 6
Option Tag Child Elements (Cont..)
• Layout
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 7
Creating Batch Script (Cont..)
PreExecute
Executed before Execute tag and only once irrespective of number of records
selected in process
Execute
Executed after pre-execute and before post-execute, it’s executed once for every
record query tag returns, so we need to take extra care of the field/file we are calling
in Execute tab as it will impact all the policies returned by ‘query’ tag.
PostExecute
Executed after Execute tag and only once irrespective of number of records selected
in process
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 8
Batch Script Example
<server>
<requests>
<Session.loginRq userName="admin" password="admin"/>
<BatchProcess.processRq>
<Query>
<Option>
<Sql db="prompt" dsn="ExampleData" uid="DCTSqlUser" pwd="orange#5">{0}</Sql>
<Layout >
<Field value="select q.QuoteID,h.HistoryID,address from Quote q inner join History h on q.QuoteID = h.QuoteID where
q.Status='Quote' and q.ExpirationDate is not null and q.ExpirationDate <> '' and DATEDIFF (day,q.ExpirationDate,GETDATE()) = ‘0' and h.DuplicateRow=0 and (h.Deleted is null or h.Deleted='0') and
h.Type='New'" />
</Layout>
</Option>
<SessionLoadType>
<OnlineData.loadPolicyRq policyID="{0}" />
<OnlineData.loadHistoryRq historyID="{1}" />
</SessionLoadType>
</Query>
<PreExecute>
<requests />
</PreExecute>
<Execute>
<requests>
<ManuScript.getValueRq manuscript="Carrier_AutomatedProcess_Expire" field="data.ProcessCheck" />
</requests>
</Execute>
<PostExecute>
<requests />
</PostExecute>
</BatchProcess.processRq>
<Session.closeRq/>
</requests>
</server>
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 9
Using Batch Script Editor
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 10
Batch Script Execution
Prerequisite
Make sure DSN is configured with SQL authentication (in case we are accessing
SQL tables in batch process)
Navigation: Control Panel-> Administrative Tools->Data Source-> System DSN
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 11
Batch Script Execution (cont..)
Note: /s: “server”, /rf: “run the content for request file”
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 12
2. Now add the batch file in task scheduler and mention the trigger condition and
describe schedule timings
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 13
Questions ?
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 14
Thank You !!!!
Copyright © 2016 Duck Creek Technologies . All Rights Reserved. Confidential and Proprietary Information. 15