protected internal TransactionService(ITransactionDataConnector dataConnector, IAgentFactory agentFactory, ITransactionFeeListFactory transactionFeeListFactory,
                                              ITransactionContextFactory transactionContextFactory, ICustomerFactory customerFactory, ITransactionDeficienciesFactory transactionDeficienciesFactory, IDocumentService documentService,
                                              IEvidenceService evidenceService, ILocationFactory locationFactory, IRequirementEvaluator requirementEvaluator, ITransactionHistoryFactory transactionHistoryFactory,
                                              IFeeList feeList, IList <ITransactionType> registeredTransactions)
        {
            this.DataConnector                  = dataConnector ?? throw new ArgumentNullException("dataConnector");
            this.AgentFactory                   = agentFactory ?? throw new ArgumentNullException("agentFactory");
            this.TransactionFeeListFactory      = transactionFeeListFactory ?? throw new ArgumentNullException("feeListFactory");
            this.TransactionContextFactory      = transactionContextFactory ?? throw new ArgumentNullException("transactionContextFactory");
            this.CustomerFactory                = customerFactory ?? throw new ArgumentNullException("customerFactory");
            this.TransactionDeficienciesFactory = transactionDeficienciesFactory ?? throw new ArgumentNullException("transactionDeficienciesFactory");
            this.DocumentService                = documentService ?? throw new ArgumentNullException("documentService");
            this.EvidenceService                = evidenceService ?? throw new ArgumentNullException("evidenceService");
            this.LocationFactory                = locationFactory ?? throw new ArgumentNullException("locationFactory");
            this.RequirementEvaluator           = requirementEvaluator ?? throw new ArgumentNullException("requirementEvaluator");
            this.TransactionHistoryFactory      = transactionHistoryFactory ?? throw new ArgumentNullException("transactionHistoryFactory");
            this.FeeList = feeList ?? throw new ArgumentNullException("feeList");

            if (registeredTransactions == null)
            {
                this.RegisteredTransactionTypes = new List <ITransactionType>();
            }
            else
            {
                this.RegisteredTransactionTypes = registeredTransactions.ToList();
            }
        }
 public GerenciadorReservas(ITransactionContextFactory transactionContextFactory, ICarrosDao carrosDao, IReservasDao reservasDao, IPessoasDao pessoasDao)
 {
     _transactionContextFactory = transactionContextFactory;
     _carrosDao   = carrosDao;
     _reservasDao = reservasDao;
     _pessoasDao  = pessoasDao;
 }
Example #3
0
 public PlainTransactionExecutingAsPluginService
     (ISmartContractExecutiveService smartContractExecutiveService,
     IEnumerable <IPostExecutionPlugin> postPlugins, IEnumerable <IPreExecutionPlugin> prePlugins,
     ITransactionContextFactory transactionContextFactory) : base(
         smartContractExecutiveService, postPlugins, prePlugins, transactionContextFactory)
 {
     _smartContractExecutiveService = smartContractExecutiveService;
 }
Example #4
0
        public ProcessEngineImpl(ProcessEngineConfigurationImpl processEngineConfiguration)
        {
            this.processEngineConfiguration = processEngineConfiguration;
            Name = processEngineConfiguration.ProcessEngineName;

            RepositoryService    = processEngineConfiguration.RepositoryService;
            RuntimeService       = processEngineConfiguration.RuntimeService;
            HistoryService       = processEngineConfiguration.HistoryService;
            IdentityService      = processEngineConfiguration.IdentityService;
            TaskService          = processEngineConfiguration.TaskService;
            FormService          = processEngineConfiguration.FormService;
            ManagementService    = processEngineConfiguration.ManagementService;
            AuthorizationService = processEngineConfiguration.AuthorizationService;
            //this.caseService = processEngineConfiguration.CaseService;
            FilterService       = processEngineConfiguration.FilterService;
            ExternalTaskService = processEngineConfiguration.ExternalTaskService;
            DecisionService     = processEngineConfiguration.DecisionService;

            DatabaseSchemaUpdate            = processEngineConfiguration.DatabaseSchemaUpdate;
            JobExecutor                     = processEngineConfiguration.JobExecutor;
            commandExecutor                 = processEngineConfiguration.CommandExecutorTxRequired;
            CommandExecutorSchemaOperations = processEngineConfiguration.CommandExecutorSchemaOperations;
            //SessionFactories = processEngineConfiguration.SessionFactories;
            HistoryLevel = processEngineConfiguration.HistoryLevel;
            TransactionContextFactory = processEngineConfiguration.TransactionContextFactory;
            Log.LogDebug("使用的TransactionContextFactory:", TransactionContextFactory.GetType().Name.ToString());
            //TODO 数据库初始化入口
            //ExecuteSchemaOperations();

            if (ReferenceEquals(Name, null))
            {
                Name = ProcessEngines.NameDefault;
                Log.ProcessEngineCreated(ProcessEngines.NameDefault);
            }
            else
            {
                Log.ProcessEngineCreated(Name);
            }

            ProcessEngines.RegisterProcessEngine(this);

            if (JobExecutor != null)
            {
                JobExecutor.RegisterProcessEngine(this);
            }

            if (processEngineConfiguration.MetricsEnabled)
            {
                var reporterId        = processEngineConfiguration.MetricsReporterIdProvider.ProvideId(this);
                var dbMetricsReporter = processEngineConfiguration.DbMetricsReporter;
                dbMetricsReporter.ReporterId = reporterId;

                if (processEngineConfiguration.DbMetricsReporterActivate)
                {
                    dbMetricsReporter.Start();
                }
            }
        }
