void CreateServices() { _startWorkflowOnObjectChangeService = new StartWorkflowOnObjectChangeService(TimeSpan.FromSeconds(15)); _objectChangedStartWorkflowService = new ObjectChangedStartWorkflowService(); _scheduledWorkflowStartService = new ScheduledWorkflowStartService(); _objectChangedWorkflowStartService = new ObjectChangedWorkflowStartService(); }
void InvokeOnClient(ObjectChangedEventArgs objectChangedEventArgs, ObjectChangedWorkflow objectChangedWorkflow, object targetObjectKey) { Activity activity = ActivityXamlServices.Load(new StringReader(objectChangedWorkflow.Xaml)); var dictionary = StartWorkflowOnObjectChangeService.Dictionary(targetObjectKey, objectChangedEventArgs.PropertyName, objectChangedEventArgs.OldValue); WorkflowInvoker invoker = new WorkflowInvoker(activity); invoker.Extensions.Add(Application.ObjectSpaceProvider); invoker.Invoke(dictionary); }