示例#1
0
        override protected void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            try
            {
                AddExecutionToExecutionManager(dsfDataObject, resource);

                WorkflowExecutionWatcher.HasAWorkflowBeenExecuted = true;

                Dev2Logger.Debug("Starting Execute", GlobalConstants.WarewolfDebug);

                var lastActivity = resource;

                ExecuteNode(dsfDataObject, update, ref resource, ref lastActivity);

                if (!dsfDataObject.StopExecution & dsfDataObject.ExecutionException is null)
                {
                    dsfDataObject.StateNotifier?.LogExecuteCompleteState(lastActivity);
                }
            }
            finally
            {
                dsfDataObject.StateNotifier?.Dispose();
                _executionManager?.CompleteExecution();
            }
        }
        override protected void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            var outerStateLogger = dsfDataObject.StateNotifier;

            IStateNotifier stateNotifier = null;

            try
            {
                dsfDataObject.Settings = new Dev2WorkflowSettingsTO
                {
                    EnableDetailedLogging = Config.Server.EnableDetailedLogging,
                    LoggerType            = LoggerType.JSON,
                    KeepLogsForDays       = 2,
                    CompressOldLogFiles   = true
                };
                if (dsfDataObject.Settings.EnableDetailedLogging)
                {
                    stateNotifier = LogManager.CreateStateNotifier(dsfDataObject);
                    dsfDataObject.StateNotifier = stateNotifier;
                }

                AddExecutionToExecutionManager(dsfDataObject, resource);

                WorkflowExecutionWatcher.HasAWorkflowBeenExecuted = true;

                Dev2Logger.Debug("Starting Execute", GlobalConstants.WarewolfDebug);
                stateNotifier?.LogPreExecuteState(resource);

                IDev2Activity next;
                IDev2Activity lastActivity;
                try
                {
                    lastActivity = resource;
                    next         = resource.Execute(dsfDataObject, update);
                    stateNotifier?.LogPostExecuteState(resource, next);
                }
                catch (Exception e)
                {
                    stateNotifier?.LogExecuteException(e, resource);
                    throw;
                }

                ExecuteNode(dsfDataObject, update, ref next, ref lastActivity);
            }
            finally
            {
                _executionManager?.CompleteExecution();

                stateNotifier?.Dispose();
                dsfDataObject.StateNotifier = outerStateLogger;
            }
        }