public override StepInput[] GetProperties(IOrchestrationComponent component)
        {
            FieldInfo[] fields = component.GetType().GetFields(
                BindingFlags.NonPublic |
                BindingFlags.Instance);

            IComponentModel internalModel = (IComponentModel)fields.First(xx => xx.Name == "_embeddedModel").GetValue(component);

            string linkedFlowId = internalModel.Id;

            return(new StepInput[1] {
                new StepInput()
                {
                    Name = "EmbeddedFlowId", ConstantValue = linkedFlowId
                }
            });
        }
Exemplo n.º 2
0
        private StepInput[] ConvertInputDataDefault(IOrchestrationComponent component)
        {
            List <StepInput> allInputs = new List <StepInput>();

            try
            {
                PropertyInfo[] pi = component.GetType().GetProperties();
                foreach (PropertyInfo eachProperty in pi)
                {
                    if (eachProperty.PropertyType == typeof(VariableOrValueDataType))
                    {
                        allInputs.Add(VVDTUtility.ConvertVariableOrValueDataTypeToInputMapping((VariableOrValueDataType)eachProperty.GetValue(component), eachProperty.Name));
                    }
                }
            }
            catch (Exception ex) {
                Report("Exception occured reflecting properties");
            }
            return(allInputs.ToArray());
        }
Exemplo n.º 3
0
        private StepOutcome[] ConvertOutDataDefault(IOrchestrationComponent component)
        {
            List <StepOutcome> outcomes = new List <StepOutcome>();

            if (typeof(AbstractMultiPathProcessComponent).IsAssignableFrom(component.GetType()))
            {
                string[] paths = ((AbstractMultiPathProcessComponent)component).GetConnectionPaths();
                foreach (string path in paths)
                {
                    LogicBase.Core.Data.DataDefinition[] dataParts = null;
                    if (component is IMultiPathDataAdded)
                    {
                        dataParts = ((IMultiPathDataAdded)component).GetAddedData(path);
                    }
                    StepOutcome outcomeToAdd = new StepOutcome()
                    {
                        PathName = path
                    };
                    List <LogicBaseProjectConversionUtility.ProjectConversionService.DataDefinition> outcomeDefs
                        = new List <LogicBaseProjectConversionUtility.ProjectConversionService.DataDefinition>();
                    if (dataParts != null)
                    {
                        foreach (LogicBase.Core.Data.DataDefinition oldDef in dataParts)
                        {
                            outcomeDefs.Add(new LogicBaseProjectConversionUtility.ProjectConversionService.DataDefinition()
                            {
                                FullTypeName = oldDef.DataType.FullName,
                                IsList       = oldDef.IsArray,
                                Name         = oldDef.Name
                            });
                        }
                    }
                    outcomeToAdd.OutcomeData = outcomeDefs.ToArray();

                    outcomes.Add(outcomeToAdd);
                }
            }
            return(outcomes.ToArray());
        }
Exemplo n.º 4
0
        private ConvertedStep CreateFlowStepFromComponent(string projectName, IOrchestrationComponent component, string modelName)
        {
            Report("Transforming Component {0}", component.Name);

            if (component.GetType().FullName == typeof(FormBuilderComponent).FullName)
            {
                ConvertedForm form = FormBuilderConvertor.GetForm(component);

                if (string.IsNullOrEmpty(modelName))
                {
                    form.Tags = new string[] { "Root" };
                }

                else
                {
                    form.Tags = new string[] { modelName };
                }

                form.FormId = component.Id;

                // Add this form to the converted results that we are building.
                allForms.Add(form);

                // And now create the ConvertedStep to represent the form wrapper step on the
                // decisions side.
                ConvertedStep forWrapperStep = new ConvertedStep();
                forWrapperStep.StepName = component.Name;
                forWrapperStep.X        = (int)component.Location.X;
                forWrapperStep.Y        = (int)component.Location.Y;
                forWrapperStep.UniqueStepIdForConnections = component.Id;

                forWrapperStep.FullTypeName = "FormWrapperStep";

                return(forWrapperStep);
            }

            ConvertedStep result = new ConvertedStep();

            //build up dictionary of steps and count just so we can know how many are in this flow
            if (dictAllStepsCount.ContainsKey(component.GetType().Name))
            {
                dictAllStepsCount[component.GetType().Name] = dictAllStepsCount[component.GetType().Name] + 1;
            }
            else
            {
                dictAllStepsCount.Add(component.GetType().Name, 1);
            }

            List <string> baseTypeNamesToSkip = new List <string>();

            baseTypeNamesToSkip.Add("AbstractSQLSinglePathComponent");
            //baseTypeNamesToSkip.Add("AbstractSinglePathProcessComponent");
            //baseTypeNamesToSkip.Add("AbstractConnectionStringMultiPathComponent");

            List <string> typeNamesToSkip = new List <string>();

            typeNamesToSkip.Add("LogicBase.Components.Default.Process.MultiPathEmbeddedModelComponent");
            typeNamesToSkip.Add("LogicBase.Components.Default.IO.ReadFile");
            typeNamesToSkip.Add("LogicBase.Components.Default.IterateTextFileLines");
            typeNamesToSkip.Add("LogicBase.Components.Office2003.Word2003ModelComponent");
            typeNamesToSkip.Add("LogicBase.Components.Default.IO.CreateTextFile");
            typeNamesToSkip.Add("LogicBase.Components.Default.Process.SubtractValues");

            List <string> assembliesToSkip = new List <string>();

            assembliesToSkip.Add("Wrap Up 2 Integration.dll");
            assembliesToSkip.Add("Wrap Up Client Side Integration.dll");

            if (baseTypeNamesToSkip.Contains(component.GetType().BaseType.Name) || typeNamesToSkip.Contains(component.GetType().FullName) || assembliesToSkip.Contains(component.GetType().Assembly.ManifestModule.Name))
            {
                result.StepName = component.Name;
                result.UniqueStepIdForConnections = component.Id;
                result.InputData      = new StepInput[0];
                result.OutcomeData    = new StepOutcome[0];
                result.FullTypeName   = "No type";
                result.StepProperties = new StepInput[0];
                result.X = (int)component.Location.X;
                result.Y = (int)component.Location.Y;

                return(result);
            }

            result.UniqueStepIdForConnections = component.Id;

            result.FullTypeName = component.GetType().FullName;
            result.StepName     = component.Name;
            result.X            = (int)component.Location.X;
            result.Y            = (int)component.Location.Y;

            if (ConverterFor.ContainsKey(component.GetType()))
            {
                result.InputData      = ConverterFor[component.GetType()].GetInputs(component);
                result.StepProperties = ConverterFor[component.GetType()].GetProperties(component);
                result.OutcomeData    = ConverterFor[component.GetType()].GetOutcomes(component);
            }
            else
            {
                result.InputData      = ConvertInputDataDefault(component);
                result.StepProperties = ConvertStepPropertiesDefault(component);
                result.OutcomeData    = ConvertOutDataDefault(component);
                // Setup common properties
            }
            return(result);
        }