Get the default activity Name

When we use UiPath in-built Analyze Project, we can check if default activity name has been used or not.

I am trying to achive that using custom code… is there a way to get default name of all the activities without defining it in the code?

For example UiPath must be taking that data from somewhere for code analyzing activity?

Any help will be appreciated

Are you writing a custom Worflow Analyzer Rule?
if so, then you can retrieve it from the model and use the Property representing the Default Name

Thank you for quick reply… can you please help with sample code?

it depends on your details (e.g. the level project, workflow, activity)

However we encourage you to enable / doing

  • remote debugging on your rule / a debuggable hello world rule
  • using the type definition of the activity / type and check for its Display Name Attribute as it should give us the default name

Step 1: Read the XAML FileUse the Read Text File activity to read the XAML file into a variable called fileContent (type String).

Step 2: Load the XML ContentUse an Invoke Method activity to load the XML content into an XmlDocument.TargetObject: diagramTree (of type XmlDocument, initialized using New XmlDocument()).MethodName: LoadXmlParameters:Direction: InType: StringValue: fileContent

Step 3: Get the Names of All Activities Using XPathUse another Invoke Method activity to select nodes using XPath.TargetObject: diagramTreeMethodName: SelectNodesParameters:Direction: InType: StringValue: “ui:MessageBox” (XPath to get all activity elements regardless of namespace)Output: activityNodes (variable of type XmlNodeList)

The above code is only check if thd xaml has the messagebox activity or not. But i need to check all the activity of that xaml file which is using default Name. How to do that?