Ejemplo n.º 1
0
 public SSIS2008EmitterPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     _guid         = Guid.NewGuid();
     _message      = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString()));
     _pluginLoader = new PluginLoader <ISSISEmitter, PhysicalIRMappingAttribute>(null, 1, 1);
 }
Ejemplo n.º 2
0
        public PhaseWorkflow(string Name)
        {
            this._Name          = Name;
            this._PhaseWorkflow = new List <PhaseExecutionHost>();
            this._PhaseExecutionHostsByWorkflowUniqueName  = new Dictionary <string, PhaseExecutionHost>();
            this._PhaseExecutionStatusByWorkflowUniqueName = new Dictionary <string, bool>();

            this.Message = MessageEngine.Create(String.Format("__PHASE WORKFLOW: {0}", Name));
        }
Ejemplo n.º 3
0
        public SsisPipelineTask(PipelineTask objETL, SSISEmitterContext context)
            : base(objETL, context)
        {
            _logicalETL = objETL;

            _guid = Guid.NewGuid();
            // TODO: Do this for everything
            _message       = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "__SSIS2008Emitter:SSISDataFlow {0}", _guid.ToString()));
            _componentList = new List <SsisComponent>();
        }
Ejemplo n.º 4
0
 internal SSISEmitterContext(SsisPackage package, SsisSequence parentSequence, PluginLoader <ISSISEmitter, PhysicalIRMappingAttribute> pluginLoader)
 {
     _package      = package;
     _ssisSequence = parentSequence;
     _guid         = Guid.NewGuid();
     _message      = MessageEngine.Create(String.Format(System.Globalization.CultureInfo.InvariantCulture, "SSISFactory: {0}", _guid.ToString()));
     if (_ssisSequence != null)
     {
         _parentContainer = _ssisSequence.DTSSequence;
     }
     _pluginLoader = pluginLoader;
 }
Ejemplo n.º 5
0
        public PhaseExecutionHost(string WorkflowUniqueName, IPhase HostedPhase)
        {
            this._WorkflowUniqueName = WorkflowUniqueName;
            this._HostedPhase        = HostedPhase;
            this._Predecessors       = new List <PhaseExecutionHost>();
            this._Successors         = new List <PhaseExecutionHost>();
            this._PredecessorIRs     = new Dictionary <PhaseExecutionHost, IIR>();

            this.ExecutionStarted  = false;
            this.ExecutionComplete = false;

            this.Message = MessageEngine.Create(String.Format("__PHASE EXECUTION HOST: {0}", WorkflowUniqueName));
        }
Ejemplo n.º 6
0
        public override bool Execute()
        {
            MessageEngine.Reset();
            MessageEngine Message = MessageEngine.Create("__VULCAN MAIN");

            Message.Trace(Severity.Notification, Resources.VulcanStart + Assembly.GetExecutingAssembly().GetName().Version);

#if DEBUG
            Message.Trace(Severity.Notification, "DEBUG VERSION");
#endif

            PhaseWorkflowLoader WorkflowLoader = new PhaseWorkflowLoader();
            PhaseWorkflow       Workflow       = WorkflowLoader.PhaseWorkflowsByName[WorkflowLoader.DefaultWorkflowName];
            PathManager.TargetPath = Path.GetFullPath(OutputPath) + Path.DirectorySeparatorChar;

            XmlIR xmlIR = new XmlIR();

            foreach (ITaskItem item in Sources)
            {
                string filename = item.ItemSpec;
                if (File.Exists(filename))
                {
                    xmlIR.AddXml(Path.GetFullPath(filename), XmlIRDocumentType.SOURCE);
                }
                else
                {
                    Message.Trace(Severity.Error, new FileNotFoundException("Vulcan File Not Found", filename), Resources.VulcanFileNotFound, filename);
                }
            }

            foreach (ITaskItem item in Includes)
            {
                string filename = item.ItemSpec;
                if (File.Exists(filename))
                {
                    xmlIR.AddXml(Path.GetFullPath(filename), XmlIRDocumentType.INCLUDE);
                }
                else
                {
                    Message.Trace(Severity.Error, new FileNotFoundException("Vulcan File Not Found", filename), Resources.VulcanFileNotFound, filename);
                }
            }

            Workflow.ExecutePhaseWorkflowGraph(xmlIR);

            return((MessageEngine.AllEnginesErrorCount + MessageEngine.AllEnginesWarningCount) <= 0);
        }
Ejemplo n.º 7
0
        public XmlIR()
        {
            // TODO: Cleanup up schema handling - put it all in a configured location
            _xmlSchemaSet = new XmlSchemaSet();
            _xmlSchemaSet.Add(null, PathManager.GetToolSubpath("xsd\\vulcan2.xsd"));

            this._documents       = new Dictionary <XmlIRDocumentType, List <XDocument> >();
            this._documentsLoaded = new HashSet <string>();

            foreach (XmlIRDocumentType docType in Enum.GetValues(typeof(XmlIRDocumentType)))
            {
                this._documents.Add(docType, new List <XDocument>());
            }

            this._id          = Guid.NewGuid();
            this._isValidated = false;
            this._message     = MessageEngine.Create(String.Format("__XmlIR: {0}", this._id));
        }
