Exemplo n.º 1
0
        public void SaveProcessTest()
        {
            IProcessConfig config = null;

            ConfigManager.Create("IE", out config);
            ConfigManager.Save("IE", config);
        }
Exemplo n.º 2
0
        public IResultStream EvaluateToResultStream(IProcessConfig config, IEngineProfile engine)
        {
            var targets = __targets;

            var results = ResultsStreamBuilder.EvaluateTargetsToResults(targets, config, engine);

            return(results);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Load an existing windows process configuration from disk.
 /// </summary>
 /// <param name="name">display name for process</param>
 /// <param name="config">windows process configuration</param>
 public static void Load(string name, out IProcessConfig config)
 {
     config = null;
     using (FileStream stream = ReadStream(name))
     {
         config = (IProcessConfig)ProcessFactory.Create(stream);
     }
 }
Exemplo n.º 4
0
 public virtual IBookResult[] CallEvaluate(IProcessConfig config, IEngineProfile engine,
                                           IPayrollArticle article, IBookIndex element, ITargetValues values, IResultStream results)
 {
     if (__evaluate != null)
     {
         return(__evaluate(this, config, engine, article, element, values, results));
     }
     return(GeneralModule.EMPTY_RESULT_LIST);
 }
Exemplo n.º 5
0
            private static IResultStream EvaluateTarget(
                IResultStream resultStream, IBookTarget target, IProcessConfig config, IEngineProfile engine)
            {
                var targetResults = target.Evaluate(config, engine, resultStream);

                var results = resultStream.AggregateResultList(targetResults);

                return(results);
            }
Exemplo n.º 6
0
        private ProcessServiceModule(ITargetStream targets, IProcessConfig configModule, IEngineProfile engineModule, IProcessServiceLogger logger)
        {
            Targets = targets;

            ConfigModule = configModule;

            EngineModule = engineModule;

            Logger = logger;
        }
Exemplo n.º 7
0
        public void TestSetup()
        {
            IProcessConfigLogger logger = new TestConfigLogger("TestArticleDependencySort");

            testConfig = ProcessConfigSetCzModule.CreateModule(logger);

            testConfig.InitModule();

            logger.CloseLogStream();
        }
Exemplo n.º 8
0
        public void TestSetup()
        {
            IProcessConfigLogger logger = new TestEmptyLogger("TestConceptCollection");

            testConfig = ProcessConfigSetCzModule.CreateModule(logger);

            testConfig.InitModule();

            logger.CloseLogStream();
        }
        public void TestSetup()
        {
            serviceLog = new TestTargetsLogger("TestTargetsCollection");

            testConfig = ProcessConfigSetCzModule.CreateModule(null);

            testEngine = EngineServiceModule.CreateModule();

            testConfig.InitModule();
        }
Exemplo n.º 10
0
            private static IDictionary <IBookIndex, IBookTarget> BuildArticleTarget(
                IDictionary <IBookIndex, IBookTarget> initialStream, IBookParty addParty, IPayrollArticle article,
                ITargetValues addValues, IProcessConfig configModule)
            {
                var results = TargetsTupleComposer.AddTargetBySymbol(initialStream,
                                                                     addParty, article.ArticleSymbol(), addValues, configModule);

                var targets = results.Item2;

                return(targets);
            }
Exemplo n.º 11
0
            public static Tuple <IBookIndex, IDictionary <IBookIndex, IBookTarget> > AddTargetBySymbol(
                IDictionary <IBookIndex, IBookTarget> targets,
                IBookParty party, SymbolName articleName, ITargetValues values, IProcessConfig config)
            {
                IBookIndex newIndex = TargetElementBuilder.BuildIndexWithFirst(targets.Keys, party, articleName.Code);

                KeyValuePair <IBookIndex, IBookTarget> pairToMerge = TargetPairComposer
                                                                     .ComposeTarget(party, articleName, newIndex, values, config);

                var targetIndex = pairToMerge.Key;

                var targetValue = pairToMerge.Value;

                var bookTargets = TargetsDictComposer.MergeDictWithTargetPair(targets, targetIndex, targetValue);

                return(Tuple.Create <IBookIndex, IDictionary <IBookIndex, IBookTarget> >(targetIndex, bookTargets));
            }
Exemplo n.º 12
0
        public ITargetStream CreateEvaluationStream(IProcessConfig configModule)
        {
            IBookParty[] contracts = CollectPartiesForContracts();

            IBookParty[] positions = CollectPartiesForPositions();

            var targetsInit = TargetStreamBuilder.BuildStreamCopy(__targets);

            var articleList = TargetStreamBuilder.BuildArticleStream(__targets);

            var targetsDict = articleList.Aggregate(targetsInit,
                                                    (agr, article) => TargetStreamBuilder.BuildEvaluationStream(agr, contracts, positions, article, configModule));

            var targetsEval = targetsDict.OrderBy(x => x.Value.Article()).
                              ToDictionary(key => key.Key, val => val.Value);

            var lastParty = BookParty.GetEmpty();

            var lastIndex = BookIndex.GetEmpty();

            return(new TargetStream(targetsEval, lastParty, lastIndex));
        }
Exemplo n.º 13
0
 /// <summary>
 /// Save the windows process configuration for the given process.
 /// </summary>
 /// <param name="name">display name for process</param>
 /// <param name="config">windows process configuration</param>
 public static void Save(string name, IProcessConfig config)
 {
     Save(name, (object)config);
 }
Exemplo n.º 14
0
        public static IProcessService CreateModule(ITargetStream targets, IProcessConfig configModule, IEngineProfile engineModule, IProcessServiceLogger logger)
        {
            IProcessService module = new ProcessServiceModule(targets, configModule, engineModule, logger);

            return(module);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Create a new windows process configuration filled with default values.
 /// </summary>
 /// <param name="name">display name for process</param>
 /// <param name="config">windows process configuration</param>
 public static void Create(string name, out IProcessConfig config)
 {
     config = (IProcessConfig)ProcessFactory.Create(name);
 }
Exemplo n.º 16
0
 public IBookResult[] Evaluate(IProcessConfig config, IEngineProfile engine, IResultStream results)
 {
     return(__concept.CallEvaluate(config, engine, __article, __element, __values, results));
 }
Exemplo n.º 17
0
            static public KeyValuePair <IBookIndex, IBookTarget> ComposeTarget(IBookParty party,
                                                                               SymbolName articleName, IBookIndex element, ITargetValues values, IProcessConfig config)
            {
                IBookTarget target = BuildTargetFromElement(element, values, config);

                return(new KeyValuePair <IBookIndex, IBookTarget>(element, target));
            }
Exemplo n.º 18
0
            public static IResultStream EvaluateTargetsToResults(IDictionary <IBookIndex, IBookTarget> targets, IProcessConfig config, IEngineProfile engine)
            {
                IResultStream emptyResults = ResultStream.CreateEmptyStream();

                var results = targets.Aggregate(emptyResults,
                                                (agr, target) => EvaluateTarget(agr, target.Value, config, engine));

                return(results);
            }
Exemplo n.º 19
0
            static public IBookTarget BuildTargetFromElement(IBookIndex element, ITargetValues values, IProcessConfig config)
            {
                uint articleCode = element.Code();

                IPayrollArticle targetArticle = config.FindArticle(articleCode);

                IPayrollConcept targetConcept = config.FindConcept(targetArticle.ConceptCode());

                IBookTarget target = TargetFactory.BuildTargetWithValues(element, targetArticle, targetConcept, values);

                return(target);
            }
Exemplo n.º 20
0
        public void LoadProcessTest()
        {
            IProcessConfig config = null;

            ConfigManager.Load("IE", out config);
        }
Exemplo n.º 21
0
        public ITargetStream AddTargetIntoSubLevel(SymbolName article, ITargetValues values, IProcessConfig config)
        {
            uint articleCode = article.Code;

            IPayrollArticle targetArticle = config.FindArticle(articleCode);

            uint conceptCode = targetArticle.ConceptCode();

            IPayrollConcept targetConcept = config.FindConcept(conceptCode);

            IBookParty addParty = targetConcept.GetTargetParty(LastParty());

            var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(),
                                                                  addParty, article, values, config);

            var nextFacts = retTuple.Item2;

            var nextIndex = retTuple.Item1;

            var nextParty = targetConcept.GetNextTargetParty(nextIndex);

            return(new TargetStream(nextFacts, nextParty, nextIndex));
        }
Exemplo n.º 22
0
        public ITargetStream AddNewPositionsTarget(SymbolName article, ITargetValues values, IProcessConfig config)
        {
            var addParty = LastParty().GetNonPositionParty();

            var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(),
                                                                  addParty, article, values, config);

            var nextFacts = retTuple.Item2;

            var nextIndex = retTuple.Item1;

            var nextParty = nextIndex.GetNewPositionParty(nextIndex.Code(), nextIndex.CodeOrder());

            return(new TargetStream(nextFacts, nextParty, nextIndex));
        }
