public static Builder BuildWorkflow(JobId id, IJobContext context = null) { if (id == default(JobId)) { throw new ArgumentNullException("id"); } return(new Builder(id, context)); }
/// <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); }
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> >(); }
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>(); }
public AutoJobException(JobId jobDetail, Exception innerException = null, string message = null) : base(string.IsNullOrWhiteSpace(message) ? _defaultMessage : message, innerException) => JobDetail = jobDetail ?? throw new ArgumentNullException("jobDetail");
private Builder(JobId id, IJobContext context = null) { _id = id; _context = context ?? new JobContext(_id); }
public void PushReportToHookAsync(JobId sender, MessageHook message) { new Task(() => _hookManager.PushAsync(sender, message)).Start(); }