Search code examples
c#.netvb.netrpauipath

How to access the .NET code used in UiPath?


Is there a way to see some code, when writing automation with ? I have the following in UiPath Studio:

enter image description here

Is there a way to see the code that looks like this or something similar in :

Sub Main

    Dim year as Integer
    year = InputBox()
    If year mod 4 = 0 Then           'the rule for leap year is a bit different.
        MsgBox "It is leap"
    Else
        MsgBox "It is not leap"
    End If

End Sub

I have browsed around the internet, but so far I only found the XAML code, used for the creation of the boxes. My logic (or hope) is that if the UiPath Studio works with VB expression, then it should be possible to see the generated code:

enter image description here


Solution

  • UiPath Studio automatically "translates" the diagrams to :

    Thus, the XAML code of the above diagram looks like this:

    <Flowchart.Variables>
      <Variable x:TypeArguments="x:Int32" Default="2013" Name="year" />
    </Flowchart.Variables>
    <Flowchart.StartNode>
      <x:Reference>__ReferenceID3</x:Reference>
    </Flowchart.StartNode>
    <FlowDecision x:Name="__ReferenceID2" Condition="[year mod 4 = 0]" sap2010:WorkflowViewState.IdRef="FlowDecision_1">
      <FlowDecision.True>
        <FlowStep x:Name="__ReferenceID0" sap2010:WorkflowViewState.IdRef="FlowStep_2">
          <ui:MessageBox ChosenButton="{x:Null}" Buttons="Ok" Caption="It Is" DisplayName="Message box" sap2010:WorkflowViewState.IdRef="MessageBox_2" Text="It Is" TopMost="True" />
        </FlowStep>
      </FlowDecision.True>
      <FlowDecision.False>
        <FlowStep x:Name="__ReferenceID1" sap2010:WorkflowViewState.IdRef="FlowStep_4">
          <ui:MessageBox ChosenButton="{x:Null}" Buttons="Ok" Caption="It Is Not" DisplayName="Message box" sap2010:WorkflowViewState.IdRef="MessageBox_4" Text="It Is Not" TopMost="True" />
        </FlowStep>
      </FlowDecision.False>
    </FlowDecision>