Esempio n. 1
0
        private OptimaJet.WorkflowServerParameter GetParams()
        {
            var p = new OptimaJet.WorkflowServerParameter();

            p.Url = ConfigurationManager.AppSettings["url"];
            p.CallbackApiUrl = ConfigurationManager.AppSettings["callbackurl"];
            p.CallbackGenScheme = bool.Parse(ConfigurationManager.AppSettings["callbackgenscheme"]);
            p.ApiKey = ConfigurationManager.AppSettings["apikey"];
            p.Provider = ConfigurationManager.AppSettings["dbprovider"];
            p.ConnectionString = ConfigurationManager.AppSettings["dbcs"];
            p.DBUrl = ConfigurationManager.AppSettings["dburl"];
            p.Database = ConfigurationManager.AppSettings["dbdatabase"];
            p.NoStartWorkflow = bool.Parse(ConfigurationManager.AppSettings["nostartworkflow"]);
            if(bool.Parse(ConfigurationManager.AppSettings["log"]))
                p.Log = Log;

            p.BackendFolder = ConfigurationManager.AppSettings["befolder"];
            return p;
        }
Esempio n. 2
0
        private OptimaJet.WorkflowServerParameter GetParams()
        {
            var p = new OptimaJet.WorkflowServerParameter();

            p.Url               = ConfigurationManager.AppSettings["url"];
            p.CallbackApiUrl    = ConfigurationManager.AppSettings["callbackurl"];
            p.CallbackGenScheme = bool.Parse(ConfigurationManager.AppSettings["callbackgenscheme"]);
            p.ApiKey            = ConfigurationManager.AppSettings["apikey"];
            p.Provider          = ConfigurationManager.AppSettings["dbprovider"];
            p.ConnectionString  = ConfigurationManager.AppSettings["dbcs"];
            p.DBUrl             = ConfigurationManager.AppSettings["dburl"];
            p.Database          = ConfigurationManager.AppSettings["dbdatabase"];
            p.NoStartWorkflow   = bool.Parse(ConfigurationManager.AppSettings["nostartworkflow"]);
            if (bool.Parse(ConfigurationManager.AppSettings["log"]))
            {
                p.Log = Log;
            }

            p.BackendFolder = ConfigurationManager.AppSettings["befolder"];
            return(p);
        }
Esempio n. 3
0
        protected override void OnStart(string[] args)
        {
            OptimaJet.WorkflowServerParameter wsparams = GetParams();
            RegisterWorkflowEngine();

            Log("WorkflowServer by OptimaJet 2015");
            Log("WorkflowEngine.NET: Init...");
            workflowserver = new OptimaJet.WorkflowServer(wsparams);

            if (!wsparams.NoStartWorkflow)
            {
                Log("WorkflowEngine.NET: Starting...");
                workflowserver.Start();
            }

            Log("HttpServer: Starting...");
            server = new HttpServer(wsparams.Url);
            Log(string.Format("Waiting for a connection on {0}...", wsparams.Url));

            listeners = OptimaJet.ServerHelper.SubscribeProcessing(server, workflowserver);
        }
Esempio n. 4
0
        private static OptimaJet.WorkflowServerParameter ParseWorkflowServerParameter(string[] args)
        {
            if (args.Length == 0)
                return null;

            var p = new OptimaJet.WorkflowServerParameter() {
                BackendFolder = _backendFolder
            };

            foreach(var arg in args)
            {
                var str = arg.Trim();

                var key = string.Empty;
                var value = string.Empty;
                int index = str.IndexOf('=');
                if (index < 0)
                    index = str.Length;

                key = str.Substring(1, index - 1);
                if (str.Length > index + 1)
                    value = str.Substring(index + 1, str.Length - (index+1));

                switch(key)
                {
                    case "url": p.Url = value; break;
                    case "callbackurl": p.CallbackApiUrl = value; break;
                    case "callbackgenscheme": p.CallbackGenScheme = true; break;
                    case "apikey": p.ApiKey = value; break;
                    case "dbprovider": p.Provider = value; break;
                    case "dbcs": p.ConnectionString = value; break;
                    case "dburl": p.DBUrl = value; break;
                    case "dbdatabase": p.Database = value; break;
                    case "nostartworkflow": p.NoStartWorkflow = true; break;
                    case "log": p.Log = Log; break;
                    case "befolder": p.BackendFolder = value; break;
                    default:
                        Console.WriteLine(string.Format("Unknown '{0}' parameter.", key));
                        return null;
                }
            }

            return p;
        }
Esempio n. 5
0
        private static OptimaJet.WorkflowServerParameter ParseWorkflowServerParameter(string[] args)
        {
            if (args.Length == 0)
            {
                return(null);
            }

            var p = new OptimaJet.WorkflowServerParameter()
            {
                BackendFolder = _backendFolder
            };

            foreach (var arg in args)
            {
                var str = arg.Trim();

                var key   = string.Empty;
                var value = string.Empty;
                int index = str.IndexOf('=');
                if (index < 0)
                {
                    index = str.Length;
                }

                key = str.Substring(1, index - 1);
                if (str.Length > index + 1)
                {
                    value = str.Substring(index + 1, str.Length - (index + 1));
                }

                switch (key)
                {
                case "url": p.Url = value; break;

                case "callbackurl": p.CallbackApiUrl = value; break;

                case "callbackgenscheme": p.CallbackGenScheme = true; break;

                case "apikey": p.ApiKey = value; break;

                case "dbprovider": p.Provider = value; break;

                case "dbcs": p.ConnectionString = value; break;

                case "dburl": p.DBUrl = value; break;

                case "dbdatabase": p.Database = value; break;

                case "nostartworkflow": p.NoStartWorkflow = true; break;

                case "log": p.Log = Log; break;

                case "befolder": p.BackendFolder = value; break;

                default:
                    Console.WriteLine(string.Format("Unknown '{0}' parameter.", key));
                    return(null);
                }
            }

            return(p);
        }