/// <summary>
        /// Updates the Plugin-Plugin Dependency Graph
        /// </summary>
        private void UpdateDependencyGraph(PluginId destinationPluginId, PluginDataId dataId)
        {
            if (!_createdBy.ContainsKey(dataId))
            {
                throw new WorkflowEngineException("Cannot resolve data dependency");
            }
            var sourcePlugin = _createdBy[dataId];

            // Add edge only if it doesn't exist
            if (!_graph.TryGetEdge(sourcePlugin, destinationPluginId, out SEdge <PluginId> existingEdge))
            {
                _graph.AddVerticesAndEdge(new SEdge <PluginId>(sourcePlugin, destinationPluginId));
            }
        }
Beispiel #2
0
 public PluginContext GetPluginContextFromId(PluginId id)
 {
     return(_pluginContexts[id]);
 }
 private void UpdateDataConsumer(PluginId pluginId, PluginDataId dataId)
 {
     _consumes.SafeAdd(pluginId, dataId);
     UpdateDependencyGraph(pluginId, dataId);
 }
        public IEnumerable <PluginId> GetPluginDependencies(PluginId pluginId)
        {
            _graph.TryGetInEdges(pluginId, out IEnumerable <SEdge <PluginId> > inEdges);

            return(inEdges?.Select(edge => edge.Source));
        }
 public bool PluginHasExecuted(PluginId pluginId)
 {
     return(_executedPlugins.Contains(pluginId));
 }
 public void UpdateExecutedPlugins(PluginId pluginId)
 {
     _executedPlugins.Add(pluginId);
 }