示例#1
0
        public static IWfProcess MoveToNextActivityByExecutor(this IWfProcess process, Func <WfTransitionDescriptorCollection, IWfTransitionDescriptor> predicate, bool persist = true)
        {
            WfTransferParams transferParams = WfTransferParams.FromNextActivity(process.CurrentActivity.Descriptor, predicate);

            WfMoveToExecutor executor = new WfMoveToExecutor(process.CurrentActivity, process.CurrentActivity, transferParams);

            IWfProcess result = process;

            if (persist)
            {
                executor.Execute();
                result = WfRuntime.GetProcessByProcessID(process.ID);
            }
            else
            {
                executor.ExecuteNotPersist();
            }

            return(result);
        }