Example #5
0
 public CommandContext(ProcessEngineConfigurationImpl processEngineConfiguration,
                       ITransactionContextFactory transactionContextFactory, IScope scope)
 {
     Scope = scope;
     this.processEngineConfiguration = processEngineConfiguration;
     failedJobCommandFactory         = processEngineConfiguration.FailedJobCommandFactory;
     //sessionFactories = processEngineConfiguration.SessionFactories;
     transactionContext = transactionContextFactory.OpenTransactionContext(this);
     RestrictUserOperationLogToAuthenticatedUsers =
         processEngineConfiguration.RestrictUserOperationLogToAuthenticatedUsers;
 }
Example #6
0
 public PlainTransactionExecutingService(ISmartContractExecutiveService smartContractExecutiveService,
                                         IEnumerable <IPostExecutionPlugin> postPlugins, IEnumerable <IPreExecutionPlugin> prePlugins,
                                         ITransactionContextFactory transactionContextFactory)
 {
     _smartContractExecutiveService = smartContractExecutiveService;
     _transactionContextFactory     = transactionContextFactory;
     _prePlugins   = GetUniquePlugins(prePlugins);
     _postPlugins  = GetUniquePlugins(postPlugins);
     Logger        = NullLogger <PlainTransactionExecutingService> .Instance;
     LocalEventBus = NullLocalEventBus.Instance;
 }
        public ResourceExtractionService(IBlockchainService blockchainService,
                                         ISmartContractExecutiveService smartContractExecutiveService,
                                         INonparallelContractCodeProvider nonparallelContractCodeProvider,
                                         ITransactionContextFactory transactionContextFactory)
        {
            _smartContractExecutiveService   = smartContractExecutiveService;
            _nonparallelContractCodeProvider = nonparallelContractCodeProvider;
            _transactionContextFactory       = transactionContextFactory;
            _blockchainService = blockchainService;

            Logger = NullLogger <ResourceExtractionService> .Instance;
        }
        public SmartContractExecutiveService(IDefaultContractZeroCodeProvider defaultContractZeroCodeProvider,
                                             ISmartContractRunnerContainer smartContractRunnerContainer,
                                             IHostSmartContractBridgeContextService hostSmartContractBridgeContextService,
                                             ISmartContractRegistrationProvider smartContractRegistrationProvider,
                                             ISmartContractExecutiveProvider smartContractExecutiveProvider, ITransactionContextFactory transactionContextFactory)
        {
            _defaultContractZeroCodeProvider       = defaultContractZeroCodeProvider;
            _smartContractRunnerContainer          = smartContractRunnerContainer;
            _hostSmartContractBridgeContextService = hostSmartContractBridgeContextService;
            _smartContractRegistrationProvider     = smartContractRegistrationProvider;
            _smartContractExecutiveProvider        = smartContractExecutiveProvider;
            _transactionContextFactory             = transactionContextFactory;

            Logger = NullLogger <SmartContractExecutiveService> .Instance;
        }
 public TestingSmartContractExecutiveService(
     IDefaultContractZeroCodeProvider defaultContractZeroCodeProvider,
     ISmartContractRunnerContainer smartContractRunnerContainer,
     IHostSmartContractBridgeContextService hostSmartContractBridgeContextService,
     ISmartContractRegistrationProvider smartContractRegistrationProvider,
     ISmartContractExecutiveProvider smartContractExecutiveProvider,
     ITransactionContextFactory transactionContextFactory)
     : base(defaultContractZeroCodeProvider,
            smartContractRunnerContainer,
            hostSmartContractBridgeContextService,
            smartContractRegistrationProvider,
            smartContractExecutiveProvider,
            transactionContextFactory
            )
 {
 }
