Beispiel #1
0
        private AssemblyData GetAssemblyDataByWorkflowID(string codeactivityid)
        {
            AssemblyData assemblySelected = null;

            foreach (AssemblyData assemblyData in assemblyList)
            {
                if (assemblyData.codeActivityList != null)
                {
                    foreach (CodeActivityData codeActivity in assemblyData.codeActivityList)
                    {
                        if (codeActivity.codeActivityid.Equals(codeactivityid))
                        {
                            assemblySelected = assemblyData;
                            break;
                        }
                    }
                    if (assemblySelected != null)
                    {
                        break;
                    }
                }
            }

            return(assemblySelected);
        }
Beispiel #2
0
        private void TxtCodeActivity_Click(object sender, EventArgs e)
        {
            if (assemblyList == null)
            {
                return;
            }

            LinkLabel        lblCodeActivity      = sender as LinkLabel;
            string           codeactivityid       = lblCodeActivity.Name.Substring(3);
            AssemblyData     assemblySelected     = GetAssemblyDataByWorkflowID(codeactivityid);
            CodeActivityData codeactivitySelected = GetCodeActivityDataByID(codeactivityid);

            ShowCodeActivityInfo(codeactivitySelected);
        }
Beispiel #3
0
        private AssemblyData GetAssemblyDataByName(string name)
        {
            AssemblyData assemblyData_finded = null;

            foreach (AssemblyData assemblyData in assemblyList)
            {
                if (assemblyData.Name.Equals(name))
                {
                    assemblyData_finded = assemblyData;
                    break;
                }
            }

            return(assemblyData_finded);
        }
Beispiel #4
0
        private void LinkAssemblyLabel_Click(object sender, EventArgs e)
        {
            String outputMessage = string.Empty;

            LinkLabel linkLabel = sender as LinkLabel;

            int indexPosition = linkLabel.Name.IndexOf("_");

            int selectedIndex = Convert.ToInt32(linkLabel.Name.Substring(indexPosition + 1));

            AssemblyData assemblySelected = null;

            foreach (AssemblyData entityData in assemblyList)
            {
                if (selectedIndex == entityData.Index)
                {
                    assemblySelected = entityData;
                    break;
                }
            }

            if (assemblySelected == null)
            {
                outputMessage = "The selected assembly does not exist";
                txtSearchCodeActivity.Text    = string.Empty;
                txtSearchCodeActivity.Enabled = false;
            }
            else
            {
                txtSearchCodeActivity.Enabled = true;
                txtSearchCodeActivity.Text    = string.Empty;
                try
                {
                    if (assemblySelected.codeActivityList == null)
                    {
                        outputMessage = "Assembly with no code activities";
                    }
                    else
                    {
                        assemblySelected.IsExpanded = !assemblySelected.IsExpanded;
                        ShowAssemblies(VISIBILITY_TYPES.SOME);
                    }
                }
                catch (Exception ex)
                {
                    outputMessage = "Error: " + ex.Message;
                }
            }

            if (!string.IsNullOrWhiteSpace(outputMessage))
            {
                MessageBox.Show(outputMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                /*PopupWindow popup = new PopupWindow();
                 * popup.TxtContent.Text = outputMessage;
                 * popup.Location = listWorkflows.Location;
                 *
                 * popup.ShowDialog();
                 *
                 * popup.Dispose();*/
            }
        }
Beispiel #5
0
        private void FillAssemblies()
        {
            if (assemblyList == null)
            {
                assemblyList = new List <AssemblyData>();
            }
            else
            {
                assemblyList.Clear();
            }

            String consultaFetch = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                          <entity name='plugintype'>
                                            <attribute name='plugintypeid' />
                                            <attribute name='name' />
                                            <attribute name='typename' />
                                            <attribute name='createdon' />
                                            <attribute name='modifiedon' />
                                            <attribute name='createdby' />
                                            <attribute name='modifiedby' />
                                            <attribute name='version' />
                                            <attribute name='pluginassemblyid' />
                                            <attribute name='customworkflowactivityinfo' />
                                            <attribute name='assemblyname' />
                                            <order attribute='assemblyname' descending='true' />
                                            <filter type='and'>
                                              <condition attribute='isworkflowactivity' operator='eq' value='1' />
                                            </filter>
                                            <link-entity name='pluginassembly' from='pluginassemblyid' to='pluginassemblyid' link-type='inner' alias='al'>
                                              <filter type='and'>
                                                <condition attribute='sourcetype' operator='eq' value='0' />
                                              </filter>
                                            </link-entity>
                                          </entity>
                                        </fetch>
                                        ";

            EntityCollection resultado = service.RetrieveMultiple(new FetchExpression(consultaFetch));

            if (resultado != null)
            {
                foreach (Entity entidad in resultado.Entities)
                {
                    if (entidad.Contains("assemblyname") && entidad.Attributes["assemblyname"] != null)
                    {
                        string pluginassemblyid = entidad.Attributes["pluginassemblyid"].ToString();
                        string assemblyname     = entidad.Attributes["assemblyname"].ToString();

                        CodeActivityData codeActivity = new CodeActivityData();

                        codeActivity.codeActivityid = entidad.Attributes["plugintypeid"].ToString().ToLower();
                        codeActivity.name           = entidad.Attributes["name"].ToString();
                        codeActivity.typename       = entidad.Attributes["typename"].ToString();
                        codeActivity.createdon      = (DateTime)entidad.Attributes["createdon"];
                        codeActivity.modifiedon     = (DateTime)entidad.Attributes["modifiedon"];
                        codeActivity.createdby      = ((EntityReference)entidad.Attributes["createdby"]).Name;
                        codeActivity.modifiedby     = ((EntityReference)entidad.Attributes["modifiedby"]).Name;
                        codeActivity.version        = entidad.Attributes["version"].ToString();

                        if (entidad.Attributes.Contains("customworkflowactivityinfo") && entidad.Attributes["customworkflowactivityinfo"] != null)
                        {
                            codeActivity.customworkflowactivityinfo = entidad.Attributes["customworkflowactivityinfo"].ToString();
                        }

                        AssemblyData assemblyData_finded = GetAssemblyDataByName(assemblyname);

                        if (assemblyData_finded == null)
                        {
                            AssemblyData assemblyData_new = new AssemblyData(-1, assemblyname, pluginassemblyid);
                            assemblyData_new.codeActivityList = new List <CodeActivityData>();
                            assemblyData_new.codeActivityList.Add(codeActivity);
                            assemblyList.Add(assemblyData_new);
                        }
                        else
                        {
                            assemblyData_finded.codeActivityList.Add(codeActivity);
                        }
                    }
                }

                // Ordenar las entidades por nombre
                GFG gg = new GFG();
                assemblyList.Sort(gg);
            }
        }