EAImvertor.EAImvertorJob.startJob C# (CSharp) Method

startJob() public method

public startJob ( BackgroundWorker backgroundWorker ) : void
backgroundWorker System.ComponentModel.BackgroundWorker
return void
        public void startJob( BackgroundWorker backgroundWorker)
        {
            this._startDateTime = DateTime.Now;
            this._backgroundWorker = backgroundWorker;
            UML.Classes.Kernel.Package projectPackage = getProjectPackage(this.sourcePackage);
            if (projectPackage != null)
            {
                //create the specific properties for this job
                this.settings.PropertiesFilePath = createSpecificPropertiesFile(projectPackage);
                string xmiFileName = Path.ChangeExtension(Path.GetTempFileName(),".xmi");
                this.setStatus("Exporting Model");
                projectPackage.exportToXMI(xmiFileName);
                this.setStatus("Compressing File");
                if (File.Exists(xmiFileName))
                {
                    xmiFileName = CompressFile(xmiFileName);
                    this.setStatus("Uploading Model");
                    try {
                        this._jobID = this.Upload(settings.imvertorURL+settings.urlPostFix +"upload",settings.PIN,settings.ProcessName,settings.Properties
                                               ,xmiFileName,settings.HistoryFilePath,settings.PropertiesFilePath);

                    this.setStatus("Upload Finished");
                    getJobReport();

                    } catch (Exception e)
                    {
                        this.setStatus("Error");
                        Logger.logError("Error in StartJob: " + e.Message + " stacktrace: "+ e.StackTrace);
                    }
                }else
                {
                    this.setStatus("Cancelled");
                }
            }
            else
            {
                this.setStatus("Error");
                Logger.logError("no «project» package found");
            }
        }