Ejemplo n.º 8
0
 public AdvancedFeaturesPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     this._message            = MessageEngine.Create(WorkflowUniqueName);
 }
Ejemplo n.º 9
0
 public XmlSchemaValidatorPhase(string WorkflowUniqueName)
 {
     this._WorkflowUniqueName = WorkflowUniqueName;
     this.Message             = MessageEngine.Create(WorkflowUniqueName);
 }
Ejemplo n.º 10
0
 public XmlXsltTransformPhase(string WorkflowUniqueName)
 {
     this._workflowUniqueName = WorkflowUniqueName;
     this._message            = MessageEngine.Create(this.WorkflowUniqueName);
 }
Ejemplo n.º 11
0
 public PhasePluginLoader()
 {
     this._PluginLoader = new PluginLoader <IPhase, PhaseFriendlyNameAttribute>(Settings.Default.SubpathPhasePluginFolder, 0, 1);
     this._Message      = MessageEngine.Create("__PHASE PLUGIN LOADER");
 }
Ejemplo n.º 12
0
        private void _loadWorkflows()
        {
            string phaseWorkflowDescriptorPath = PathManager.GetToolSubpath(Settings.Default.SubpathDefaultPhaseWorkflowFile);

            this.Message = MessageEngine.Create(String.Format("__PHASE WORKFLOW LOADER: {0}", phaseWorkflowDescriptorPath));

            XDocument doc = XDocument.Load(phaseWorkflowDescriptorPath);

            //TODO: VSABELLA: REVIEW Remove hardcode schema for now, and load it from the document itself with XPathNavigator.GetNamespaceInScope.
            XNamespace ns = "http://schemas.microsoft.com/detego/2007/07/07/VulcanPhaseWorkflows.xsd";

            this._defaultWorkflowName = doc.Root.Attribute("DefaultWorkflow").Value;
            var phaseWorkflows = from pw in doc.Descendants(ns + "PhaseWorkflow")
                                 select new
            {
                Name   = pw.Attribute("Name").Value,
                Phases = (from phase in pw.Descendants(ns + "Phase")
                          select new
                {
                    Name = phase.Attribute("PhaseName").Value,
                    WorkflowUniqueName = phase.Attribute("WorkflowUniqueName").Value,
                    Parameters = (from param in phase.Descendants(ns + "Parameter")
                                  select new
                    {
                        Name = param.Attribute("Name").Value,
                        Type = param.Attribute("Type").Value,
                        Value = param.Value
                    })
                }),

                IRVectors = (from irVector in pw.Descendants(ns + "IRFlowVector")
                             select new
                {
                    SourceWorkflowUniqueName = irVector.Attribute("SourceWorkflowUniqueName").Value,
                    SinkWorkflowUniqueName = irVector.Attribute("SinkWorkflowUniqueName").Value
                })
            };

            foreach (var phaseWorkflow in phaseWorkflows)
            {
                if (!this._phaseWorkflowsByName.ContainsKey(phaseWorkflow.Name))
                {
                    PhaseWorkflow workflow = new PhaseWorkflow(phaseWorkflow.Name);
                    this._phaseWorkflowsByName.Add(workflow.Name, workflow);

                    foreach (var phase in phaseWorkflow.Phases)
                    {
                        Dictionary <string, object> parametersCollection = new Dictionary <string, object>();
                        parametersCollection.Add("WorkflowUniqueName", phase.WorkflowUniqueName);

                        // Error Pathing needs to be reworked in this segment: this is being fixed up and put into Phase.cs
                        foreach (var param in phase.Parameters)
                        {
                            Type paramType = Type.GetType("System." + param.Type, false, false);
                            if (paramType != null)
                            {
                                object convertedValue = TypeConverter.Convert(param.Value, paramType);

                                if (!parametersCollection.ContainsKey(param.Name))
                                {
                                    parametersCollection.Add(param.Name, convertedValue);
                                }
                                else
                                {
                                    Message.Trace(Severity.Error, Resources.ErrorDuplicatePhaseParameterSpecified, phase.WorkflowUniqueName, param.Name);
                                    return;
                                }
                            }
                            else
                            {
                                Message.Trace(Severity.Error, Resources.ErrorInvalidPhaseParameterType, phase.WorkflowUniqueName, param.Name);
                                return;
                            }
                        } // end foreach var param

                        workflow.AddPhase(phase.WorkflowUniqueName, this._phasePluginLoader.RetrievePhase(phase.Name, parametersCollection));
                    } // end foreach Phase

                    foreach (var irVector in phaseWorkflow.IRVectors)
                    {
                        workflow.AddIRFlowVector(irVector.SourceWorkflowUniqueName, irVector.SinkWorkflowUniqueName);
                    } // end foreach irVector inside of the phaseWorkflow
                }
                else
                {
                    Message.Trace(Severity.Error, Resources.ErrorAttemptedWorkflowDuplicatename, phaseWorkflow.Name);
                }
            } // end foreach PhaseWorkflows

            if (!this._phaseWorkflowsByName.ContainsKey(this._defaultWorkflowName))
            {
                Message.Trace(Severity.Error, Resources.ErrorInvalidWorkflowDefaultName, this._defaultWorkflowName);
                throw new Exception();
            }
        }