Exemplo n.º 1
0
        /// <summary>
        /// parse a <code>&lt;job-acquisition .../&gt;</code> element and add it to the
        /// list of parsed elements
        /// </summary>
        protected internal virtual void parseJobAcquisition(Element element, IList <JobAcquisitionXml> jobAcquisitions)
        {
            JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();

            // set name
            jobAcquisition.Name = element.attribute(NAME);

            IDictionary <string, string> properties = new Dictionary <string, string>();

            foreach (Element childElement in element.elements())
            {
                if (JOB_EXECUTOR_CLASS_NAME.Equals(childElement.TagName))
                {
                    jobAcquisition.JobExecutorClassName = childElement.Text;
                }
                else if (PROPERTIES.Equals(childElement.TagName))
                {
                    parseProperties(childElement, properties);
                }
            }

            // set collected properties
            jobAcquisition.Properties = properties;
            // add to list
            jobAcquisitions.Add(jobAcquisition);
        }
Exemplo n.º 2
0
        /// <summary>
        /// parse a <code>&lt;process-engine .../&gt;</code> element and add it to the list of parsed elements
        /// </summary>
        protected internal virtual void parseProcessEngine(Element element, IList <ProcessEngineXml> parsedProcessEngines)
        {
            ProcessEngineXmlImpl processEngine = new ProcessEngineXmlImpl();

            // set name
            processEngine.Name = element.attribute(NAME);

            // set default
            string defaultValue = element.attribute(DEFAULT);

            if (string.ReferenceEquals(defaultValue, null) || defaultValue.Length == 0)
            {
                processEngine.Default = false;
            }
            else
            {
                processEngine.Default = bool.Parse(defaultValue);
            }

            IDictionary <string, string>   properties = new Dictionary <string, string>();
            IList <ProcessEnginePluginXml> plugins    = new List <ProcessEnginePluginXml>();

            foreach (Element childElement in element.elements())
            {
                if (CONFIGURATION.Equals(childElement.TagName))
                {
                    processEngine.ConfigurationClass = childElement.Text;
                }
                else if (DATASOURCE.Equals(childElement.TagName))
                {
                    processEngine.Datasource = childElement.Text;
                }
                else if (JOB_ACQUISITION.Equals(childElement.TagName))
                {
                    processEngine.JobAcquisitionName = childElement.Text;
                }
                else if (PROPERTIES.Equals(childElement.TagName))
                {
                    parseProperties(childElement, properties);
                }
                else if (PLUGINS.Equals(childElement.TagName))
                {
                    parseProcessEnginePlugins(childElement, plugins);
                }
            }

            // set collected properties
            processEngine.Properties = properties;
            // set plugins
            processEngine.Plugins = plugins;
            // add the process engine to the list of parsed engines.
            parsedProcessEngines.Add(processEngine);
        }
Exemplo n.º 3
0
        /// <summary>
        /// parse a <code>&lt;job-executor .../&gt;</code> element and add it to the list of parsed elements
        /// </summary>
        protected internal virtual void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml)
        {
            IList <JobAcquisitionXml>    jobAcquisitions = new List <JobAcquisitionXml>();
            IDictionary <string, string> properties      = new Dictionary <string, string>();

            foreach (Element childElement in element.elements())
            {
                if (JOB_ACQUISITION.Equals(childElement.TagName))
                {
                    parseJobAcquisition(childElement, jobAcquisitions);
                }
                else if (PROPERTIES.Equals(childElement.TagName))
                {
                    parseProperties(childElement, properties);
                }
            }

            jobExecutorXml.JobAcquisitions = jobAcquisitions;
            jobExecutorXml.Properties      = properties;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Transform a <code>&lt;plugin ... /&gt;</code> structure.
        /// </summary>
        protected internal virtual void parseProcessEnginePlugin(Element element, IList <ProcessEnginePluginXml> plugins)
        {
            ProcessEnginePluginXmlImpl plugin = new ProcessEnginePluginXmlImpl();

            IDictionary <string, string> properties = new Dictionary <string, string>();

            foreach (Element childElement in element.elements())
            {
                if (PLUGIN_CLASS.Equals(childElement.TagName))
                {
                    plugin.PluginClass = childElement.Text;
                }
                else if (PROPERTIES.Equals(childElement.TagName))
                {
                    parseProperties(childElement, properties);
                }
            }

            plugin.Properties = properties;
            plugins.Add(plugin);
        }
Exemplo n.º 5
0
        /// <summary>
        /// parse a <code>&lt;process-archive .../&gt;</code> element and add it to the list of parsed elements
        /// </summary>
        protected internal virtual void parseProcessArchive(Element element, IList <ProcessArchiveXml> parsedProcessArchives)
        {
            ProcessArchiveXmlImpl processArchive = new ProcessArchiveXmlImpl();

            processArchive.Name     = element.attribute(NAME);
            processArchive.TenantId = element.attribute(TENANT_ID);

            IList <string> processResourceNames = new List <string>();

            IDictionary <string, string> properties = new Dictionary <string, string>();

            foreach (Element childElement in element.elements())
            {
                if (PROCESS_ENGINE.Equals(childElement.TagName))
                {
                    processArchive.ProcessEngineName = childElement.Text;
                }
                else if (PROCESS.Equals(childElement.TagName) || RESOURCE.Equals(childElement.TagName))
                {
                    processResourceNames.Add(childElement.Text);
                }
                else if (PROPERTIES.Equals(childElement.TagName))
                {
                    parseProperties(childElement, properties);
                }
            }

            // set properties
            processArchive.Properties = properties;

            // add collected resource names.
            processArchive.ProcessResourceNames = processResourceNames;

            // add process archive to list of parsed archives.
            parsedProcessArchives.Add(processArchive);
        }