void SetUp()
 {
     environmentService = new EnvironmentService(new[] { new ExampleEnvironmentProvider() });
     var policies = new Dictionary<string, IPolicy>
         {
             { "A", new AlphaPolicy() }, 
             { "B", new BetaPolicy() }, 
             { "C", new AlphaPolicy() }, 
             { "D", new AlphaPolicy() }, 
             { "E", new CappaPolicy { MatchUserId = new Guid("880A00AD-5C40-447B-821A-2679E757B267")} }, 
             { "F", new CappaPolicy { MatchUserId = new Guid("1E9A7C0C-FC86-4516-BA42-F7232E65A12C")} }, 
             { "G", new DeltaPolicy() }, 
             { "H", new DeltaPolicy() }
         };
     policyService = new PolicyService(new[] { new PolicyProvider(policies) }, environmentService);
     target = new DecisionService(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Test-Decisions.config"), policyService);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DecisionCheckAttribute" /> class.
 /// </summary>
 /// <param name="service">The service.</param>
 public DecisionCheckAttribute(IDecisionService service)
 {
     this.service = service;
     this.Lazy = true;
 }
Example #3
0
 protected internal virtual IDmnDecisionTableResult EvaluateDecision(IDecisionService decisionService, IVariableScope variableScope)
 {
     return(decisionService.EvaluateDecisionTableByKey("testDecision", variableScope.Variables));
 }
Example #4
0
        public void Execute(IBaseDelegateExecution execution)
        {
            IDecisionService decisionService = ((IDelegateExecution)execution).ProcessEngineServices.DecisionService;

            EvaluateDecision(decisionService, execution);
        }
Example #5
0
        public virtual void Notify(IDelegateCaseExecution caseExecution)
        {
            IDecisionService decisionService = caseExecution.ProcessEngineServices.DecisionService;

            EvaluateDecision(decisionService, caseExecution);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DecisionService" /> class.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="cache">The cache.</param>
 /// <param name="cacheDuration">Duration of the cache in seconds.</param>
 public DecisionService(IDecisionService service, Cache<Decision> cache, int cacheDuration)
 {
     this.service = service;
     this.cache = cache;
     this.cacheDuration = cacheDuration;
 }
Example #7
0
 public HomeController(IDecisionService decisionService, IApplicationRepository applicationRepository)
 {
     _decisionService       = decisionService; // new DecisionService(); //
     _applicationRepository = applicationRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DecisionService" /> class.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="cache">The cache.</param>
 public DecisionService(IDecisionService service, Cache<Decision> cache)
     : this(service, cache, 5)
 {
 }
Example #9
0
 public DecisionsController(IPdfService pdfService, IDecisionService decisionService, IMapper mapper)
 {
     _pdfService      = pdfService;
     _decisionService = decisionService;
     _mapper          = mapper;
 }
Example #10
0
        public ActionResult EditDecision(int id)
        {
            IDecisionService     decSrc          = IoC.Resolve <IDecisionService>();
            Company              _currentcompany = IoC.Resolve <ICompanyService>().Getbykey(((EInvoiceContext)FXContext.Current).CurrentCompany.id);
            IRegisterTempService regisSrc        = IoC.Resolve <IRegisterTempService>();

            Decision oDec = decSrc.Getbykey(id);
            //khoi tao mot decision models
            DecisionModels model = new DecisionModels();

            model.City            = oDec.City;
            model.ComAddress      = oDec.ComAddress;
            model.ComID           = oDec.ComID;
            model.ComName         = oDec.ComName;
            model.DecisionNo      = oDec.DecisionNo;
            model.Director        = oDec.Director;
            model.EffectiveDate   = oDec.EffectiveDate;
            model.EffectDate      = oDec.EffectDate;
            model.id              = oDec.id;
            model.ParentCompany   = oDec.ParentCompany;
            model.Requester       = oDec.Requester;
            model.SystemName      = oDec.SystemName;
            model.SoftApplication = oDec.SoftApplication;
            model.TechDepartment  = oDec.TechDepartment;
            model.Workflow        = oDec.Workflow;
            model.Responsibility  = oDec.Responsibility;
            model.Destination     = oDec.Destination;
            model.RegTempList     = new SelectList(from re in regisSrc.Query where re.ComId == _currentcompany.id select re, "InvPattern", "InvPattern");
            //lấy thông tin về mẫu hóa đơn
            string   arr  = oDec.Purpose;
            XElement elem = XElement.Parse(arr);
            IEnumerable <XElement> list = (from c in elem.Elements("Purpose") select c).ToList <XElement>();
            IList <Pupor>          lstp = new List <Pupor>();
            string pt = oDec.ListInvPattern;

            string[]            str = pt.Split(',');
            List <RegisterTemp> qr  = (from r in regisSrc.Query where str.Contains(r.InvPattern) && r.ComId == _currentcompany.id select r).ToList();
            int i = 0;

            if (i < list.Count())
            {
                foreach (XElement xe in list)
                {
                    Pupor p = new Pupor();
                    p.Mucdich     = xe.Value;
                    p.InvPattern  = qr[i].InvPattern;
                    p.InvCateName = qr[i].InvoiceTemp.InvCateName;
                    lstp.Add(p);
                    i++;
                }
            }
            model.DecDatasource = lstp.SerializeJSON <Pupor>();
            //end
            if (oDec.Status != 2)
            {
                model.TaxCode = _currentcompany.TaxCode;
                return(View(model));
            }
            else
            {
                return(RedirectToAction("ListDecision"));
            }
        }
 public DecisionController(IDecisionService service, IEmployeeService employee, IDecisionTypeService decisiontypeService)
 {
     this.service              = service;
     this.employee             = employee;
     this._decisiontypeService = decisiontypeService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DecideController"/> class.
 /// </summary>
 /// <param name="service">The service.</param>
 public DecideController(IDecisionService service)
 {
     this.service = service;
 }