Example #1
0
        private ConvertedFlow[] ProcessModels(AbstractOrchestrationProject aop)
        {
            Report("Preparing to process models");
            flowsForProject.Clear();
            projectName = aop.ProjectSetupData.Name;


            foreach (Model m in aop.ProjectSetupData.Models)
            {
                Report("Creating Decisions Flow Named: {0}.{1}", aop.ProjectSetupData.Name, m.ModelName);
                ConvertedFlow newFlow = new ConvertedFlow();
                newFlow.FlowName = m.ModelName;
                newFlow.FlowId   = m.ModelID;

                if (string.IsNullOrEmpty(m.ParentModelName))
                {
                    newFlow.Tags = new string[] { "Root" };
                }

                else
                {
                    newFlow.Tags = new string[] { m.ParentModelName };
                }

                MODEL_NAME_TO_ID_MAP[m.ModelName] = m.ModelID;

                // Setup the flow input data according to the
                // LogicBase model input data
                IComponentModel myModel = aop.GetComponentModel(m);
                SetupInputDataForFlow(myModel.InputData, newFlow);

                ProcessComponentsFromModelToFlow(myModel, newFlow, aop.ProjectSetupData.Name, m.ModelName, flowsForProject);

                Report("Flow Complete.");

                AddFlowToList(newFlow);
            }
            return(flowsForProject.ToArray());
        }
Example #2
0
        private AbstractOrchestrationProject LoadWorkflowProject()
        {
            if (!librariesInitialized)
            {
                InitLibs();
                librariesInitialized = true;
            }

            try
            {
                LogicBase.Core.Utilities.DesignMode.IsInDesignMode = true;
                AbstractOrchestrationProject aop =
                    AbstractOrchestrationProject.OpenProject(new FileInfo(textBox1.Text));
                Report("Loaded abstract orchestration project.");
                return(aop);
            } catch (Exception ex)
            {
                Report("An exception prevented the project from being loaded");
                Report(ex.ToString());
                throw ex;
            }
        }
Example #3
0
        private void ConvertButtonClicked(object sender, EventArgs e)
        {
            allForms.Clear();

            // Begin Conversion
            richTextBox1.Clear();

            Report("Starting Conversion");
            Report("Loading Workflow Project");

            try
            {
                AbstractOrchestrationProject pd = LoadWorkflowProject();

                Report("Project Loaded");

                ConvertedFlow[] results = ProcessModels(pd);

                Report("Done Processing Models");

                convertedProject             = new ConvertedProject();
                convertedProject.ProjectName = pd.ProjectSetupData.Name;
                convertedProject.Flows       = results;

                convertedProject.Forms = allForms.ToArray();

                // Upload converted project.
            }
            catch (Exception ex)
            {
                Report("The following exception has aborted conversion: {0}", ex.Message);
            }

            File.WriteAllLines("AllStepsCount.txt",
                               dictAllStepsCount.Select(x => string.Format("{0},{1}", x.Key, x.Value)).ToArray());

            Report("Work Complete.");
        }