I'm working on ASP.NET MVC project where controller calling static class that run R scripts from external R project
Controller
public ActionResult Index()
{
Rscript.Run("WordCloud");// name of script file for example WordCloud
return View();
}
Rscript
public static class Rscript
{
public static bool Run(string filename)
{
var rCodeFilePath = $"\\RProject\\{filename}.R";
var rScriptExecutablePath = @"C:\Rscript.exe";
var result = string.Empty;
try
{
var info = new ProcessStartInfo
{
FileName = rScriptExecutablePath,
WorkingDirectory = Path.GetDirectoryName(rScriptExecutablePath),
Arguments = rCodeFilePath,
RedirectStandardInput = false,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (var proc = new Process())
{
proc.StartInfo = info;
proc.Start();
proc.Close();
}
return true;
}
catch (Exception ex)
{
//return false;
throw new Exception("R Script failed: " + result, ex);
}
}
}
How can I represent the relationship in UML class diagram between controller and static class Rscript?
Is there a relationship between R scripts files and MVC should represented in UML?
Is there a relationship between R scripts files and MVC-- The R scripts are part of the Model.