Пример #1
0
        static void Main(string[] args)
        {
            /*
            InterviewBusiness interviewBusiness = new InterviewBusiness
            {
                Title = "InterviewTitle",
                Position = "InterviewPosition",
                Date = DateTime.Now,
                RequiredSkills = "InterviewRequiredSkills"
            };

            InterviewBusinessObject interviewBusinessObject = new InterviewBusinessObject(new DefaultWorkbench ());

            if (!interviewBusinessObject.Create(interviewBusiness))
            {
                Console.WriteLine("I could not create the interview");
                Console.WriteLine("Error List:");
                foreach (ValidationMessage validationMessage in interviewBusinessObject.Validator.CreatingValidator.ValidationMessages)
                {
                    Console.WriteLine("\t{0}", validationMessage);
                }
            }

              */

            InterviewBusiness ib = new InterviewBusiness
            {
                Date = DateTime.Now.AddDays(2),
                Title = "Title From Workflow",
                Position = "Position From Workflow",
                RequiredSkills = "RequiredSkills"
            };

            CreateInterviewWorkflow activity = new CreateInterviewWorkflow
            {
                InterviewBusiness = new InArgument<InterviewBusiness>((co) => ib)
            };

            System.Activities.WorkflowInvoker invoker = new System.Activities.WorkflowInvoker(activity);
            invoker.Invoke();

            Console.Write("Press Enter to continue...");
            Console.ReadLine();
        }
Пример #2
0
 private void InvokeCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         AsyncInvokeContext asyncState = (AsyncInvokeContext)result.AsyncState;
         WorkflowInvoker    invoker    = asyncState.Invoker;
         Exception          error      = null;
         try
         {
             asyncState.Outputs = invoker.EndInvoke(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             error = exception2;
         }
         invoker.PostInvokeCompletedAndRemove(asyncState, error);
     }
 }
Пример #3
0
        void InvokeCallback(IAsyncResult result)
        {
            if (result.CompletedSynchronously)
            {
                return;
            }
            AsyncInvokeContext context = (AsyncInvokeContext)result.AsyncState;
            WorkflowInvoker    thisPtr = context.Invoker;
            Exception          error   = null;

            try
            {
                context.Outputs = thisPtr.EndInvoke(result);
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                error = e;
            }
            thisPtr.PostInvokeCompletedAndRemove(context, error);
        }
Пример #4
0
        public IDictionary <string, object> Invoke(IDictionary <string, object> inputs, TimeSpan timeout)
        {
            TimeoutHelper.ThrowIfNegativeArgument(timeout);

            return(WorkflowInvoker.Invoke(this.workflow, inputs, timeout, this.extensions));
        }
Пример #5
0
 public IDictionary <string, object> Invoke(IDictionary <string, object> inputs)
 {
     return(WorkflowInvoker.Invoke(this.workflow, inputs, ActivityDefaults.InvokeTimeout, this.extensions));
 }