Example #10
0
        public ProcessEngineImpl(ProcessEngineConfigurationImpl processEngineConfiguration)
        {
            this.processEngineConfiguration = processEngineConfiguration;
            this.name = processEngineConfiguration.ProcessEngineName;
            this.repositoryService         = processEngineConfiguration.RepositoryService;
            this.runtimeService            = processEngineConfiguration.RuntimeService;
            this.historicDataService       = processEngineConfiguration.HistoryService;
            this.taskService               = processEngineConfiguration.TaskService;
            this.managementService         = processEngineConfiguration.ManagementService;
            this.dynamicBpmnService        = processEngineConfiguration.DynamicBpmnService;
            this.asyncExecutor             = processEngineConfiguration.AsyncExecutor;
            this.commandExecutor           = processEngineConfiguration.CommandExecutor;
            this.sessionFactories          = processEngineConfiguration.SessionFactories;
            this.transactionContextFactory = processEngineConfiguration.TransactionContextFactory;

            if (processEngineConfiguration.UsingRelationalDatabase && processEngineConfiguration.DatabaseSchemaUpdate is object)
            {
                commandExecutor.Execute(processEngineConfiguration.SchemaCommandConfig, new SchemaOperationsProcessEngineBuild());
            }

            if (name is null)
            {
                log.LogInformation("default activiti ProcessEngine created");
            }
            else
            {
                log.LogInformation($"ProcessEngine {name} created");
            }

            ProcessEngineFactory.RegisterProcessEngine(this);

            if (asyncExecutor != null && asyncExecutor.AutoActivate)
            {
                asyncExecutor.Start();
            }

            if (processEngineConfiguration.ProcessEngineLifecycleListener != null)
            {
                processEngineConfiguration.ProcessEngineLifecycleListener.OnProcessEngineBuilt(this);
            }

            processEngineConfiguration.EventDispatcher.DispatchEvent(ActivitiEventBuilder.CreateGlobalEvent(ActivitiEventType.ENGINE_CREATED));
        }
 public TransactionContextInterceptor(ITransactionContextFactory transactionContextFactory)
 {
     this.transactionContextFactory = transactionContextFactory;
 }
Example #12
0
 public TransactionReadOnlyExecutionService(ISmartContractExecutiveService smartContractExecutiveService,
                                            ITransactionContextFactory transactionContextFactory)
 {
     _smartContractExecutiveService = smartContractExecutiveService;
     _transactionContextFactory     = transactionContextFactory;
 }
Example #13
0
 public TransactionServiceFactory(IProcessSettingsFactory settingsFactory, ITransactionDataConnector dataConnector, IAgentFactory agentFactory, IAlternateBranchFactory alternateBranchFactory,
                                  ITransactionFeeListFactory transactionFeeListFactory, ITransactionContextFactory transactionContextFactory, ICustomerFactory customerFactory, ITransactionDeficienciesFactory transactionDeficienciesFactory,
                                  IDocumentService documentService, ILogicEvaluatorTypeFactory evaluatorTypeFactory, IEvidenceService evidenceService, ILocationFactory locationFactory,
                                  IParameterSerializer parameterSerializer, IPlatformService platformService, IProcessStepFactory processStepFactory, IProcessStepTypeFactory processStepTypeFactory,
                                  IRequirementEvaluator requirementEvaluator, IRequirementFactory requirementFactory, ITransactionHistoryFactory transactionHistoryFactory,
                                  ITransactionProcessFactory transactionProcessFactory, IFeeList feeList)
 {
     this.SettingsFactory                = settingsFactory ?? throw new ArgumentNullException("settingsFactory");
     this.DataConnector                  = dataConnector ?? throw new ArgumentNullException("dataConnector");
     this.AgentFactory                   = agentFactory ?? throw new ArgumentNullException("agentFactory.");
     this.AlternateBranchFactory         = alternateBranchFactory ?? throw new ArgumentNullException("alternateBrachFactory");
     this.TransactionFeeListFactory      = transactionFeeListFactory ?? throw new ArgumentNullException("transactionFeeListFactory");
     this.TransactionContextFactory      = transactionContextFactory ?? throw new ArgumentNullException("transactionContextFactory");
     this.CustomerFactory                = customerFactory ?? throw new ArgumentNullException("customerFactory.");
     this.TransactionDeficienciesFactory = transactionDeficienciesFactory ?? throw new ArgumentNullException("transactionDeficienciesFactory");
     this.DocumentService                = documentService ?? throw new ArgumentNullException("documentService");
     this.EvaluatorTypeFactory           = evaluatorTypeFactory ?? throw new ArgumentNullException("evaluatorTypeFactory.");
     this.EvidenceService                = evidenceService ?? throw new ArgumentNullException("evidenceService");
     this.LocationFactory                = locationFactory ?? throw new ArgumentNullException("locationFactory.");
     this.PlatformService                = platformService ?? throw new ArgumentNullException("platformService.");
     this.ProcessStepFactory             = processStepFactory ?? throw new ArgumentNullException("processStepFactory.");
     this.ProcessStepTypeFactory         = processStepTypeFactory ?? throw new ArgumentNullException("processStepTypeFactory.");
     this.RequirementEvaluator           = requirementEvaluator ?? throw new ArgumentNullException("requirementEvaluator");
     this.RequirementFactory             = requirementFactory ?? throw new ArgumentNullException("requirementFactory.");
     this.TransactionHistoryFactory      = transactionHistoryFactory ?? throw new ArgumentNullException("transactionHistoryFactory");
     this.TransactionProcessFactory      = transactionProcessFactory ?? throw new ArgumentNullException("transactionProcessFactory.");
     this.ParameterSerializer            = parameterSerializer ?? throw new ArgumentNullException("parameterSerializer");
     this.FeeList = feeList ?? throw new ArgumentNullException("feeList");
 }
