Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public virtual IWfOperation AddNewOperation(WfBranchesTransferParams transferParams)
        {
            IWfOperation newOperation = this.Process.Factory.CreateOperation(this, transferParams);

            this.Operations.Add(newOperation);

            WorkflowSettings.GetConfig().EnqueueWorkItemExecutor.EnqueueAddNewOperationWorkItem(newOperation);

            return(newOperation);
        }
Exemplo n.º 2
0
        protected WfBranchProcessInfo(SerializationInfo info, StreamingContext context)
        {
            this._Process              = (IWfProcess)info.GetValue("Process", typeof(IWfProcess));
            this._OwnerOperation       = (IWfOperation)info.GetValue("OwnerOperation", typeof(IWfOperation));
            this._OperationID          = info.GetString("OperationID");
            this._Sequence             = info.GetInt32("Sequence");
            this._IsSpecificProcess    = info.GetBoolean("IsSpecificProcess");
            this._ProcessDescriptorKey = info.GetString("ProcessDescriptorKey");

            this._BranchInfoState = (State)info.GetValue("BranchInfoState", typeof(State));

            this._Context = (WfBranchProcessInfoContext)info.GetValue("Context", typeof(WfBranchProcessInfoContext));

            this._LoadingType = (DataLoadingType)info.GetValue("LoadingType", typeof(DataLoadingType));
        }
Exemplo n.º 3
0
        private void DoComplete(IWfActivity activity)
        {
            //下一个点为结束点,进行特殊处理
            if (activity.Descriptor is IWfCompletedActivityDescriptor)
            {
                ((WfActivityBase)activity).Status = WfActivityStatus.Completed;
                this.Status = WfProcessStatus.Completed;

                if (this.EntryInfo != null)
                {
                    IWfOperation        ownerOperation     = this.EntryInfo.OwnerOperation;
                    WfBranchProcessInfo currentProcessInfo = ownerOperation.Branches[this.ID];

                    if (ownerOperation.OperationalType == BranchesOperationalType.Serial)
                    {
                        if (currentProcessInfo.Sequence + 1 < ownerOperation.Branches.Count)
                        {
                            WfBranchProcessInfo nextProcessInfo = ownerOperation.Branches[currentProcessInfo.Sequence + 1];
                            ((WfOperation)ownerOperation).DoNextBranchProcess(nextProcessInfo);
                        }
                    }
                }
            }
        }