Exemplo n.º 23
0
            public static IDictionary <IBookIndex, IBookTarget> BuildEvaluationStream(IDictionary <IBookIndex, IBookTarget> initialStream,
                                                                                      IBookParty[] contracts, IBookParty[] positions, IPayrollArticle article, IProcessConfig configModule)
            {
                ITargetValues emptyValues = null;

                IPayrollConcept concept = configModule.FindConcept(article.ConceptCode());

                IBookParty[] parties = concept.GetTargetParties(BookParty.GetEmpty(), contracts, positions);

                var targets = parties.Aggregate(initialStream,
                                                (agr, party) => BuildArticleTarget(initialStream, party, article, emptyValues, configModule));

                return(targets);
            }
        public static ITargetStream BuildCalculationStream(ITargetStream targets, IBookParty[] contractParties, IBookParty[] positionParties, IProcessConfig configModule)
        {
            ITargetStream targetsInit = targets.CreateStreamCopy();

            IPayrollArticle[] relatedList = targetsInit.BookTargetToEvaluate();

            ITargetStream processCalc = relatedList.Aggregate(targetsInit,
                                                              (agr, article) => agr.MergeRealtedArticle(contractParties, positionParties, article, configModule));

            return(processCalc);
        }
Exemplo n.º 25
0
        public ITargetStream AddTargetIntoSumLevel(SymbolName article, ITargetValues values, IProcessConfig config)
        {
            var addParty = LastParty().GetNonContractParty();

            var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(),
                                                                  addParty, article, values, config);

            var nextFacts = retTuple.Item2;

            var nextIndex = retTuple.Item1;

            var nextParty = nextIndex.GetParty();

            return(new TargetStream(nextFacts, nextParty, nextIndex));
        }
Exemplo n.º 26
0
 public override IBookResult[] CallEvaluate(IProcessConfig config, IEngineProfile engine,
                                            IPayrollArticle article, IBookIndex element, ITargetValues values, IResultStream results)
 {
     return(GeneralModule.EMPTY_RESULT_LIST);
 }