Exemple #1
0
        //private static void RemoveResults()
        //{
        //    //find root element
        //    var xRoot = DBFactory.GetData().Read(Constants._TYPE, "Root");
        //    var resultId = xRoot.GetAttributeValue(Constants.RESULT);
        //    var results = DBFactory.GetData().GetChildren(resultId);
        //    foreach (var kids in results.Descendants())
        //    {
        //        DBFactory.GetData().Delete(kids.GetAttributeValue(Constants._ID));
        //    }
        //}
        //private static void CleanProject()
        //{
        //    //find root element
        //    var xRoot = DBFactory.GetData().Read(Constants._TYPE, "Root");
        //    var root = DBFactory.GetData().GetChildren(xRoot.GetAttributeValue(Constants._ID));
        //    foreach (var kid in root.Descendants())
        //    {
        //        var id = kid.GetAttributeValue(Constants._ID);
        //        if (id.Equals(xRoot.GetAttributeValue(Constants._ID)))
        //            continue;
        //        foreach (var grandKid in DBFactory.GetData().GetChildren(id).Descendants())
        //        {
        //            DBFactory.GetData().Delete(grandKid.GetAttributeValue(Constants._ID));
        //        }
        //    }
        //}
        private static void TestWorkflow()
        {
            var auto = new AutoClient();
            var workflowInstance = new WorkflowInstance(Guid.NewGuid().ToString(),
                "7fdcbd7a-b30e-4c36-aa46-58ba74b02401", Configuration.Clone().GetList());
            var xCommand = workflowInstance.GetCommand();

            Console.WriteLine(xCommand.ToString());
            var xResult = auto.Execute(xCommand);
            Console.WriteLine(xResult);
            workflowInstance.SetResult(xResult);
        }