-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main_modern.xaml
457 lines (457 loc) · 42.4 KB
/
Main_modern.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<Activity mc:Ignorable="sap sap2010" x:Class="Main" VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="988,3462" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="clr-namespace:System;assembly=System.Private.CoreLib" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:sd="clr-namespace:System.Drawing;assembly=System.Drawing.Common" xmlns:sd1="clr-namespace:System.Drawing;assembly=System.Drawing.Primitives" xmlns:si="clr-namespace:System.IO;assembly=System.Private.CoreLib" xmlns:str="clr-namespace:System.Text.RegularExpressions;assembly=System.Text.RegularExpressions" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:uix="http://schemas.uipath.com/workflow/activities/uix" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Reflection</x:String>
<x:String>UiPath.Activities.Contracts</x:String>
<x:String>System.Text.RegularExpressions</x:String>
<x:String>UiPath.UIAutomationCore.Contracts</x:String>
<x:String>System.Runtime.Serialization</x:String>
<x:String>UiPath.Vision.OCR</x:String>
<x:String>UiPath.OCR.Contracts</x:String>
<x:String>UiPath.OCR.Activities</x:String>
<x:String>UiPath.OCR.Contracts.Activities</x:String>
<x:String>UiPath.Excel</x:String>
<x:String>UiPath.Excel.Model</x:String>
<x:String>UiPath.Excel.Activities.Business</x:String>
<x:String>UiPath.Platform.ResourceHandling</x:String>
<x:String>UiPath.Shared.Activities.Business</x:String>
<x:String>UiPath.UIAutomationNext.Enums</x:String>
<x:String>UiPath.UIAutomationNext.Activities</x:String>
<x:String>UiPath.Platform.ObjectLibrary</x:String>
<x:String>UiPath.Shared.Activities</x:String>
<x:String>System.ComponentModel</x:String>
<x:String>UiPath.Core.Activities.OCR.Engines</x:String>
<x:String>UiPath.PDF</x:String>
<x:String>UiPath.PDF.Activities</x:String>
<x:String>System.Globalization</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>System.Reflection.DispatchProxy</AssemblyReference>
<AssemblyReference>System.Reflection.TypeExtensions</AssemblyReference>
<AssemblyReference>System.Reflection.Metadata</AssemblyReference>
<AssemblyReference>UiPath.Activities.Contracts</AssemblyReference>
<AssemblyReference>System.Text.RegularExpressions</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationCore</AssemblyReference>
<AssemblyReference>System.Private.ServiceModel</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
<AssemblyReference>UiPath.OCR.Core</AssemblyReference>
<AssemblyReference>UiPath.Vision.Core</AssemblyReference>
<AssemblyReference>UiPath.OCR.Contracts</AssemblyReference>
<AssemblyReference>UiPath.OCR.Activities</AssemblyReference>
<AssemblyReference>UiPath.System.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.System.Activities.ViewModels</AssemblyReference>
<AssemblyReference>NPOI</AssemblyReference>
<AssemblyReference>System.Memory.Data</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
<AssemblyReference>UiPath.Excel.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.Excel.Activities</AssemblyReference>
<AssemblyReference>UiPath.Excel</AssemblyReference>
<AssemblyReference>UiPath.Platform</AssemblyReference>
<AssemblyReference>UiPath.Mail.Activities</AssemblyReference>
<AssemblyReference>UiPath.Testing.Activities</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationNext.Activities</AssemblyReference>
<AssemblyReference>UiPath.PDF.Activities</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationNext</AssemblyReference>
<AssemblyReference>System.ComponentModel.EventBasedAsync</AssemblyReference>
<AssemblyReference>Microsoft.Win32.Primitives</AssemblyReference>
<AssemblyReference>System.ComponentModel.Primitives</AssemblyReference>
<AssemblyReference>UiPath.Workflow</AssemblyReference>
<AssemblyReference>System.CodeDom</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic.Forms</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic.Core</AssemblyReference>
<AssemblyReference>UiPath.PDF</AssemblyReference>
<AssemblyReference>System.Linq.Expressions</AssemblyReference>
<AssemblyReference>System.Linq.Parallel</AssemblyReference>
<AssemblyReference>System.Collections.Immutable</AssemblyReference>
<AssemblyReference>System.Linq.Queryable</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="627,3397" sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="x:String" Name="varSales_str" />
<Variable x:TypeArguments="x:Double" Default="0" Name="varRunningTotalOfSales" />
<Variable x:TypeArguments="x:String" Name="varReceiptID" />
<Variable x:TypeArguments="x:String" Name="varReceiptDate_str" />
<Variable x:TypeArguments="x:String" Name="varPrice" />
<Variable x:TypeArguments="x:String" Name="varQuantity" />
<Variable x:TypeArguments="s:DateTime" Name="varReceiptDate" />
<Variable x:TypeArguments="x:String" Name="varOutputReportName" />
<Variable x:TypeArguments="x:Double" Name="varSales" />
<Variable x:TypeArguments="x:String" Name="FullReceiptText" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign DisplayName="Get unique output report name" sap:VirtualizedContainerService.HintSize="585,82" sap2010:WorkflowViewState.IdRef="Assign_3">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varOutputReportName]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">["receipt-data-scraped-modern-" + Now.ToString("dd-MM-yyyy-hh-mm-ss") + ".txt"]</InArgument>
</Assign.Value>
</Assign>
<ui:ForEachFileX DisplayName="Iterate through each scanned receipt" Filter="*.pdf" Folder="Scanned_Documents\scanned_receipts" sap:VirtualizedContainerService.HintSize="585,3187" sap2010:WorkflowViewState.IdRef="ForEachFileX_1" IncludeSubDirectories="False" OrderBy="NameAscFirst" SkipFolderWithoutPermission="False">
<ui:ForEachFileX.Body>
<ActivityAction x:TypeArguments="si:FileInfo, x:Int32">
<ActivityAction.Argument1>
<DelegateInArgument x:TypeArguments="si:FileInfo" Name="CurrentFile" />
</ActivityAction.Argument1>
<ActivityAction.Argument2>
<DelegateInArgument x:TypeArguments="x:Int32" Name="CurrentIndex" />
</ActivityAction.Argument2>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="551,2929" sap2010:WorkflowViewState.IdRef="Sequence_2">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:LogMessage DisplayName="Log status message" sap:VirtualizedContainerService.HintSize="509,141" sap2010:WorkflowViewState.IdRef="LogMessage_3" Level="[UiPath.Core.Activities.LogLevel.Info]" Message="["Initiating the processing of " + CurrentFile.Name]" />
<ui:Comment DisplayName="Notes: Get OCR Text vs. Read PDF with OCR" sap:VirtualizedContainerService.HintSize="509,210" sap2010:WorkflowViewState.IdRef="Comment_5" Text="// Get OCR Text vs. Read PDF with OCR

