예제 #1
0
        internal void CreateNoFilesToProcessIntegrationJob(IntegrationJobType jobType)
        {
            var gfs = new List <GenericField>
            {
                RightNowServiceBaseObjectBuilder.CreateGenericField("JobStatus", DataTypeEnum.NAMED_ID, RightNowServiceBaseObjectBuilder.CreateNamedID((int)IntegrationJobStatus.Completed)),
                RightNowServiceBaseObjectBuilder.CreateGenericField("JobType", DataTypeEnum.NAMED_ID, RightNowServiceBaseObjectBuilder.CreateNamedID((int)jobType)),
                RightNowServiceBaseObjectBuilder.CreateGenericField("Detail", DataTypeEnum.STRING, "No files were available to process")
            };

            var package = new RNObject[]
            {
                new GenericObject
                {
                    ObjectType = new RNObjectType
                    {
                        Namespace = "IJ",
                        TypeName  = "Job"
                    },
                    GenericFields = gfs.ToArray(),
                }
            };

            GlobalContext.Log("Creating an Integration Job showing that no files were available to process", true);
            _serviceWrapper.CreateObjects(package);
        }
예제 #2
0
        internal void ExecuteIntegrationJob(IntegrationJobType jobType, string[] reportIDs)
        {
            BaseProcessorTemplate processor = null;

            switch (jobType)
            {
            case IntegrationJobType.ReportExport:
                processor = new ReportExportProcessor(reportIDs);
                processor.ProcessData();
                break;
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            // get all the default options
            var options = new CommandLineOptions();

            // parse out all of the arguments and exit if there are any bad ones
            if (!CommandLine.Parser.Default.ParseArguments(args, options))
            {
                GlobalContext.Log(string.Format("Arguments: {0}", string.Join(" ", args)), true);
                GlobalContext.ExitApplication(string.Format("Error parsing application arguments.\r\n\r\n{0}", options.ToString()), 1);
            }

            IntegrationJobType intJobType = IntegrationJobType.All;

            if (options.ProcessType == 1)
            {
                intJobType = IntegrationJobType.ReportExport;
            }

            //// set options globally
            GlobalContext.Options = options;

            GlobalContext.Log(options.ToString(), true);

            var controller = new ProcessingController();

            try
            {
                if (intJobType == IntegrationJobType.All || intJobType == IntegrationJobType.ReportExport)
                {
                    String rIDstr = options.ReportIDs;
                    if (string.IsNullOrEmpty(rIDstr))
                    {
                        rIDstr = "";
                    }

                    controller.ExecuteIntegrationJob(IntegrationJobType.ReportExport, rIDstr.Split(','));
                }
            }
            catch (Exception ex)
            {
                GlobalContext.ExitApplication(string.Format("Application Error.  Message: {0}\nException: {1}", ex.Message, ex.StackTrace), 1);
            }

            // this writes all logging to the logging file
            GlobalContext.ExitApplication("", 0);
        }