-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMultipleInvoicesStagingTables.xaml
191 lines (191 loc) · 18.7 KB
/
MultipleInvoicesStagingTables.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
<Activity mc:Ignorable="sap sap2010" x:Class="MultipleInvoicesStagingTables" mva:VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="590,2488" sap2010:WorkflowViewState.IdRef="MultipleInvoicesStagingTables_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" 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=mscorlib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:uma="clr-namespace:UiPath.MLModel.Activities;assembly=UiPath.MLModel.Activities" xmlns:umd="clr-namespace:UiPath.MLModel.Datamodel;assembly=UiPath.MLModel" 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.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>System.Windows.Markup</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>UiPath.MLModel.Datamodel</x:String>
<x:String>ConnectivityFramework.HTTP.Contracts</x:String>
<x:String>System.Xml.Serialization</x:String>
<x:String>UiPath.DocumentProcessing.Contracts.Results</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
<AssemblyReference>UiPath.Excel</AssemblyReference>
<AssemblyReference>UiPath.Mail</AssemblyReference>
<AssemblyReference>UiPath.IntelligentOCR</AssemblyReference>
<AssemblyReference>UiPath.MLModel</AssemblyReference>
<AssemblyReference>ConnectivityFramework.HTTP</AssemblyReference>
<AssemblyReference>UiPath.Studio.Plugin.Workflow</AssemblyReference>
<AssemblyReference>System.ValueTuple</AssemblyReference>
<AssemblyReference>System.ComponentModel.Composition</AssemblyReference>
<AssemblyReference>UiPath.DocumentProcessing.Contracts</AssemblyReference>
<AssemblyReference>UiPath.MLModel</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence sap2010:Annotation.AnnotationText="This workflow will prompt for a folder which should contain one or more invoices (format can be png, bmp, tiff or pdf). It will then output an excel file in the Out folder with all the info contained in the invoices.

The output has two sheets: InvoiceInfo which holds each invoices information (e.g. total, addresses, etc.) and ItemInfo which holds details of each items present in each invoice (e.g. line amount, unit price)" DisplayName="MultipleInvoicesStagingTables" sap:VirtualizedContainerService.HintSize="570,2388" sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="x:String" Name="SelectedFolder" />
<Variable x:TypeArguments="sd:DataTable" Name="InvoiceDt" />
<Variable x:TypeArguments="sd:DataTable" Name="Items_Dt" />
<Variable x:TypeArguments="x:Int32" Name="Index" />
<Variable x:TypeArguments="ui:GenericValue" Name="OutputFile" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:SelectFolder DisplayName="Select Folder" sap:VirtualizedContainerService.HintSize="528,22" sap2010:WorkflowViewState.IdRef="SelectFolder_1" SelectedFolder="[SelectedFolder]" />
<Assign sap:VirtualizedContainerService.HintSize="528,60" sap2010:WorkflowViewState.IdRef="Assign_2">
<Assign.To>
<OutArgument x:TypeArguments="ui:GenericValue">[OutputFile]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="ui:GenericValue">["Out\ExtractedResults.xlsx"]</InArgument>
</Assign.Value>
</Assign>
<ui:Delete ContinueOnError="True" sap:VirtualizedContainerService.HintSize="528,22" sap2010:WorkflowViewState.IdRef="Delete_1" Path="[OutputFile]" />
<ui:BuildDataTable DataTable="[InvoiceDt]" DisplayName="Build Invoices Data Table" sap:VirtualizedContainerService.HintSize="528,59" sap2010:WorkflowViewState.IdRef="BuildDataTable_1" TableInfo="<NewDataSet>
 <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
 <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="TableName" msdata:UseCurrentLocale="true">
 <xs:complexType>
 <xs:choice minOccurs="0" maxOccurs="unbounded">
 <xs:element name="TableName">
 <xs:complexType>
 <xs:sequence>
 <xs:element name="Header_id" type="xs:int" minOccurs="0" />
 <xs:element name="FileName" type="xs:string" minOccurs="0" />
 <xs:element name="Name" type="xs:string" minOccurs="0" />
 <xs:element name="Vendor-addr" type="xs:string" minOccurs="0" />
 <xs:element name="Billing-addr" type="xs:string" minOccurs="0" />
 <xs:element name="Shipping-addr" type="xs:string" minOccurs="0" />
 <xs:element name="Invoice-no" type="xs:string" minOccurs="0" />
 <xs:element name="Po-no" type="xs:string" minOccurs="0" />
 <xs:element name="Date" type="xs:string" minOccurs="0" />
 <xs:element name="Total" type="xs:string" minOccurs="0" />
 <xs:element name="Tax" type="xs:string" minOccurs="0" />
 <xs:element name="Currency" type="xs:string" minOccurs="0" />
 </xs:sequence>
 </xs:complexType>
 </xs:element>
 </xs:choice>
 </xs:complexType>
 </xs:element>
 </xs:schema>
