Skip to main content
added 3 characters in body; edited tags
Source Link
Thomas Owens
  • 85.9k
  • 18
  • 211
  • 311
  1. How to represent the relationship in UML class diagram between controller and static class Rscript?

    How can I represent the relationship in UML class diagram between controller and static class Rscript?

  2. Is there a relationship between R scripts files and MVC should represented in UML?

2.Is there a relationship between R scripts files and MVC should represented in UML ?

  1. How to represent the relationship in UML class diagram between controller and static class Rscript?

2.Is there a relationship between R scripts files and MVC should represented in UML ?

  1. How can I represent the relationship in UML class diagram between controller and static class Rscript?

  2. Is there a relationship between R scripts files and MVC should represented in UML?

Source Link

UML class diagram for MVC project that run R project

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);

            }
        }
    }
  1. How to represent the relationship in UML class diagram between controller and static class Rscript?

2.Is there a relationship between R scripts files and MVC should represented in UML ?