Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public org.camunda.bpm.engine.impl.history.HistoryLevel execute(final org.camunda.bpm.engine.impl.interceptor.CommandContext commandContext)
        public virtual HistoryLevel execute(CommandContext commandContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final System.Nullable<int> databaseHistoryLevel = org.camunda.bpm.engine.impl.HistoryLevelSetupCommand.databaseHistoryLevel(commandContext);
            int?databaseHistoryLevel = HistoryLevelSetupCommand.databaseHistoryLevel(commandContext);

            HistoryLevel result = null;

            if (databaseHistoryLevel != null)
            {
                foreach (HistoryLevel historyLevel in historyLevels)
                {
                    if (historyLevel.Id == databaseHistoryLevel)
                    {
                        result = historyLevel;
                        break;
                    }
                }

                if (result != null)
                {
                    return(result);
                }
                else
                {
                    // if a custom non-null value is not registered, throw an exception.
                    throw new ProcessEngineException(string.Format("The configured history level with id='{0}' is not registered in this config.", databaseHistoryLevel));
                }
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
            public object execute(CommandContext commandContext)
            {
                PersistenceSession persistenceSession = commandContext.getSession(typeof(PersistenceSession));

                persistenceSession.dbSchemaDrop();
                persistenceSession.dbSchemaCreate();
                HistoryLevelSetupCommand.dbCreateHistoryLevel(commandContext);
                return(null);
            }
Beispiel #3
0
            public object execute(CommandContext commandContext)
            {
                DbEntityManager dbEntityManager      = commandContext.DbEntityManager;
                PropertyEntity  historyLevelProperty = dbEntityManager.selectById(typeof(PropertyEntity), "historyLevel");

                if (historyLevelProperty != null)
                {
                    if (processEngineConfiguration.HistoryLevel.Id != new int?(historyLevelProperty.Value))
                    {
                        historyLevelProperty.Value = Convert.ToString(processEngineConfiguration.HistoryLevel.Id);
                        dbEntityManager.merge(historyLevelProperty);
                    }
                }
                else
                {
                    HistoryLevelSetupCommand.dbCreateHistoryLevel(commandContext);
                }
                return(null);
            }
Beispiel #4
0
 public int?execute(CommandContext commandContext)
 {
     return(HistoryLevelSetupCommand.databaseHistoryLevel(commandContext));
 }