Example #1
0
        private void Run(string[] args)
        {
            ReadConfiguration();
            ParseCommandLine(args);
            SetProxy();


            if (!Directory.Exists("results"))
            {
                Directory.CreateDirectory("results");
            }
            results = @"results\" + DateTime.Now.ToShortDateString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", "-");
            output  = File.Create(results + ".txt");
            output.Close();

            //if (finished == 0) DeleteFiles();

            LogWrite("Connecting to " + ConfigurationManager.AppSettings["ServerName"] + "...");

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
            var tokenBroker = new TokenBrokerClient(new BasicHttpBinding("TokenBrokerBinding"), new EndpointAddress(_tokenBrokerEndpoint));
            var token       = tokenBroker.GetToken("facadeuser", "Yt1NyDpQNm");

            var user    = WorkflowApi.ParseToken(token);
            var storage = new DStorage(_dataServiceEndpoint, user.UserId, SecId);

            _api = new WorkflowApi(storage, _facadeEndpoint, token);

            //Statuses.Add("e6352bf7-d5b2-4617-98a7-0481e5404aa1","Active");
            //CopyRows(new string[]{"ForecastSize"});
            //return;
            mode = 1;
            //Experiment1(mode);
            //Experiment2();
            Experiment3();
            //Experiment3PushBsm();
            //Experiment4(mode);
            //Experiment5(mode);
            //Experiment6();
            Console.ReadLine();
        }
Example #2
0
        public static void RunExample(Configuration confgiration)
        {
            string location = "http://location-testing";

            WorkflowEvent workflow = new WorkflowEvent("cycle_count_finished", location, DateTime.Now, null, 10, new List <string>()
            {
                "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"
            });

            try
            {
                // capture
                WorkflowApi workflowApi = new WorkflowApi(confgiration);
                Console.WriteLine("------------- Capture workflow event");
                workflowApi.CaptureWorkflowEvent(workflow);
                Console.WriteLine("captured workflow events");
            }
            catch (ApiException e)
            {
                Console.WriteLine(e);
            }

            Console.ReadKey();
        }
Example #3
0
        private void Run(string[] args)
        {
            ReadConfiguration();
            ParseCommandLine(args);
            SetProxy();

            if (!Directory.Exists("results")) Directory.CreateDirectory("results");
            results = @"results\" + DateTime.Now.ToShortDateString() + "_" + DateTime.Now.ToShortTimeString().Replace(":", "-");
            output = File.Create(results+".txt");
            output.Close();

            //if (finished == 0) DeleteFiles();

            LogWrite("Connecting to " + ConfigurationManager.AppSettings["ServerName"] + "...");

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
            var tokenBroker = new TokenBrokerClient(new BasicHttpBinding("TokenBrokerBinding"), new EndpointAddress(_tokenBrokerEndpoint));
            var token = tokenBroker.GetToken("facadeuser", "Yt1NyDpQNm");

            var user = WorkflowApi.ParseToken(token);
            var storage = new DStorage(_dataServiceEndpoint, user.UserId, SecId);

            _api = new WorkflowApi(storage, _facadeEndpoint, token);

            //Statuses.Add("e6352bf7-d5b2-4617-98a7-0481e5404aa1","Active");
            //CopyRows(new string[]{"ForecastSize"});
            //return;
            mode = 1;
            //Experiment1(mode);
            //Experiment2();
            Experiment3();
            //Experiment3PushBsm();
            //Experiment4(mode);
            //Experiment5(mode);
            //Experiment6();
            Console.ReadLine();
        }