Hello,
I’ve written the skeleton of a WorkflowAnalyzerRule (written in C#), and I need to call an existing XAML from this WorkflowAnalyzerRule. Is this possible, or how is this possible? I don’t want to have to rewrite all the code written in the XAML in pure C#.
Please help. A link to the relevant documentation would also be helpful. Thanks.
Here is the skeleton of my WorkflowAnalyzerRule:
using UiPath.Studio.Activities.Api;
using UiPath.Studio.Activities.Api.Analyzer;
using UiPath.Studio.Activities.Api.Analyzer.Rules;
using UiPath.Studio.Analyzer.Models;
namespace WorkFlowAnalyzerRule
{
public class RuleCompareConfig : IRegisterAnalyzerConfiguration
{
public void Initialize(IAnalyzerConfigurationService workflowAnalyzerConfigService)
{
if (!workflowAnalyzerConfigService.HasFeature("WorkflowAnalyzerV4"))
return;
var compareConfigRule = new Rule<IProjectModel>("PerformCompareConfig", "IT-USG-001", UsgCompareConfig);
compareConfigRule.DefaultErrorLevel = System.Diagnostics.TraceLevel.Info;
workflowAnalyzerConfigService.AddRule<IProjectModel>(compareConfigRule);
}
private InspectionResult UsgCompareConfig(IProjectModel pm, Rule configuredRule)
{
// Insert call from workflow (xyz.xaml) here
var messageList = new List<InspectionMessage>();
messageList.Add(new InspectionMessage()
{
Message = "Test"
});
return new InspectionResult()
{
HasErrors = true,
InspectionMessages = messageList,
RecommendationMessage = "Aufruf von CompareConfig einbauen!",
// ErrorLevel = System.Diagnostics.TraceLevel.Warning,
ErrorLevel = configuredRule.ErrorLevel,
};
}
};
}