コード例 #1
0
        public static Builder BuildWorkflow(JobId id, IJobContext context = null)
        {
            if (id == default(JobId))
            {
                throw new ArgumentNullException("id");
            }

            return(new Builder(id, context));
        }
コード例 #2
0
        /// <summary>
        /// keep track of jobs, processed this jobcontext.
        /// </summary>
        /// <param name="id"></param>
        public void AddToProcessed(JobId id)
        {
            if (id == default(JobId))
            {
                throw new ArgumentNullException("id");
            }

            _processedJobs.Add(id);
        }
コード例 #3
0
        public JobContext(JobId parentId)
        {
            ParentJobId = parentId ?? throw new ArgumentNullException("parentId");

            _processedJobs = new ConcurrentBag <JobId>();
            _values        = new ConcurrentDictionary <string, object>();
            _types         = new ConcurrentDictionary <string, Type>();
            _hookManager   = ServiceRepo.Instance.GetServiceOf <INotificationManager <JobId> >();
        }
コード例 #4
0
        public WorkflowJob(JobId id, IJobContext context, WhenFailure onFailure,
                           ShareContext share, IWorkflowHost <IRuntime> host = null)
        {
            if (id == default(JobId) || context == default(IJobContext))
            {
                throw new ArgumentNullException("id, context");
            }

            Id        = id;
            Context   = context;
            OnFailure = onFailure;
            Option    = share;
            _host     = host ?? ServiceRepo.Instance.GetServiceOf <IWorkflowHost <SequentialRuntime> >()?.AsHost();
            _runner   = null;
            _workflow = new List <IAutomatedJob>();
        }
コード例 #5
0
 public AutoJobException(JobId jobDetail, Exception innerException = null, string message = null)
     : base(string.IsNullOrWhiteSpace(message) ? _defaultMessage : message, innerException) => JobDetail = jobDetail ?? throw new ArgumentNullException("jobDetail");
コード例 #6
0
 private Builder(JobId id, IJobContext context = null)
 {
     _id      = id;
     _context = context ?? new JobContext(_id);
 }
コード例 #7
0
 public void PushReportToHookAsync(JobId sender, MessageHook message)
 {
     new Task(() => _hookManager.PushAsync(sender, message)).Start();
 }