Example #14
0
        public Transaction(IProcessExecutionContext executionContext, IAgentFactory agentFactory, ITransactionFeeListFactory transactionFeeListFactory, ITransactionContextFactory transactionContextFactory,
                           ICustomerFactory customerFactory, ITransactionDeficienciesFactory transactionDeficienciesFactory, IDocumentService documentService, IEvidenceService evidenceService,
                           ILocationFactory locationFactory, IRequirementEvaluator requirementEvaluator, ITransactionHistoryFactory transactionHistoryFactory, ITransactionService transactionService,
                           ITransactionType transactionType, ITransactionRecord record)
            : base(record.RecordType, record.Id)
        {
            this.ExecutionContext = executionContext ?? throw new ArgumentNullException("executionContext");

            this.AgentFactory = agentFactory ?? throw new ArgumentNullException("agentFactory");
            this.TransactionFeeListFactory      = transactionFeeListFactory ?? throw new ArgumentNullException("transactionFeeListFactory");
            this.TransactionContextFactory      = transactionContextFactory ?? throw new ArgumentNullException("transactionContextFactory");
            this.CustomerFactory                = customerFactory ?? throw new ArgumentNullException("customerFactory");
            this.TransactionDeficienciesFactory = transactionDeficienciesFactory ?? throw new ArgumentNullException("transactionDeficienciesFactory");
            this.DocumentService                = documentService ?? throw new ArgumentNullException("documentService");
            this.EvidenceService                = evidenceService ?? throw new ArgumentNullException("evidenceService");
            this.LocationFactory                = locationFactory ?? throw new ArgumentNullException("locationFactory");
            this.RequirementEvaluator           = requirementEvaluator ?? throw new ArgumentNullException("requirementEvaluator");
            this.TransactionHistoryFactory      = transactionHistoryFactory ?? throw new ArgumentNullException("transactionHistoryFactory");
            this.TransactionService             = transactionService ?? throw new ArgumentNullException("transactionService");

            this.TransactionType = transactionType ?? throw new ArgumentNullException("transactionType");

            this.Name                 = record.Name;
            this.ReferenceNumber      = record.ReferenceNumber;
            this.PricingDate          = record.PricingDate ?? DateTime.Now.Date;
            this.InitiatingProcessId  = record.InitiatingProcessId ?? throw new ArgumentNullException("InitiatingProcessId");
            this.CurrentProcessId     = record.CurrentProcessId ?? throw new ArgumentNullException("CurrentProcessId");
            this.CurrentStepId        = record.CurrentStepId ?? throw new ArgumentNullException("CurrentStepId");
            this.ContextRecordId      = record.ContextRecordId ?? throw new ArgumentNullException("contextRecordId");
            this.CustomerId           = record.CustomerId ?? throw new ArgumentNullException("customerId");
            this.InitiatingAgentId    = record.InitiatingAgentId ?? throw new ArgumentNullException("initiatingAgentId");
            this.InitiatingLocationId = record.InitiatingLocationId ?? throw new ArgumentNullException("initiatingLocationId");
        }