- Get OCR Text is better for scrapping PORTIONS of text from a scanned document or image.
- Read PDF with OCR is better for scrapping the ENTIRE scanned PDF document in one step (without openning the file) and much faster." />
<ui:CommentOut DisplayName="Comment Out" sap:VirtualizedContainerService.HintSize="509,219" sap2010:WorkflowViewState.IdRef="CommentOut_3">
<ui:CommentOut.Body>
<Sequence DisplayName="Ignored Activities" sap:VirtualizedContainerService.HintSize="300,140" sap2010:WorkflowViewState.IdRef="Sequence_9">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<uix:NApplicationCard AttachMode="SingleWindow" CloseMode="Always" DisplayName="Scrap receipt using "Get OCR Text" activity" sap:VirtualizedContainerService.HintSize="258,52" sap2010:WorkflowViewState.IdRef="NApplicationCard_2" OpenMode="Always" ScopeGuid="d5d4360b-58f0-4453-ac81-e8799b0b2615" Version="V2" WindowResize="Maximize">
<uix:NApplicationCard.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="WSSessionData" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="476,1807" sap2010:WorkflowViewState.IdRef="Sequence_3">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:Comment DisplayName="Notes: Input Mode for OCR" sap:VirtualizedContainerService.HintSize="434,95" sap2010:WorkflowViewState.IdRef="Comment_1" Text="// Given that OCR runs in FOREGROUND, Hardware Events has to be chosen as Input Mode." />
<uix:NKeyboardShortcuts ActivateBefore="True" ClickBeforeMode="None" DisplayName="Adjust the document zoom to fit the screen" sap:VirtualizedContainerService.HintSize="434,154" sap2010:WorkflowViewState.IdRef="NKeyboardShortcuts_2" ScopeIdentifier="d5d4360b-58f0-4453-ac81-e8799b0b2615" Shortcuts="[d(hk)][d(ctrl)]0[u(ctrl)][u(hk)]" Version="V3" />
<ui:GetOCRText WordsInfo="{x:Null}" DisplayName="Get Receipt ID" sap:VirtualizedContainerService.HintSize="434,172" sap2010:WorkflowViewState.IdRef="GetOCRText_1">
<ui:GetOCRText.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_1" Image="[Image]" Language="en" Profile="Scan" Scale="2" />
</ActivityFunc>
</ui:GetOCRText.OCREngine>
<ui:GetOCRText.Target>
<ui:Target Element="{x:Null}" Id="277d620e-ec10-4a5b-8e66-9887780a7257" InformativeScreenshot="3020154d7184a68ff587d461f6e019f5" Selector="<wnd aaname='Document Pane' cls='AVL_AVView' title='AVScrolledPageView' /><wnd aaname='Alert: Empty document' cls='AVL_AVView' title='AVPageView' />">
<ui:Target.ClippingRegion>
<ui:Region Rectangle="800, 306, 170, 37" />
</ui:Target.ClippingRegion>
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:GetOCRText.Target>
<ui:GetOCRText.Text>
<OutArgument x:TypeArguments="x:String">[varReceiptID]</OutArgument>
</ui:GetOCRText.Text>
</ui:GetOCRText>
<ui:GetOCRText WordsInfo="{x:Null}" DisplayName="Get Receipt Date" sap:VirtualizedContainerService.HintSize="434,172" sap2010:WorkflowViewState.IdRef="GetOCRText_2">
<ui:GetOCRText.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_6" Image="[Image]" Language="en" Profile="Scan" Scale="2" />
</ActivityFunc>
</ui:GetOCRText.OCREngine>
<ui:GetOCRText.Target>
<ui:Target Element="{x:Null}" Id="277d620e-ec10-4a5b-8e66-9887780a7257" InformativeScreenshot="c49ba4b459cc21308baf80c0f8087e52" Selector="<wnd aaname='Document Pane' cls='AVL_AVView' title='AVScrolledPageView' /><wnd aaname='Alert: Empty document' cls='AVL_AVView' title='AVPageView' />">
<ui:Target.ClippingRegion>
<ui:Region Rectangle="798, 342, 175, 32" />
</ui:Target.ClippingRegion>
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:GetOCRText.Target>
<ui:GetOCRText.Text>
<OutArgument x:TypeArguments="x:String">[varReceiptDate_str]</OutArgument>
</ui:GetOCRText.Text>
</ui:GetOCRText>
<Assign DisplayName="Convert the extracted ReceiptDate value from string to date" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="s:DateTime">[varReceiptDate]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="s:DateTime">[Convert.ToDateTime(varReceiptDate_str)]</InArgument>
</Assign.Value>
</Assign>
<ui:GetOCRText WordsInfo="{x:Null}" DisplayName="Get Price" sap:VirtualizedContainerService.HintSize="434,172" sap2010:WorkflowViewState.IdRef="GetOCRText_3">
<ui:GetOCRText.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_7" Image="[Image]" Language="en" Profile="Scan" Scale="2" />
</ActivityFunc>
</ui:GetOCRText.OCREngine>
<ui:GetOCRText.Target>
<ui:Target Element="{x:Null}" Id="277d620e-ec10-4a5b-8e66-9887780a7257" InformativeScreenshot="b3d1c16c14acbcc9e74e71e12d43bc6f" Selector="<wnd aaname='Document Pane' cls='AVL_AVView' title='AVScrolledPageView' /><wnd aaname='Alert: Empty document' cls='AVL_AVView' title='AVPageView' />">
<ui:Target.ClippingRegion>
<ui:Region Rectangle="799, 625, 152, 34" />
</ui:Target.ClippingRegion>
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:GetOCRText.Target>
<ui:GetOCRText.Text>
<OutArgument x:TypeArguments="x:String">[varPrice]</OutArgument>
</ui:GetOCRText.Text>
</ui:GetOCRText>
<Assign DisplayName="Remove white space in the extracted Price value" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_4">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varPrice]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[varPrice.Replace(" ", "")]</InArgument>
</Assign.Value>
</Assign>
<ui:GetOCRText WordsInfo="{x:Null}" DisplayName="Get Quantity" sap:VirtualizedContainerService.HintSize="434,172" sap2010:WorkflowViewState.IdRef="GetOCRText_4">
<ui:GetOCRText.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_8" Image="[Image]" Language="en" Profile="Scan" Scale="2" />
</ActivityFunc>
</ui:GetOCRText.OCREngine>
<ui:GetOCRText.Target>
<ui:Target Element="{x:Null}" Id="277d620e-ec10-4a5b-8e66-9887780a7257" InformativeScreenshot="43d33fe8d07b398e201547e4051762e3" Selector="<wnd aaname='Document Pane' cls='AVL_AVView' title='AVScrolledPageView' /><wnd aaname='Alert: Empty document' cls='AVL_AVView' title='AVPageView' />">
<ui:Target.ClippingRegion>
<ui:Region Rectangle="797, 657, 154, 31" />
</ui:Target.ClippingRegion>
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:GetOCRText.Target>
<ui:GetOCRText.Text>
<OutArgument x:TypeArguments="x:String">[varQuantity]</OutArgument>
</ui:GetOCRText.Text>
</ui:GetOCRText>
<ui:GetOCRText WordsInfo="{x:Null}" DisplayName="Get Sales" sap:VirtualizedContainerService.HintSize="434,172" sap2010:WorkflowViewState.IdRef="GetOCRText_5">
<ui:GetOCRText.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_9" Image="[Image]" Language="en" Profile="Scan" Scale="2" />
</ActivityFunc>
</ui:GetOCRText.OCREngine>
<ui:GetOCRText.Target>
<ui:Target Element="{x:Null}" Id="277d620e-ec10-4a5b-8e66-9887780a7257" InformativeScreenshot="8afe9dbcf621d62db81c1ea3f9032284" Selector="<wnd aaname='Document Pane' cls='AVL_AVView' title='AVScrolledPageView' /><wnd aaname='Alert: Empty document' cls='AVL_AVView' title='AVPageView' />">
<ui:Target.ClippingRegion>
<ui:Region Rectangle="801, 686, 156, 37" />
</ui:Target.ClippingRegion>
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:GetOCRText.Target>
<ui:GetOCRText.Text>
<OutArgument x:TypeArguments="x:String">[varSales_str]</OutArgument>
</ui:GetOCRText.Text>
</ui:GetOCRText>
<Assign DisplayName="Convert the extracted Sales value from string to double" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_5">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[varSales]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[CDbl(varSales_str.Replace("$", "").Replace(" ", ""))]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</ActivityAction>
</uix:NApplicationCard.Body>
<uix:NApplicationCard.TargetApp>
<uix:TargetApp Area="1912, -8, 1936, 1056" Arguments="[CurrentFile.FullName]" FilePath="C:\Program Files\Adobe\Acrobat DC\Acrobat\acrobat.exe" IconBase64="iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAUJSURBVFhH5Zh/TFZVGMdBSyxTjPghFeW0cpq0LF1SEZUx0kLWgpptTocmIAjjh0grxtogGDCGMn4M3pZikRosm9WIaghhq/FD1GACawVCvCAMkHvvOZf3fb90zkXbet/zmuC92dYfnz/u7nOf57NzzznPuddlenraBYADNpvNMET1nCEWtFpdrUcqNqlLXE4zphjQgVFGvrWixM9msTjWdIJQ0FJ6aCNLZlaXe4C8FgJlbySUuN1zJ2qHjQT4U+rlJrO8JktRwTL7ms4QCrIk36o+d0LZHweppwvSlSuQJGnujI3ZpKYGVXkvZYouv0dl+Y9b3n/nhiSdCVK6fhWks63ignPFbIaSlgDVY75F9VxwypKR9o+SzgRBN20UF9EBJf5tUHdXC6tTbTmY522zWh0crnFLBDnK/n2g3nfwBfih1VSyki1MBw/OLROU+i+B7NkO6rWQz8mTbCR97D04+giOjUE+8QnIvl2Q674Sx9gzOQmp4wKUiFegurvybajA3oOjjyBb6SRiM8jLgSCvviCOEcEk5eNHoT68jAtK9h4cXQTl72pBt4VB/uwYVL+lUE5/L4wTcqkP9Nl12mZu78HRZwR/qAd9nY1g3C6o9y2GUv2pOM4JvJaxgmzC07CXQFf7gXcfeZb7p/GCDCXjANjmC7phNaTRUWGMM/4dQbavqR63gW4JEt6/HsYL9lwEDX6adYd5oA96QPmGbTWz6N/GCjIRudIEdYUXSOA6ELaaaTB7trEe0sVOSBfOQfrlPKS+XqfSxgr2/s6OU9uhLp0HEr8HSnoqVN9FIGxEyY43QHa/BRK5DQrrGnLNMUiXhx1yGCfIR++LatCHfLQCfBXTzc9pwiT0RdCV3iAxOyEfOwoa+ARo0JPCFW6M4Pl2KDvfBPVzh+q1AEpyrNa6tFc5ZIb0268g2Rmga5g0e/3U0w00JBAyj7HLpa/gyGUoB/NAVt0L8tSjWh8lEVtm5psonlPPOstPP0Ia/EN4Xz/B8XHIZUUzPTc/C+SZx0EfWwH5y5OOsbNAN0F5aAgkKRYkLBiEzSey5gHIR0yauH3sbNB1BKWvT4EkREFhohLf7yYmHONmiX6CHC7E5qE0OsKOSzf5MXUVfQUN4P8pWFFRgZycHFRWVqK7uxs1NTXadXl5OVpaWtDb2wuTyYTs7GwUFhaip6dHmIdjiGBISAgKCgqQlpaG/Px8REZGIikpCSUlJYiKikJVVRW2bt2qyR0+fFgTFuXhGCIYHByMhoYG1NbWIi4uDuHh4SgtLcXg4CBSU1ORmJiI0NBQ9PX1YYItrEn+kSTIwzFMMCsrCykpKcjLy9NGsKysDMPDw0hPT0dsbKwmGBQUhIiICPT39wvzcAwT5FLFxcXo6upCTEwMioqK0N7ejujoaGRmZmqCTU1N6OjoEOa4hmGCjY2Nf13Hx8drI5WcnIzc3FzU1dUhLCwMAwMDf3tOhCGCzc3NMJvZqeXqdWdnJ86cOYPW1lZNamRkBG1tbRi/gTY4N8HnN8x0DEFCXenpBg3wn7XgKH3EF/LHH0EaYJP7Zv8PiuA52blR/vwEVP65usRl3N6D40wwlp3zptS1y0H2RkIuLoRcUaIvpQehHEgACVgL9e75/C/Xu/YeHKGgpezQQtXL7QN6/5JhPvSG4nuXWfW8PZ/VdLf34AgF+b86a1vzIuu5s/7Wlp/XG0p721pWa/F1/w/+d5l2+ROBiPgPwy36dgAAAABJRU5ErkJggg==" InformativeScreenshot="cc9b546f57a8d2f0047b01f9807e0563.png" Selector="<wnd app='acrobat.exe' cls='AcrobatSDIWindow' title='receipt*.pdf*' />" Title="receipt-petrol-1654778561.png.pdf - Adobe Acrobat Reader (64-bit*" />
</uix:NApplicationCard.TargetApp>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</uix:NApplicationCard>
</Sequence>
</ui:CommentOut.Body>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</ui:CommentOut>
<ui:Comment DisplayName="Notes: Install UiPath.PDF.Activities" sap:VirtualizedContainerService.HintSize="509,75" sap2010:WorkflowViewState.IdRef="Comment_6" Text="// Install UiPath.PDF.Activities package to make 'Read PDF with OCR' available" />
<ui:ReadPDFWithOCR DegreeOfParallelism="-1" DisplayName="Scrap full texts from current receipt using "Read PDF with OCR" activity" FileName="[CurrentFile.FullName]" sap:VirtualizedContainerService.HintSize="509,157" sap2010:WorkflowViewState.IdRef="ReadPDFWithOCR_2" ImageDpi="150" Range="All" Text="[FullReceiptText]">
<ui:ReadPDFWithOCR.OCREngine>
<ActivityFunc x:TypeArguments="sd:Image, scg:IEnumerable(scg:KeyValuePair(sd1:Rectangle, x:String))">
<ActivityFunc.Argument>
<DelegateInArgument x:TypeArguments="sd:Image" Name="Image" />
</ActivityFunc.Argument>
<ui:GoogleOCR DeniedCharacters="{x:Null}" FilterRegion="{x:Null}" Invert="{x:Null}" Output="{x:Null}" PredictionId="{x:Null}" Text="{x:Null}" AllowedCharacters="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, :/$." ComputeSkewAngle="False" DisplayName="Tesseract OCR" ExtractWords="False" sap:VirtualizedContainerService.HintSize="200,25" sap2010:WorkflowViewState.IdRef="GoogleOCR_11" Image="[Image]" Language="en" Profile="Scan" Scale="3" />
</ActivityFunc>
</ui:ReadPDFWithOCR.OCREngine>
</ui:ReadPDFWithOCR>
<ui:LogMessage DisplayName="Display the extracted full texts" sap:VirtualizedContainerService.HintSize="509,141" sap2010:WorkflowViewState.IdRef="LogMessage_2" Level="[UiPath.Core.Activities.LogLevel.Trace]" Message="[FullReceiptText]" />
<Sequence DisplayName="Use Rgular Expression to extract the desired measures/metrics from the full texts" sap:VirtualizedContainerService.HintSize="509,1182" sap2010:WorkflowViewState.IdRef="Sequence_11">
<Sequence.Variables>
<Variable x:TypeArguments="scg:IEnumerable(str:Match)" Name="ReceiptID_matches" />
<Variable x:TypeArguments="scg:IEnumerable(str:Match)" Name="Price_matches" />
<Variable x:TypeArguments="scg:IEnumerable(str:Match)" Name="ReceiptDate_matches" />
<Variable x:TypeArguments="scg:IEnumerable(str:Match)" Name="Quantity_matches" />
<Variable x:TypeArguments="scg:IEnumerable(str:Match)" Name="Sales_matches" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:Matches FirstMatch="{x:Null}" BuilderPattern="Receipt\s*ID[^\d]+(\d+)" DisplayName="Find matches of Receipt ID from the full texts" sap:VirtualizedContainerService.HintSize="447,60" sap2010:WorkflowViewState.IdRef="Matches_6" Input="[FullReceiptText]" IsBuilderTabModified="True" Model="[{"Index":0,"OperationID":"ADV","OperationName":"Advanced","OperationValue":"Receipt\\s*ID[^\\d]+(\\d+)","QuantifierFirstValue":"1","QuantifierID":"EXT","QuantifierName":"Exactly","QuantifierSecondValue":null}]" Pattern="Receipt\s*ID[^\d]+(\d+)" RegexOption="Compiled" Result="[ReceiptID_matches]" />
<Assign DisplayName="Extract Receipt ID" sap:VirtualizedContainerService.HintSize="447,82" sap2010:WorkflowViewState.IdRef="Assign_10">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varReceiptID]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[ReceiptID_matches(0).groups(1).tostring]</InArgument>
</Assign.Value>
</Assign>
<ui:Matches FirstMatch="{x:Null}" BuilderPattern="Date.*(\d{2}\/\d{2}\/\d{4})" DisplayName="Find matches of Receipt Date from the full texts" sap:VirtualizedContainerService.HintSize="447,60" sap2010:WorkflowViewState.IdRef="Matches_7" Input="[FullReceiptText]" IsBuilderTabModified="True" Model="[{"Index":0,"OperationID":"ADV","OperationName":"Advanced","OperationValue":"Date.*(\\d{2}\\\/\\d{2}\\\/\\d{4})","QuantifierFirstValue":"1","QuantifierID":"EXT","QuantifierName":"Exactly","QuantifierSecondValue":null}]" Pattern="Date.*(\d{2}\/\d{2}\/\d{4})" RegexOption="Compiled" Result="[ReceiptDate_matches]" />
<Assign DisplayName="Extract Receipt Date" sap:VirtualizedContainerService.HintSize="447,83" sap2010:WorkflowViewState.IdRef="Assign_11">
<Assign.To>
<OutArgument x:TypeArguments="s:DateTime">[varReceiptDate]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="s:DateTime" xml:space="preserve">[Datetime.ParseExact(
ReceiptDate_matches(0).groups(1).tostring,
"MM/dd/yyyy",
System.Globalization.CultureInfo.InvariantCulture
)]</InArgument>
</Assign.Value>
</Assign>
<ui:Matches FirstMatch="{x:Null}" BuilderPattern="Price.*\$.*(\d+[\.\,]\d{2})" DisplayName="Find matches of Price from the full texts" sap:VirtualizedContainerService.HintSize="447,60" sap2010:WorkflowViewState.IdRef="Matches_10" Input="[FullReceiptText]" IsBuilderTabModified="True" Model="[{"Index":0,"OperationID":"ADV","OperationName":"Advanced","OperationValue":"Price.*\\$.*(\\d+[\\.\\,]\\d{2})","QuantifierFirstValue":"1","QuantifierID":"EXT","QuantifierName":"Exactly","QuantifierSecondValue":null}]" Pattern="Price.*\$.*(\d+[\.\,]\d{2})" RegexOption="Compiled" Result="[Price_matches]" />
<Assign DisplayName="Extract Price" sap:VirtualizedContainerService.HintSize="447,82" sap2010:WorkflowViewState.IdRef="Assign_12">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varPrice]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[Price_matches(0).groups(1).tostring.replace(",", ".")]</InArgument>
</Assign.Value>
</Assign>
<ui:Matches FirstMatch="{x:Null}" BuilderPattern="Quantity.*\s(\d+[\.\,]\d{2})\s*[Ltr]+" DisplayName="Find matches of Quantity from the full texts" sap:VirtualizedContainerService.HintSize="447,60" sap2010:WorkflowViewState.IdRef="Matches_8" Input="[FullReceiptText]" IsBuilderTabModified="True" Model="[{"Index":0,"OperationID":"ADV","OperationName":"Advanced","OperationValue":"Quantity.*\\s(\\d+[\\.\\,]\\d{2})\\s*[Ltr]+","QuantifierFirstValue":"1","QuantifierID":"EXT","QuantifierName":"Exactly","QuantifierSecondValue":null}]" Pattern="Quantity.*\s(\d+[\.\,]\d{2})\s*[Ltr]+" RegexOption="Compiled" Result="[Quantity_matches]" />
<Assign DisplayName="Extract Quantity" sap:VirtualizedContainerService.HintSize="447,82" sap2010:WorkflowViewState.IdRef="Assign_13">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varQuantity]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[Quantity_matches(0).groups(1).tostring.replace(",", ".")]</InArgument>
</Assign.Value>
</Assign>
<ui:Matches FirstMatch="{x:Null}" BuilderPattern="Sale[^\d]+(\d+[\.\,]\d{2})" DisplayName="Find matches of Sales from the full texts" sap:VirtualizedContainerService.HintSize="447,60" sap2010:WorkflowViewState.IdRef="Matches_9" Input="[FullReceiptText]" IsBuilderTabModified="True" Model="[{"Index":0,"OperationID":"ADV","OperationName":"Advanced","OperationValue":"Sale[^\\d]+(\\d+[\\.\\,]\\d{2})","QuantifierFirstValue":"1","QuantifierID":"EXT","QuantifierName":"Exactly","QuantifierSecondValue":null}]" Pattern="Sale[^\d]+(\d+[\.\,]\d{2})" RegexOption="IgnoreCase, Compiled" Result="[Sales_matches]" />
<Assign DisplayName="Extract Sales" sap:VirtualizedContainerService.HintSize="447,82" sap2010:WorkflowViewState.IdRef="Assign_14">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[varSales]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[CDbl(Sales_matches(0).groups(1).tostring.replace(",", "."))]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
<Assign DisplayName="Sum up Sales amount" sap:VirtualizedContainerService.HintSize="509,82" sap2010:WorkflowViewState.IdRef="Assign_15">
<Assign.To>
<OutArgument x:TypeArguments="x:Double">[varRunningTotalOfSales]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Double">[Math.Round(varRunningTotalOfSales + varSales, 2)]</InArgument>
</Assign.Value>
</Assign>
<ui:AppendLine File="{x:Null}" DisplayName="Write scrapped data into output report" FileName="["Outputs\" + varOutputReportName]" sap:VirtualizedContainerService.HintSize="509,133" sap2010:WorkflowViewState.IdRef="AppendLine_4" Text="["Receipt ID: " + varReceiptID + " | Receipt Date: " + varReceiptDate.ToString("d MMMM yyyy") +
" | Price: $" + varPrice + " | Quantity: " + varQuantity + " Ltr | Sales: $" + varSales.ToString +
" | Total Sales: $" + varRunningTotalOfSales.ToString]" UseDefaultEncoding="False" />
<ui:LogMessage DisplayName="Log status message" sap:VirtualizedContainerService.HintSize="509,141" sap2010:WorkflowViewState.IdRef="LogMessage_1" Level="[UiPath.Core.Activities.LogLevel.Info]" Message="["Successfully processed receipt: " + CurrentFile.Name]" />
</Sequence>
</ActivityAction>
</ui:ForEachFileX.Body>
</ui:ForEachFileX>
</Sequence>
</Activity>