Example #1
0
 public WorkflowEventArgs(WorkflowInstance wi)
 {
     WorkflowInstance = wi;
 }
 public WorkflowTerminatedEventArgs(WorkflowInstance wi, string reason)
     : base(wi)
 {
     CodeContract.Requires(!string.IsNullOrEmpty(reason));
     Reason = reason;
 }
Example #3
0
 public EventActivityHandler(WorkflowInstance workflowInstance)
 {
     CodeContract.Requires(workflowInstance != null);
     _workflowInstance = workflowInstance;
     Method = new EventHandler(OnEvent);
 }
Example #4
0
 internal void SetWorkflowInstance(WorkflowInstance workflowInstance)
 {
     CodeContract.Requires(workflowInstance != null);
     _workflowInstance = workflowInstance;
 }
Example #5
0
 private void InitWorkflow()
 {
     _runtime = new WorkflowRuntime();
     _runtime.WorkflowCompleted +=
         (sender, e) =>
         {
             if (e.Result != null)
                 Logger.LogInfo(Message.WorkflowThreadStoppedWithResult, e.Result);
             else
                 Logger.LogInfo(Message.WorkflowThreadStopped);
         };
     _runtime.WorkflowTerminated +=
         (sender, e) =>
         {
             Logger.LogError(Message.WorkflowThreadTerminated, e.Reason);
             WorkflowTerminated.RaiseEvent(this);
         };
     _mainWorkflowInstance = _runtime.CreateWorkflow(
         s_workflowInstanceId,
         _config.WorkflowScheme.Uri,
         _config.WorkflowScheme.XmlSchemas.ToList());
     _mainWorkflowInstance.ExecutionContext.ActivityExecutionStarting +=
         ExecutionContext_ActivityExecutionStarting;
     _mainWorkflowInstance.ExecutionContext.ActivityExecutionFinished +=
         ExecutionContext_ActivityExecutionFinished;
     var commonActivity = (CommonActivity)_mainWorkflowInstance.ExecutionContext.Scheme.Activities
         .First(i => i.Value is CommonActivity).Value;
     commonActivity.InfoOutputStarting += CommonActivity_InfoOutputStarting;
 }