Ejemplo n.º 1
0
        static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            if (resource == null)
            {
                return;
            }
            var next = resource.Execute(dsfDataObject, update);

            while (next != null)
            {
                if (!dsfDataObject.StopExecution)
                {
                    next = next.Execute(dsfDataObject, update);
                    if (dsfDataObject.Environment.Errors.Count > 0)
                    {
                        foreach (var e in dsfDataObject.Environment.Errors)
                        {
                            dsfDataObject.Environment.AllErrors.Add(e);
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            if (resource == null)
            {
                throw new InvalidOperationException(GlobalConstants.NoStartNodeError);
            }
            WorkflowExecutionWatcher.HasAWorkflowBeenExecuted = true;
            var next = resource.Execute(dsfDataObject, update);

            while (next != null)
            {
                if (!dsfDataObject.StopExecution)
                {
                    next = next.Execute(dsfDataObject, update);
                    if (dsfDataObject.Environment.Errors.Count > 0)
                    {
                        foreach (var e in dsfDataObject.Environment.Errors)
                        {
                            dsfDataObject.Environment.AllErrors.Add(e);
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 private static IDev2Activity ExecuteTool(IDSFDataObject dsfDataObject, IDev2Activity activity, int update)
 {
     if (activity is IStateNotifierRequired stateNotifierRequired)
     {
         stateNotifierRequired.SetStateNotifier(dsfDataObject.StateNotifier);
     }
     return(activity.Execute(dsfDataObject, update));
 }
Ejemplo n.º 4
0
        public IDev2Activity ExecuteToolWithAsserts(IDSFDataObject dataObject, int update)
        {
            var dev2Activity = _originalActivity.Execute(dataObject, update);

            foreach (var debugOutput in _testOutputs)
            {
                //to do assertion here
            }
            return(dev2Activity);
        }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
        static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            if (resource == null)
            {
                return;
            }
            var next = resource.Execute(dsfDataObject, update);

            while (next != null)
            {
                next = next.Execute(dsfDataObject, update);
            }
        }
Ejemplo n.º 7
0
        private void ExecuteActivity(IDSFDataObject dataObject, int update, ObservableCollection <IServiceTestStep> serviceTestSteps, Activity dsfActivity, IDev2Activity act)
        {
            act.Execute(dataObject, update);
            if (dataObject.IsServiceTestExecution)
            {
                var contentId = Guid.Parse(act.UniqueID);
                if (dsfActivity.GetType().Name == "DsfActivity" && dsfActivity is DsfActivity newAct)
                {
                    contentId = newAct.GetWorkSurfaceMappingId();
                }

                UpdateDebugStateWithAssertions(dataObject, serviceTestSteps?.ToList(), contentId);
            }
        }
Ejemplo n.º 8
0
 static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
 {
     try
     {
         var exe = CustomContainer.Get <IExecutionManager>();
         Dev2Logger.Debug("Got Execution Manager", GlobalConstants.WarewolfDebug);
         if (exe != null)
         {
             if (!exe.IsRefreshing || dsfDataObject.IsSubExecution)
             {
                 Dev2Logger.Debug("Adding Execution to Execution Manager", GlobalConstants.WarewolfDebug);
                 exe.AddExecution();
                 Dev2Logger.Debug("Added Execution to Execution Manager", GlobalConstants.WarewolfDebug);
             }
             else
             {
                 Dev2Logger.Debug("Waiting", GlobalConstants.WarewolfDebug);
                 exe.Wait();
                 Dev2Logger.Debug("Continued Execution", GlobalConstants.WarewolfDebug);
             }
         }
         if (resource == null)
         {
             throw new InvalidOperationException(GlobalConstants.NoStartNodeError);
         }
         WorkflowExecutionWatcher.HasAWorkflowBeenExecuted = true;
         Dev2Logger.Debug("Starting Execute", GlobalConstants.WarewolfDebug);
         var next = resource.Execute(dsfDataObject, update);
         Dev2Logger.Debug("Executed first node", GlobalConstants.WarewolfDebug);
         while (next != null)
         {
             if (!dsfDataObject.StopExecution)
             {
                 next = next.Execute(dsfDataObject, update);
                 dsfDataObject.Environment.AllErrors.UnionWith(dsfDataObject.Environment?.Errors);
             }
             else
             {
                 next = null;
             }
         }
     }
     finally
     {
         var exe = CustomContainer.Get <IExecutionManager>();
         exe?.CompleteExecution();
     }
 }
Ejemplo n.º 9
0
        static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource, int update)
        {
            bool stoppedExecution = false;
            var  outerStateLogger = dsfDataObject.StateNotifier;

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

                var exe = CustomContainer.Get <IExecutionManager>();
                Dev2Logger.Debug("Got Execution Manager", GlobalConstants.WarewolfDebug);
                if (exe != null)
                {
                    if (!exe.IsRefreshing || dsfDataObject.IsSubExecution)
                    {
                        Dev2Logger.Debug("Adding Execution to Execution Manager", GlobalConstants.WarewolfDebug);
                        exe.AddExecution();
                        Dev2Logger.Debug("Added Execution to Execution Manager", GlobalConstants.WarewolfDebug);
                    }
                    else
                    {
                        Dev2Logger.Debug("Waiting", GlobalConstants.WarewolfDebug);
                        exe.Wait();
                        Dev2Logger.Debug("Continued Execution", GlobalConstants.WarewolfDebug);
                    }
                }
                if (resource == null)
                {
                    throw new InvalidOperationException(GlobalConstants.NoStartNodeError);
                }

                WorkflowExecutionWatcher.HasAWorkflowBeenExecuted = true;

                // TODO: if we wanted to skip to a particular part of the execution we need to
                //       arrange for "resource" to be set to the correct activity and load the
                //       old environment
                Dev2Logger.Debug("Starting Execute", GlobalConstants.WarewolfDebug);
                dsfDataObject.StateNotifier.LogPreExecuteState(resource);

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

                Dev2Logger.Debug("Executed first node", GlobalConstants.WarewolfDebug);
                while (next != null)
                {
                    if (dsfDataObject.StopExecution)
                    {
                        stoppedExecution = true;
                        break;
                    }

                    dsfDataObject.StateNotifier.LogPreExecuteState(next);
                    var current = next;
                    lastActivity = current;
                    try
                    {
                        next = current.Execute(dsfDataObject, update);
                        dsfDataObject.StateNotifier.LogPostExecuteState(current, next);
                    }
                    catch (Exception e)
                    {
                        dsfDataObject.StateNotifier.LogExecuteException(e, current);
                        throw;
                    }
                    dsfDataObject.Environment.AllErrors.UnionWith(dsfDataObject.Environment?.Errors);
                }

                if (!stoppedExecution)
                {
                    dsfDataObject.StateNotifier.LogExecuteCompleteState(lastActivity);
                }
                else
                {
                    dsfDataObject.StateNotifier.LogStopExecutionState(lastActivity);
                }
            }
            catch (Exception e)
            {
                throw;
            }
            finally
            {
                var exe = CustomContainer.Get <IExecutionManager>();
                exe?.CompleteExecution();

                dsfDataObject.StateNotifier?.Dispose();
                dsfDataObject.StateNotifier = null;
                if (outerStateLogger != null)
                {
                    dsfDataObject.StateNotifier = outerStateLogger;
                }
            }
        }
Ejemplo n.º 10
0
        public void Eval(Guid resourceID, IDSFDataObject dataObject)
        {
            IDev2Activity resource = ResourceCatalog.Instance.Parse(TheWorkspace.ID, resourceID);

            resource.Execute(dataObject);
        }
Ejemplo n.º 11
0
 static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource,int update)
 {
     if(resource == null)
     {
         return;
     }
     var next = resource.Execute(dsfDataObject, update);
     while(next != null)
     {
         if (!dsfDataObject.StopExecution)
         {
             next = next.Execute(dsfDataObject, update);
             if(dsfDataObject.Environment.Errors.Count>0)
             {
                 foreach(var e in dsfDataObject.Environment.Errors)
                 {
                     dsfDataObject.Environment.AllErrors.Add(e);
                 }
                
             }
         }
         else
         {
             break;
         }
     }
 }
Ejemplo n.º 12
0
 private static void ExecuteActivity(IDSFDataObject dataObject, int update, IDev2Activity act)
 {
     act.Execute(dataObject, update);
 }
 static void EvalInner(IDSFDataObject dsfDataObject, IDev2Activity resource,int update)
 {
     if(resource == null)
     {
         return;
     }
     var next = resource.Execute(dsfDataObject, update);
     while(next != null)
     {
         next = next.Execute(dsfDataObject, update);
     }
 }