</NewDataSet>" />
<ui:BuildDataTable DataTable="[Items_Dt]" DisplayName="Build Items Data Table" sap:VirtualizedContainerService.HintSize="528,59" sap2010:WorkflowViewState.IdRef="BuildDataTable_2" TableInfo="<NewDataSet>
 <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
 <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="TableName" msdata:UseCurrentLocale="true">
 <xs:complexType>
 <xs:choice minOccurs="0" maxOccurs="unbounded">
 <xs:element name="TableName">
 <xs:complexType>
 <xs:sequence>
 <xs:element name="Header_id" type="xs:int" minOccurs="0" />
 <xs:element name="Description" type="xs:string" minOccurs="0" />
 <xs:element name="Unit-price" type="xs:string" minOccurs="0" />
 <xs:element name="Line-amount" type="xs:string" minOccurs="0" />
 <xs:element name="Quantity" type="xs:string" minOccurs="0" />
 <xs:element name="Item-po-no" type="xs:string" minOccurs="0" />
 </xs:sequence>
 </xs:complexType>
 </xs:element>
 </xs:choice>
 </xs:complexType>
 </xs:element>
 </xs:schema>
</NewDataSet>" />
<ui:ForEach x:TypeArguments="x:String" CurrentIndex="[Index]" DisplayName="Extract result from each file" sap:VirtualizedContainerService.HintSize="528,1209" sap2010:WorkflowViewState.IdRef="ForEach`1_2" Values="[Directory.GetFiles(SelectedFolder)]">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="file" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="492,1075" sap2010:WorkflowViewState.IdRef="Sequence_2">
<Sequence.Variables>
<Variable x:TypeArguments="ui:GenericValue" Name="Header_id" />
<Variable x:TypeArguments="umd:ModelResult" Name="Result" />
</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>
<uma:QueryMLModel APIKey="{x:Null}" DOM="{x:Null}" ExtractionResult="{x:Null}" InputDom="{x:Null}" RawText="{x:Null}" DisplayName="Extract semi-structured document" DocType="UiPath.MLModel.Invoice" Endpoint="https://invoices.uipath.com" sap:VirtualizedContainerService.HintSize="450,145" sap2010:WorkflowViewState.IdRef="QueryMLModel_2" ImagePath="[file]" ModelResult="[Result]" Timeout="[TimeSpan.FromMinutes(2)]" />
<Assign sap:VirtualizedContainerService.HintSize="450,60" sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="ui:GenericValue">[Header_id]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="ui:GenericValue">[Index+1]</InArgument>
</Assign.Value>
</Assign>
<ui:InvokeWorkflowFile ContinueOnError="{x:Null}" DisplayName="Write invoice data" sap:VirtualizedContainerService.HintSize="450,87" sap2010:WorkflowViewState.IdRef="InvokeWorkflowFile_1" UnSafe="False" WorkflowFileName="Utility\PutFieldsInDataTable.xaml">
<ui:InvokeWorkflowFile.Arguments>
<InArgument x:TypeArguments="umd:ModelField[]" x:Key="in_FieldArray">[Result.Fields]</InArgument>
<InOutArgument x:TypeArguments="sd:DataTable" x:Key="io_Dt">[InvoiceDt]</InOutArgument>
<InArgument x:TypeArguments="x:Int32" x:Key="in_HeaderId">[Header_id]</InArgument>
<InArgument x:TypeArguments="x:String" x:Key="in_FileName">[Path.GetFileName(file)]</InArgument>
</ui:InvokeWorkflowFile.Arguments>
</ui:InvokeWorkflowFile>
<ui:ForEach x:TypeArguments="umd:TableField" CurrentIndex="{x:Null}" DisplayName="For Each" sap:VirtualizedContainerService.HintSize="450,571" sap2010:WorkflowViewState.IdRef="ForEach`1_8" Values="[Result.TableFields]">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="umd:TableField">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="umd:TableField" Name="tableField" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="414,437" sap2010:WorkflowViewState.IdRef="Sequence_7">
<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:ForEach x:TypeArguments="umd:TableItem" CurrentIndex="{x:Null}" DisplayName="For Each" sap:VirtualizedContainerService.HintSize="372,345" sap2010:WorkflowViewState.IdRef="ForEach`1_7" Values="[tableField.Items]">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="umd:TableItem">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="umd:TableItem" Name="item" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="336,210.666666666667" sap2010:WorkflowViewState.IdRef="Sequence_6">
<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:InvokeWorkflowFile ContinueOnError="{x:Null}" DisplayName="Write invoice data" sap:VirtualizedContainerService.HintSize="314,86.6666666666667" sap2010:WorkflowViewState.IdRef="InvokeWorkflowFile_4" UnSafe="False" WorkflowFileName="Utility\PutFieldsInDataTable.xaml">
<ui:InvokeWorkflowFile.Arguments>
<InArgument x:TypeArguments="umd:ModelField[]" x:Key="in_FieldArray">[item.Fields]</InArgument>
<InOutArgument x:TypeArguments="sd:DataTable" x:Key="io_Dt">[Items_Dt]</InOutArgument>
<InArgument x:TypeArguments="x:Int32" x:Key="in_HeaderId">[Header_id]</InArgument>
<InArgument x:TypeArguments="x:String" x:Key="in_FileName">[Nothing]</InArgument>
</ui:InvokeWorkflowFile.Arguments>
</ui:InvokeWorkflowFile>
</Sequence>
</ActivityAction>
</ui:ForEach.Body>
</ui:ForEach>
</Sequence>
</ActivityAction>
</ui:ForEach.Body>
</ui:ForEach>
</Sequence>
</ActivityAction>
</ui:ForEach.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:ForEach>
<ui:CopyFile ContinueOnError="{x:Null}" Destination="[OutputFile]" DisplayName="Copy File" sap:VirtualizedContainerService.HintSize="430,22" sap2010:WorkflowViewState.IdRef="CopyFile_1" Overwrite="False" Path="Template\Template.xlsx" />
<ui:ExcelApplicationScope Password="{x:Null}" DisplayName="Excel Application Scope" sap:VirtualizedContainerService.HintSize="430,446" sap2010:WorkflowViewState.IdRef="ExcelApplicationScope_1" WorkbookPath="[OutputFile]">
<ui:ExcelApplicationScope.Body>
<ActivityAction x:TypeArguments="ui:WorkbookApplication">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="ui:WorkbookApplication" Name="ExcelWorkbookScope" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="336,337.333333333333" sap2010:WorkflowViewState.IdRef="Sequence_5">
<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:ExcelWriteRange AddHeaders="False" DataTable="[InvoiceDt]" DisplayName="Write Range" sap:VirtualizedContainerService.HintSize="314,86.6666666666667" sap2010:WorkflowViewState.IdRef="ExcelWriteRange_1" SheetName="InvoiceInfo" StartingCell="A2" />
<ui:ExcelWriteRange AddHeaders="False" DataTable="[Items_Dt]" DisplayName="Write Range" sap:VirtualizedContainerService.HintSize="314,86.6666666666667" sap2010:WorkflowViewState.IdRef="ExcelWriteRange_2" SheetName="ItemInfo" StartingCell="A2" />
</Sequence>
</ActivityAction>
</ui:ExcelApplicationScope.Body>
</ui:ExcelApplicationScope>
</Sequence>
</Activity>