Example #1
0
        protected internal virtual void addProcessEnginePlugins(JtaProcessEngineConfiguration processEngineConfiguration)
        {
            // add process engine plugins:
            IList <ProcessEnginePluginXml> pluginConfigurations = processEngineMetadata.PluginConfigurations;

            foreach (ProcessEnginePluginXml pluginXml in pluginConfigurations)
            {
                // create plugin instance
                ProcessEnginePlugin plugin = null;
                string pluginClassName     = pluginXml.PluginClass;
                try
                {
                    plugin = (ProcessEnginePlugin)createInstance(pluginClassName);
                }
                catch (System.InvalidCastException)
                {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                    throw new ProcessEngineException("Process engine plugin '" + pluginClassName + "' does not implement interface " + typeof(ProcessEnginePlugin).FullName + "'.");
                }

                // apply configured properties
                IDictionary <string, string> properties = pluginXml.Properties;
                PropertyHelper.applyProperties(plugin, properties);

                // add to configuration
                processEngineConfiguration.ProcessEnginePlugins.Add(plugin);
            }
        }
Example #2
0
        protected internal virtual void startProcessEngine()
        {
            processEngineConfiguration = createProcessEngineConfiguration();

            // set the name for the process engine
            processEngineConfiguration.ProcessEngineName = processEngineMetadata.EngineName;

            // set the value for the history
            processEngineConfiguration.History = processEngineMetadata.HistoryLevel;

            // use the injected datasource
            processEngineConfiguration.DataSource = (DataSource)datasourceBinderServiceInjector.Value.Reference.Instance;

            // use the injected transaction manager
            processEngineConfiguration.TransactionManager = transactionManagerInjector.Value;

            // set auto schema update
            if (processEngineMetadata.AutoSchemaUpdate)
            {
                processEngineConfiguration.DatabaseSchemaUpdate = ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE;
            }
            else
            {
                processEngineConfiguration.DatabaseSchemaUpdate = "off";
            }

            // set db table prefix
            if (!string.ReferenceEquals(processEngineMetadata.DbTablePrefix, null))
            {
                processEngineConfiguration.DatabaseTablePrefix = processEngineMetadata.DbTablePrefix;
            }

            // set job executor on process engine.
            MscRuntimeContainerJobExecutor mscRuntimeContainerJobExecutor = mscRuntimeContainerJobExecutorInjector.Value;

            processEngineConfiguration.JobExecutor = mscRuntimeContainerJobExecutor;

            PropertyHelper.applyProperties(processEngineConfiguration, processEngineMetadata.ConfigurationProperties);

            addProcessEnginePlugins(processEngineConfiguration);

            processEngine = processEngineConfiguration.buildProcessEngine();
        }