Exemplo n.º 1
0
 public WorkflowEventArgs(WorkflowInstance wi)
 {
     WorkflowInstance = wi;
 }
Exemplo n.º 2
0
 public WorkflowTerminatedEventArgs(WorkflowInstance wi, string reason)
     : base(wi)
 {
     CodeContract.Requires(!string.IsNullOrEmpty(reason));
     Reason = reason;
 }
Exemplo n.º 3
0
 public EventActivityHandler(WorkflowInstance workflowInstance)
 {
     CodeContract.Requires(workflowInstance != null);
     _workflowInstance = workflowInstance;
     Method = new EventHandler(OnEvent);
 }
Exemplo n.º 4
0
 internal void SetWorkflowInstance(WorkflowInstance workflowInstance)
 {
     CodeContract.Requires(workflowInstance != null);
     _workflowInstance = workflowInstance;
 }
Exemplo n.º 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;
 }