protected BooDSLProcessPackage LoadPackage(string name, bool validate)
 {
     string pth = Path.Combine(BaseDirectory, name);
     log.Info("Loading package {0} from {1}", name, pth); 
     if (!Directory.Exists(pth)) throw new DirectoryNotFoundException(pth);
     var p = new BooDSLProcessPackage
     {
         BaseDirectory = pth
     };
     var pn = p.ProcessNames.FirstOrDefault();
     if (validate && !string.IsNullOrEmpty(pn))
     {
         p.GetProcessDefinition(pn);
     }
     return p;
 }
Beispiel #2
0
        protected BooDSLProcessPackage LoadPackage(string name, bool validate)
        {
            string pth = Path.Combine(BaseDirectory, name);

            log.Info("Loading package {0} from {1}", name, pth);
            if (!Directory.Exists(pth))
            {
                throw new DirectoryNotFoundException(pth);
            }
            var p = new BooDSLProcessPackage
            {
                BaseDirectory = pth
            };
            var pn = p.ProcessNames.FirstOrDefault();

            if (validate && !string.IsNullOrEmpty(pn))
            {
                p.GetProcessDefinition(pn);
            }
            return(p);
        }
Beispiel #3
0
        public static void TestProcessDsl()
        {
            string bd = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\ProcessPackages");
            BooDSLProcessPackage pkg = new BooDSLProcessPackage
            {
                BaseDirectory = Path.Combine(bd, "Test2")
            };
            foreach (string s in pkg.ProcessNames)
            {
                Console.WriteLine("Loading Process: {0}", s);

                var pd = pkg.GetProcessDefinition(s);
                List<string> problems = new List<string>();
                pd.Validate(problems);
                Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(pd));
                foreach (var vd in pd.Body.Variables)
                {
                    
                }
            }

        }