TextExpression and Boilerplate - cprima-forks/uipath-ai-skills GitHub Wiki
Every generated .xaml file contains structural boilerplate beyond the activity elements. Some of this is required for VB.NET expression compilation; some is Studio designer state.
This block tells the VB.NET expression compiler which .NET namespaces are available in workflow expressions. Without it, any expression referencing types from those namespaces fails with a compile error (e.g., BC36532 for UiElement delegates).
The following are always present:
<x:String>GlobalConstantsNamespace</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>System</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>Conditional additions:
| Namespace | Condition |
|---|---|
System.Security |
has_securestring |
System.Data |
has_datatable |
UiPath.Web.Activities.Http |
has_http |
Assembly references required for expression compilation. Always present:
System.ComponentModel.TypeConverterSystem.LinqSystem.ObjectModelUiPath.System.Activities
Conditional:
| Assembly | Condition |
|---|---|
UiPath.UiAutomation.Activities |
has_ui |
UiPath.Web.Activities |
has_http |
A real Studio export (visible in assets/stripped/FormFilling_Main.xaml) includes a much longer namespace list — Microsoft.VisualBasic, System.Activities, System.Activities.Expressions, System.ComponentModel, System.Diagnostics, System.Drawing, System.IO, System.Reflection, etc.
The generators emit a minimal subset sufficient for the generated activities to compile. Studio adds the full set when it opens and re-saves a file. This means:
- Generator output is valid but minimal
- Studio will expand the namespace list on first save — this is expected behaviour, not corruption
Every workflow contains:
<VisualBasic.Settings>
<x:Null />
</VisualBasic.Settings>This is a Studio requirement. Its absence causes validation warnings in some Studio versions.
The outermost <Sequence> element always carries an IsExpanded=True ViewState block:
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>Child activities also emit ViewState blocks. These are purely for Studio's designer — they control whether activities appear expanded or collapsed in the canvas and have no effect on execution.